How epakai/hbr works
Main Components
a) Core Components:
• HBR Main Program
• HBR-Gen Program
• Configuration Manager
• Command Generator
• Validation System
• File System Interface
b) External Dependencies:
• HandBrakeCLI
• ffmpegthumbnailer (optional)
• GLib2.0
Top Layer: User Interface
Middle Layer: Core Processing
Bottom Layer: External Systems
Component Relationships
a) Input Flow:
• User → HBR/HBR-Gen (CLI Interface)
• Keyfiles → Configuration Manager
• Global Config → Configuration Manager
b) Processing Flow:
• Configuration Manager → Validation System
• Validation System → Command Generator
• Command Generator → HandBrakeCLI Executor
c) Output Flow:
• HandBrakeCLI Executor → Output Files
• HandBrakeCLI Executor → Log Files
• Preview Generator → Thumbnail Files (when enabled)
Detailed Component Descriptions
a) HBR Main Program:
• Entry point for encoding operations
• Handles keyfile processing
• Manages HandBrakeCLI execution
b) HBR-Gen Program:
• Template generator for keyfiles
• Supports episode list processing
• Handles automatic section generation
c) Configuration Manager:
• Processes global config ($XDG_CONFIG_HOME/hbr/hbr.conf)
• Handles keyfile parsing
• Manages configuration inheritance
d) Validation System:
• Validates boolean parameters
• Checks file paths and permissions
• Verifies media type configurations
• Ensures proper filename components
e) Command Generator:
• Constructs HandBrakeCLI commands
• Handles parameter override logic
• Manages output filename generation
Notes Section
Notes about:
• Configuration precedence
• Supported HandBrake versions (based on options-*.h files)
• File naming conventions
• Error handling paths
Remember to include version compatibility handling, as indicated by the multiple options-*.h files in the source tree, showing how the system adapts to different HandBrake versions.