mkv2cast.ui

User interface components for mkv2cast.

Provides both Rich-based and legacy text-based progress displays.

class mkv2cast.ui.LegacyProgressUI(progress: bool = True, bar_width: int = 26)[source]

Bases: object

Fallback progress UI when rich is not available.

render(st: UIState) None[source]

Render progress line to terminal.

endline() None[source]

Clear the current progress line.

log(msg: str) None[source]

Print a log message, clearing progress line first.

inc_ok() None[source]

Increment success counter.

inc_skipped() None[source]

Increment skipped counter.

inc_failed() None[source]

Increment failed counter.

get_stats()[source]

Get current stats.

class mkv2cast.ui.UIState(stage: str, pct: int, cur: int, total: int, base: str, eta: str, speed: str, elapsed: str = '')[source]

Bases: object

State for legacy UI rendering.

stage: str
pct: int
cur: int
total: int
base: str
eta: str
speed: str
elapsed: str = ''
class mkv2cast.ui.RichProgressUI(total_files: int, encode_workers: int, integrity_workers: int)[source]

Bases: object

Rich-based progress UI showing all files with their status.

start()[source]

Start the live display.

stop()[source]

Stop the live display.

register_job(inp: Path, backend: str = '')[source]

Register a new job in waiting state.

start_integrity(worker_id: int, _filename: str, inp: Path)[source]

Start integrity check for a file.

update_integrity(worker_id: int, _stage: str, pct: int, _filename: str, speed: str = '', inp: Path | None = None)[source]

Update integrity progress.

stop_integrity(worker_id: int, inp: Path | None = None)[source]

Mark integrity check as complete.

start_encode(worker_id: int, _filename: str, inp: Path, output_file: str = '')[source]

Start encoding for a file.

update_encode(worker_id: int, _stage: str, pct: int, _filename: str, speed: str = '', inp: Path | None = None, out_ms: int = 0, dur_ms: int = 0)[source]

Update encode progress.

stop_encode(worker_id: int, inp: Path | None = None)[source]

Mark encode as complete.

mark_done(inp: Path, _msg: str = '', final_path: Path | None = None, output_size: int = 0)[source]

Mark a job as successfully completed.

mark_failed(inp: Path, reason: str = '')[source]

Mark a job as failed.

mark_skipped(inp: Path, reason: str = '')[source]

Mark a job as skipped.

log(msg: str)[source]

Add a message to the log.

get_stats() Tuple[int, int, int, int][source]

Get current statistics.

class mkv2cast.ui.SimpleRichUI(progress_enabled: bool = True)[source]

Bases: object

Simple Rich-based UI for sequential file processing.

log(msg: str, style: str = '') None[source]

Print a log message.

log_file_start(inp: Path, output: Path) None[source]

Log start of file processing.

log_skip(reason: str) None[source]

Log a skip.

log_error(error: str) None[source]

Log an error.

log_success(elapsed: float, output_size: int = 0) None[source]

Log success.

log_compatible() None[source]

Log file is already compatible.

run_ffmpeg_with_progress(cmd: List[str], stage: str, dur_ms: int = 0, file_idx: int = 1, total_files: int = 1) Tuple[int, str][source]

Run ffmpeg command while showing progress.

Returns (return_code, error_message).

print_summary(total_time: float) None[source]

Print final summary.

inc_ok() None[source]

Increment success counter.

inc_skipped() None[source]

Increment skipped counter.

inc_failed() None[source]

Increment failed counter.

get_stats()[source]

Get current stats.

Modules

legacy_ui

Legacy text-based progress UI for mkv2cast.

rich_ui

Rich-based progress UI for mkv2cast.

simple_rich

Simple Rich-based progress UI for mkv2cast (sequential mode).