pub struct SyncArgs {Show 14 fields
pub positional_paths: Vec<PathBuf>,
pub video: Option<PathBuf>,
pub subtitle: Option<PathBuf>,
pub input_paths: Vec<PathBuf>,
pub recursive: bool,
pub offset: Option<f32>,
pub method: Option<SyncMethodArg>,
pub window: u32,
pub vad_sensitivity: Option<f32>,
pub output: Option<PathBuf>,
pub verbose: bool,
pub dry_run: bool,
pub force: bool,
pub batch: Option<Option<PathBuf>>,
}
Expand description
Refactored sync command arguments supporting multiple sync methods.
Fields§
§positional_paths: Vec<PathBuf>
Positional file or directory paths to process. Can include video, subtitle, or directories.
video: Option<PathBuf>
Video file path (optional if using positional paths or manual offset).
subtitle: Option<PathBuf>
Subtitle file path (optional if using positional paths or manual offset).
input_paths: Vec<PathBuf>
Specify file or directory paths to process (via -i), can be used multiple times
recursive: bool
Recursively process subdirectories (new parameter)
offset: Option<f32>
Manual time offset in seconds (positive delays subtitles, negative advances them).
method: Option<SyncMethodArg>
Sync method selection.
window: u32
Analysis time window in seconds.
vad_sensitivity: Option<f32>
VAD sensitivity threshold.
output: Option<PathBuf>
Output file path.
verbose: bool
Verbose output.
dry_run: bool
Dry run mode.
force: bool
Force overwrite existing output file.
batch: Option<Option<PathBuf>>
Enable batch processing mode. Can optionally specify a directory path.
Implementations§
Source§impl SyncArgs
impl SyncArgs
Sourcepub fn get_output_path(&self) -> Option<PathBuf>
pub fn get_output_path(&self) -> Option<PathBuf>
Get output file path.
Sourcepub fn is_manual_mode(&self) -> bool
pub fn is_manual_mode(&self) -> bool
Check if in manual mode.
Sourcepub fn sync_method(&self) -> SyncMethod
pub fn sync_method(&self) -> SyncMethod
Determine sync method (backward compatible).
Sourcepub fn validate_compat(&self) -> SubXResult<()>
pub fn validate_compat(&self) -> SubXResult<()>
Validate parameters (backward compatible method).
Sourcepub fn requires_video(&self) -> bool
pub fn requires_video(&self) -> bool
Return whether video file is required (auto sync).
Sourcepub fn get_input_handler(&self) -> Result<InputPathHandler, SubXError>
pub fn get_input_handler(&self) -> Result<InputPathHandler, SubXError>
Get all input paths, combining video, subtitle and input_paths parameters Note: For sync command, both video and subtitle are valid input paths
Sourcepub fn get_sync_mode(&self) -> Result<SyncMode, SubXError>
pub fn get_sync_mode(&self) -> Result<SyncMode, SubXError>
Get sync mode: single file or batch
Trait Implementations§
Source§impl Args for SyncArgs
impl Args for SyncArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moreSource§impl FromArgMatches for SyncArgs
impl FromArgMatches for SyncArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches
to self
.