From a337852dacd7561b63af5baa3a4121007e95873a Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 26 Dec 2022 03:32:52 +0100 Subject: [PATCH] chore: renamed metavars --- README.md | 22 +++++++++++----------- src/main.rs | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 907d895..f55a4b8 100644 --- a/README.md +++ b/README.md @@ -19,17 +19,17 @@ Arguments: [DEVICE] Audio device to attach to Options: - -b, --buffer Size of audio buffer, and width of scope [default: 8192] - -r, --range Max value, positive and negative, on amplitude scale [default: 20000] - --scatter Use vintage looking scatter mode instead of line mode - --vectorscope Combine left and right channels into vectorscope view - --tune Tune buffer size to be in tune with given note (overrides buffer option) - --sample-rate Sample rate to use [default: 44100] - --server-buffer Pulseaudio server buffer size, in block number [default: 32] - --no-reference Don't draw reference line - --no-braille Don't use braille dots for drawing lines - -h, --help Print help information - -V, --version Print version information + -b, --buffer Size of audio buffer, and width of scope [default: 8192] + -r, --range Max value, positive and negative, on amplitude scale [default: 20000] + --scatter Use vintage looking scatter mode instead of line mode + --vectorscope Combine left and right channels into vectorscope view + --tune Tune buffer size to be in tune with given note (overrides buffer option) + --sample-rate Sample rate to use [default: 44100] + --server-buffer Pulseaudio server buffer size, in block number [default: 32] + --no-reference Don't draw reference line + --no-braille Don't use braille dots for drawing lines + -h, --help Print help information + -V, --version Print version information ``` The audio buffer size directly impacts resource usage, latency and refresh rate and its limits are given by the audio refresh rate. Larger buffers are slower but less resource intensive. A good starting value might be `8192` diff --git a/src/main.rs b/src/main.rs index 6e21ff1..37da1e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,12 +34,12 @@ struct Args { device: Option, /// Size of audio buffer, and width of scope - #[arg(short, long, default_value_t = 8192)] + #[arg(short, long, value_name = "SIZE", default_value_t = 8192)] buffer: u32, /// Max value, positive and negative, on amplitude scale - #[arg(short, long, default_value_t = 20000)] - range: u32, + #[arg(short, long, value_name = "SIZE", default_value_t = 20000)] + range: u32, // TODO counterintuitive, improve this /// Use vintage looking scatter mode instead of line mode #[arg(long, default_value_t = false)] @@ -50,15 +50,15 @@ struct Args { vectorscope: bool, /// Tune buffer size to be in tune with given note (overrides buffer option) - #[arg(long)] + #[arg(long, value_name = "NOTE")] tune: Option, /// Sample rate to use - #[arg(long, default_value_t = 44100)] + #[arg(long, value_name = "HZ", default_value_t = 44100)] sample_rate: u32, /// Pulseaudio server buffer size, in block number - #[arg(long, default_value_t = 32)] + #[arg(long, value_name = "N", default_value_t = 32)] server_buffer: u32, /// Don't draw reference line