The window read its blobs (ui, audio, client_playback) from the store once and wrote them back. It now opens the settings service on the client database, attaches it to the engine, registers its own keys (ui, client_playback), and loads config file, VOELIN_SETTING_* and `--set key=value` overrides below the stored values. Its edits are set on the service, which stores them off the UI thread and flushes on exit; changes made elsewhere (e.g. Command::SetSetting) update the window's copies of the audio, crash report and client volume settings. The crash report opt-in is the crash_reports key the Android app already read (and stays in the blob for older versions). The share dialog starts from stream.fps and stream.bitrate_kbps and takes any value typed next to the presets, which remain as shortcuts; what was used is stored back. docs/architecture.md describes stream discovery and the settings service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
//! Desktop client.
|
|
|
|
// Release builds on Windows are GUI programs (no console window); debug
|
|
// builds keep the console for logs.
|
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
|
|
|
use anyhow::Result;
|
|
use tracing_subscriber::EnvFilter;
|
|
|
|
fn main() -> Result<()> {
|
|
tracing_subscriber::fmt()
|
|
.with_env_filter(
|
|
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")),
|
|
)
|
|
.init();
|
|
let options = voelin_ui::RunOptions {
|
|
setting_overrides: setting_overrides(std::env::args().skip(1)),
|
|
..Default::default()
|
|
};
|
|
voelin_ui::run(options)
|
|
}
|
|
|
|
/// `--set key=value` (or `--set=key=value`), repeatable: settings for this
|
|
/// run, below those changed in the app.
|
|
fn setting_overrides(mut args: impl Iterator<Item = String>) -> Vec<String> {
|
|
let mut overrides = Vec::new();
|
|
while let Some(arg) = args.next() {
|
|
match arg.strip_prefix("--set") {
|
|
Some("") => overrides.extend(args.next()),
|
|
Some(rest) if rest.starts_with('=') => overrides.push(rest[1..].to_owned()),
|
|
_ => eprintln!("ignoring argument {arg:?}; usage: voelin [--set key=value]..."),
|
|
}
|
|
}
|
|
overrides
|
|
}
|