Skip to content

Commit

Permalink
all labels lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed Oct 17, 2024
1 parent 643528a commit 6bfd1fe
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc<ViziaState>) -> 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| {
Expand All @@ -53,7 +53,7 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc<ViziaState>) -> 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() };
Expand All @@ -80,10 +80,10 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc<ViziaState>) -> 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 =
Expand All @@ -93,7 +93,7 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc<ViziaState>) -> 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");
Expand All @@ -104,14 +104,14 @@ pub(crate) fn create(editor_data: Data, editor_state: Arc<ViziaState>) -> 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");
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -275,22 +275,22 @@ 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,
max: 20_000.0,
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. },
)
Expand All @@ -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),
Expand All @@ -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)
Expand Down

0 comments on commit 6bfd1fe

Please sign in to comment.