Sorta fix stock widget usage in gain_gui_egui
The parameter changed from storing its value as decibels to storing gain at some point.
This commit is contained in:
parent
838e1bfd2d
commit
6e7ee125b6
|
@ -117,13 +117,16 @@ impl Plugin for Gain {
|
|||
ui.add(
|
||||
egui::widgets::Slider::from_get_set(-30.0..=30.0, |new_value| {
|
||||
match new_value {
|
||||
Some(new_value) => {
|
||||
Some(new_value_db) => {
|
||||
let new_value = util::gain_to_db(new_value_db as f32);
|
||||
|
||||
setter.begin_set_parameter(¶ms.gain);
|
||||
setter.set_parameter(¶ms.gain, new_value as f32);
|
||||
setter.set_parameter(¶ms.gain, new_value);
|
||||
setter.end_set_parameter(¶ms.gain);
|
||||
new_value
|
||||
|
||||
new_value_db
|
||||
}
|
||||
None => params.gain.value() as f64,
|
||||
None => util::gain_to_db(params.gain.value()) as f64,
|
||||
}
|
||||
})
|
||||
.suffix(" dB"),
|
||||
|
|
Loading…
Reference in a new issue