voelin-ui: settings through the settings service; free frame rate and bitrate
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
This commit is contained in:
1 parent
178173ad0d
commit
2f82a01ca9
7 files changed
+212
-29
No files matched your search
@@ -13,5 +13,23 @@ fn main() -> Result<()> {
|
||||
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("warn")),
|
||||
)
|
||||
.init();
|
||||
voelin_ui::run(voelin_ui::RunOptions::default())
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user