From a95b25cd06a6b06ca3620332d724d83c147be65a Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 6 Feb 2022 14:18:47 +0100 Subject: [PATCH] Tweak the peak meter display --- plugins/examples/gain-gui/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/examples/gain-gui/src/lib.rs b/plugins/examples/gain-gui/src/lib.rs index 3271df9c..13777903 100644 --- a/plugins/examples/gain-gui/src/lib.rs +++ b/plugins/examples/gain-gui/src/lib.rs @@ -137,7 +137,7 @@ impl Plugin for Gain { let peak_meter = util::gain_to_db(peak_meter.load(std::sync::atomic::Ordering::Relaxed)); let peak_meter_text = if peak_meter > util::MINUS_INFINITY_DB { - format!("{:.0} dBFS", peak_meter) + format!("{:.1} dBFS", peak_meter) } else { String::from("-inf dBFS") }; @@ -170,7 +170,7 @@ impl Plugin for Gain { _context: &mut impl ProcessContext, ) -> bool { // TODO: How do you tie this exponential decay to an actual time span? - self.peak_meter_decay_weight = 0.999f32.powf(44_100.0 / buffer_config.sample_rate); + self.peak_meter_decay_weight = 0.9992f32.powf(44_100.0 / buffer_config.sample_rate); true }