1
0
Fork 0

Remove unit from Crisp filter frequency params

This commit is contained in:
Robbert van der Helm 2022-03-09 15:17:38 +01:00
parent 4105a887a8
commit f9446644aa

View file

@ -149,12 +149,12 @@ impl Default for CrispParams {
}, },
) )
.with_smoother(SmoothingStyle::Logarithmic(100.0)) .with_smoother(SmoothingStyle::Logarithmic(100.0))
.with_unit(" Hz") // The unit is baked into the value so we can show the disabled string
.with_value_to_string(Arc::new(|value| { .with_value_to_string(Arc::new(|value| {
if value >= 22_000.0 { if value >= 22_000.0 {
String::from("Disabled") String::from("Disabled")
} else { } else {
format!("{:.0}", value) format!("{:.0} Hz", value)
} }
})) }))
.with_string_to_value(Arc::new(|string| { .with_string_to_value(Arc::new(|string| {
@ -185,12 +185,12 @@ impl Default for CrispParams {
}, },
) )
.with_smoother(SmoothingStyle::Logarithmic(100.0)) .with_smoother(SmoothingStyle::Logarithmic(100.0))
.with_unit(" Hz") // The unit is baked into the value so we can show the disabled string
.with_value_to_string(Arc::new(|value| { .with_value_to_string(Arc::new(|value| {
if value <= 5.0 { if value <= 5.0 {
String::from("Disabled") String::from("Disabled")
} else { } else {
format!("{:.0}", value) format!("{:.0} Hz", value)
} }
})) }))
.with_string_to_value(Arc::new(|string| { .with_string_to_value(Arc::new(|string| {