From d413d116943b5c157f8a83d74b144a37bb0bd999 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 27 Apr 2022 15:12:31 +0200 Subject: [PATCH] Use the predefined gain formatters for Crisp --- plugins/crisp/src/lib.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/plugins/crisp/src/lib.rs b/plugins/crisp/src/lib.rs index 003f7a32..718cfa78 100644 --- a/plugins/crisp/src/lib.rs +++ b/plugins/crisp/src/lib.rs @@ -280,15 +280,8 @@ impl Default for CrispParams { ) .with_smoother(SmoothingStyle::Logarithmic(10.0)) .with_unit(" dB") - .with_value_to_string(Arc::new(|value| format!("{:.2}", util::gain_to_db(value)))) - .with_string_to_value(Arc::new(|string| { - string - .trim() - .trim_end_matches(" dB") - .parse() - .ok() - .map(util::db_to_gain) - })), + .with_value_to_string(formatters::v2s_f32_gain_to_db(2)) + .with_string_to_value(formatters::s2v_f32_gain_to_db()), wet_only: BoolParam::new("Wet Only", false), } }