From 8ada36e962ca524c67533dfbb170da68e3afbf9a Mon Sep 17 00:00:00 2001 From: Warren Lo Date: Thu, 19 Mar 2026 01:07:38 +0800 Subject: [PATCH] Add config module --- src/config.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/config.rs diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..c443933 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,39 @@ +//! Configuration module +//! +//! Command line arguments and runtime configuration + +use anyhow::Result; +use clap::Parser; +use std::path::PathBuf; + +#[derive(Parser, Debug)] +#[command(name = "momentry")] +#[command(about = "MoMentry Playground - Unified media player with overlays")] +pub struct Config { + #[arg(short = 'v', long = "video", help = "Video file path")] + pub video: Option, + + #[arg(short = 'a', long = "asr", help = "ASR JSON file path")] + pub asr: Option, + + #[arg(short = 'y', long = "yolo", help = "YOLO JSON file path")] + pub yolo: Option, + + #[arg(short = 'w', long = "width", default_value = "1280", help = "Window width")] + pub width: u32, + + #[arg(short = 'h', long = "height", default_value = "720", help = "Window height")] + pub height: u32, + + #[arg(long = "fullscreen", help = "Start in fullscreen mode")] + pub fullscreen: bool, + + #[arg(long = "locale", default_value = "en", help = "UI language (en, zh-TW, etc.)")] + pub locale: String, +} + +impl Config { + pub fn load() -> Result { + Ok(Config::parse()) + } +}