|
| 1 | +# ChapterTool - Modern Cross-Platform Edition |
| 2 | + |
| 3 | +A modern, cross-platform chapter extraction and editing tool built with Avalonia UI and .NET 8. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Cross-Platform**: Runs on Windows, macOS, and Linux |
| 8 | +- **Modern UI**: Built with Avalonia UI framework |
| 9 | +- **Multiple Format Support**: Extract and edit chapters from various media formats |
| 10 | +- **MVVM Architecture**: Clean separation of concerns with proper MVVM pattern |
| 11 | + |
| 12 | +## Supported File Formats |
| 13 | + |
| 14 | +### Input Formats |
| 15 | +- **OGM** (`.txt`) - Simple text-based chapter format |
| 16 | +- **XML** (`.xml`) - Matroska XML chapter format |
| 17 | +- **MPLS** (`.mpls`) - Blu-ray playlist files |
| 18 | +- **IFO** (`.ifo`) - DVD information files |
| 19 | +- **XPL** (`.xpl`) - HD DVD playlist files |
| 20 | +- **CUE** (`.cue`, `.flac`, `.tak`) - Cue sheets and embedded cues |
| 21 | +- **Matroska** (`.mkv`, `.mka`) - Matroska media files |
| 22 | +- **MP4** (`.mp4`, `.m4a`, `.m4v`) - MP4 media files |
| 23 | +- **WebVTT** (`.vtt`) - Web Video Text Tracks |
| 24 | + |
| 25 | +### Export Formats |
| 26 | +- Plain text (OGM format) |
| 27 | +- XML (Matroska format) |
| 28 | +- QPF (QP file for video encoding) |
| 29 | +- JSON (custom format) |
| 30 | +- CUE sheets |
| 31 | +- Timecodes |
| 32 | + |
| 33 | +## Requirements |
| 34 | + |
| 35 | +### Runtime |
| 36 | +- .NET 8 Runtime |
| 37 | +- **For Matroska support**: [MKVToolNix](https://mkvtoolnix.download/) |
| 38 | +- **For MP4 support**: libmp4v2 (included for Windows) |
| 39 | + |
| 40 | +### Development |
| 41 | +- .NET 8 SDK |
| 42 | +- Visual Studio 2022, VS Code, or Rider |
| 43 | + |
| 44 | +## Building from Source |
| 45 | + |
| 46 | +```bash |
| 47 | +# Clone the repository |
| 48 | +git clone https://github.com/tautcony/ChapterTool.git |
| 49 | +cd ChapterTool |
| 50 | + |
| 51 | +# Restore dependencies |
| 52 | +dotnet restore ChapterTool.Modern.sln |
| 53 | + |
| 54 | +# Build the solution |
| 55 | +dotnet build ChapterTool.Modern.sln |
| 56 | + |
| 57 | +# Run the application |
| 58 | +dotnet run --project ChapterTool.Avalonia |
| 59 | +``` |
| 60 | + |
| 61 | +## Project Structure |
| 62 | + |
| 63 | +``` |
| 64 | +ChapterTool/ |
| 65 | +├── ChapterTool.Core/ # Core business logic library |
| 66 | +│ ├── Models/ # Data models |
| 67 | +│ ├── Util/ # Utilities and helpers |
| 68 | +│ ├── ChapterData/ # Format-specific parsers |
| 69 | +│ ├── Knuckleball/ # MP4 chapter support |
| 70 | +│ └── SharpDvdInfo/ # DVD parsing |
| 71 | +├── ChapterTool.Avalonia/ # Avalonia UI application |
| 72 | +│ ├── Views/ # XAML views |
| 73 | +│ ├── ViewModels/ # View models |
| 74 | +│ └── Assets/ # Icons and resources |
| 75 | +└── Time_Shift/ # Legacy .NET Framework version |
| 76 | +``` |
| 77 | + |
| 78 | +## Architecture |
| 79 | + |
| 80 | +The application follows the MVVM (Model-View-ViewModel) pattern: |
| 81 | + |
| 82 | +- **Models** (`ChapterTool.Core`): Platform-independent business logic |
| 83 | +- **Views** (`ChapterTool.Avalonia/Views`): Avalonia XAML UI definitions |
| 84 | +- **ViewModels** (`ChapterTool.Avalonia/ViewModels`): Presentation logic and data binding |
| 85 | + |
| 86 | +### Key Components |
| 87 | + |
| 88 | +#### Core Library |
| 89 | +- **ChapterInfo**: Main data model for chapter information |
| 90 | +- **Chapter Parsers**: Format-specific parsers for all supported formats |
| 91 | +- **ToolKits**: Utility methods for time conversions and formatting |
| 92 | +- **Cross-Platform Services**: |
| 93 | + - `RegistryStorage`: JSON-based settings storage |
| 94 | + - `Logger`: Event-based logging |
| 95 | + - `Notification`: UI notification abstraction |
| 96 | + |
| 97 | +#### Avalonia UI |
| 98 | +- **MainWindowViewModel**: Main application view model |
| 99 | +- **ChapterViewModel**: Individual chapter data binding |
| 100 | +- MVVM commands for file operations |
| 101 | + |
| 102 | +## Platform-Specific Notes |
| 103 | + |
| 104 | +### Windows |
| 105 | +- Native MP4 support with bundled libmp4v2.dll |
| 106 | +- MKVToolNix detection via installation path |
| 107 | + |
| 108 | +### Linux |
| 109 | +- Install libmp4v2 via package manager: |
| 110 | + ```bash |
| 111 | + # Debian/Ubuntu |
| 112 | + sudo apt install libmp4v2-2 |
| 113 | + |
| 114 | + # Fedora/RHEL |
| 115 | + sudo dnf install libmp4v2 |
| 116 | + |
| 117 | + # Arch Linux |
| 118 | + sudo pacman -S libmp4v2 |
| 119 | + ``` |
| 120 | +- MKVToolNix typically in `/usr/bin` |
| 121 | + |
| 122 | +### macOS |
| 123 | +- Install dependencies via Homebrew: |
| 124 | + ```bash |
| 125 | + brew install mp4v2 mkvtoolnix |
| 126 | + ``` |
| 127 | + |
| 128 | +## Publishing |
| 129 | + |
| 130 | +### Self-Contained Executable |
| 131 | + |
| 132 | +```bash |
| 133 | +# Windows |
| 134 | +dotnet publish ChapterTool.Avalonia -c Release -r win-x64 --self-contained -p:PublishSingleFile=true |
| 135 | + |
| 136 | +# Linux |
| 137 | +dotnet publish ChapterTool.Avalonia -c Release -r linux-x64 --self-contained -p:PublishSingleFile=true |
| 138 | + |
| 139 | +# macOS |
| 140 | +dotnet publish ChapterTool.Avalonia -c Release -r osx-x64 --self-contained -p:PublishSingleFile=true |
| 141 | +``` |
| 142 | + |
| 143 | +### Framework-Dependent |
| 144 | + |
| 145 | +```bash |
| 146 | +dotnet publish ChapterTool.Avalonia -c Release -r <runtime-identifier> |
| 147 | +``` |
| 148 | + |
| 149 | +## Migration from Legacy Version |
| 150 | + |
| 151 | +This modern version maintains compatibility with chapter files created by the legacy .NET Framework version. Settings and configurations will be migrated from Registry (Windows) to JSON-based storage automatically. |
| 152 | + |
| 153 | +For detailed migration information, see [MIGRATION.md](../MIGRATION.md). |
| 154 | + |
| 155 | +## Usage |
| 156 | + |
| 157 | +1. **Load a File**: Click "Load File" and select a media file or chapter file |
| 158 | +2. **View Chapters**: Chapters are displayed in the main grid |
| 159 | +3. **Edit Chapters**: Modify chapter names and times |
| 160 | +4. **Apply Time Expression**: Use expressions to adjust all chapter times |
| 161 | +5. **Export**: Choose export format and save chapters |
| 162 | + |
| 163 | +## Development Status |
| 164 | + |
| 165 | +This is the modern cross-platform rewrite of ChapterTool. Current status: |
| 166 | + |
| 167 | +✅ Core library fully functional with all parsers |
| 168 | +✅ Avalonia UI framework set up |
| 169 | +✅ Basic MVVM architecture implemented |
| 170 | +🚧 UI implementation in progress |
| 171 | +🚧 Full feature parity with legacy version |
| 172 | +🚧 Comprehensive testing on all platforms |
| 173 | + |
| 174 | +## Contributing |
| 175 | + |
| 176 | +Contributions are welcome! Please feel free to submit issues and pull requests. |
| 177 | + |
| 178 | +## License |
| 179 | + |
| 180 | +Distributed under the GPLv3+ License. See [LICENSE](../LICENSE) for more information. |
| 181 | + |
| 182 | +## Acknowledgments |
| 183 | + |
| 184 | +- Original .NET Framework version by TautCony |
| 185 | +- [Avalonia UI](https://avaloniaui.net/) - Cross-platform XAML framework |
| 186 | +- [CommunityToolkit.Mvvm](https://github.com/CommunityToolkit/dotnet) - MVVM helpers |
| 187 | +- All the open-source projects that made this possible |
| 188 | + |
| 189 | +## Links |
| 190 | + |
| 191 | +- **Original Project**: [GitHub](https://github.com/tautcony/ChapterTool) |
| 192 | +- **Documentation**: [Wiki](https://github.com/tautcony/ChapterTool/wiki) |
| 193 | +- **Issue Tracker**: [Issues](https://github.com/tautcony/ChapterTool/issues) |
0 commit comments