From 6bfd1fe2cdad7475b37d4ee65ba82e3cc73d8eb0 Mon Sep 17 00:00:00 2001 From: Bart Brouns Date: Fri, 18 Oct 2024 00:10:29 +0200 Subject: [PATCH] all labels lowercase --- src/editor.rs | 16 ++++++++-------- src/lib.rs | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index f1e1b6d..2517966 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -40,9 +40,9 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc) -> Option HStack::new(cx, |cx| { VStack::new(cx, |cx| { - Label::new(cx, "Global").class("global-title"); + Label::new(cx, "global").class("global-title"); HStack::new(cx, |cx| { - make_column(cx, "Gain", |cx| { + make_column(cx, "gain", |cx| { let gain_params = Data::params.map(|p| p.global.gain_params.clone()); GenericUi::new_custom(cx, gain_params, |cx, param_ptr| { HStack::new(cx, |cx| { @@ -53,7 +53,7 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc) -> Option }); }); - make_column(cx, "Timing", |cx| { + make_column(cx, "timing", |cx| { let timing_params = Data::params.map(|p| p.global.timing_params.clone()); GenericUi::new_custom(cx, timing_params, |cx, param_ptr| { let param_name = unsafe { param_ptr.name() }; @@ -80,10 +80,10 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc) -> Option }); }); }); - Label::new(cx, "Filters").class("dsp-title"); + Label::new(cx, "filters").class("dsp-title"); HStack::new(cx, |cx| { - make_column(cx, "Bottom Velocity", |cx| { + make_column(cx, "low velocity", |cx| { // We don't want to show the 'Upwards' prefix here, but it should still be in // the parameter name so the parameter list makes sense let velocity_bottom_params = @@ -93,7 +93,7 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc) -> Option Label::new( cx, unsafe { param_ptr.name() } - .strip_prefix("Bottom Velocity ") + .strip_prefix("low velocity ") .expect("Expected parameter name prefix, this is a bug"), ) .class("label"); @@ -104,14 +104,14 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc) -> Option }); }); - make_column(cx, "Top Velocity", |cx| { + make_column(cx, "high velocity", |cx| { let velocity_top_params = Data::params.map(|p| p.taps.velocity_top.clone()); GenericUi::new_custom(cx, velocity_top_params, |cx, param_ptr| { HStack::new(cx, |cx| { Label::new( cx, unsafe { param_ptr.name() } - .strip_prefix("Top Velocity ") + .strip_prefix("high velocity ") .expect("Expected parameter name prefix, this is a bug"), ) .class("label"); diff --git a/src/lib.rs b/src/lib.rs index 4d85c38..2f5fa98 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,8 +20,8 @@ const MAX_NR_TAPS: usize = 8; const TOTAL_DELAY_SECONDS: usize = MAX_TAP_SECONDS * MAX_NR_TAPS; const MAX_SAMPLE_RATE: usize = 192000; const TOTAL_DELAY_SAMPLES: usize = TOTAL_DELAY_SECONDS * MAX_SAMPLE_RATE; -const VELOCITY_BOTTOM_NAME_PREFIX: &str = "Bottom Velocity"; -const VELOCITY_TOP_NAME_PREFIX: &str = "Top Velocity"; +const VELOCITY_BOTTOM_NAME_PREFIX: &str = "low velocity"; +const VELOCITY_TOP_NAME_PREFIX: &str = "high velocity"; // this seems to be the number JUCE is using const MAX_SOUNDCARD_BUFFER_SIZE: usize = 32768; @@ -275,7 +275,7 @@ impl FilterGuiParams { ) -> Self { FilterGuiParams { cutoff: FloatParam::new( - format!("{name_prefix} Cutoff"), + format!("{name_prefix} cutoff"), default_cutoff, // Use the passed default value FloatRange::Skewed { min: 5.0, @@ -283,14 +283,14 @@ impl FilterGuiParams { factor: FloatRange::skew_factor(-2.5), }, ) - .with_unit(" Hz") - .with_value_to_string(formatters::v2s_f32_rounded(0)) + .with_value_to_string(formatters::v2s_f32_hz_then_khz(2)) + .with_string_to_value(formatters::s2v_f32_hz_then_khz()) .with_callback(Arc::new({ let should_update_filter = should_update_filter.clone(); move |_| should_update_filter.store(true, Ordering::Release) })), res: FloatParam::new( - format!("{name_prefix} Res"), + format!("{name_prefix} res"), default_res, // Use the passed default value FloatRange::Linear { min: 0., max: 1. }, ) @@ -300,7 +300,7 @@ impl FilterGuiParams { move |_| should_update_filter.store(true, Ordering::Release) })), drive: FloatParam::new( - format!("{name_prefix} Drive"), + format!("{name_prefix} drive"), default_drive, // Use the passed default value FloatRange::Skewed { min: util::db_to_gain(0.0), @@ -318,7 +318,7 @@ impl FilterGuiParams { move |_| should_update_filter.store(true, Ordering::Release) })), - mode: EnumParam::new(format!("{name_prefix} Mode"), default_mode) // Use the passed default value + mode: EnumParam::new(format!("{name_prefix} mode"), default_mode) // Use the passed default value .with_callback(Arc::new({ let should_update_filter = should_update_filter.clone(); move |_| should_update_filter.store(true, Ordering::Release)