summaryrefslogtreecommitdiff
path: root/gtk2_ardour/gain_meter.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-04 00:29:28 -0500
committerDavid Robillard <d@drobilla.net>2014-12-04 00:30:47 -0500
commit24727e65befc310f24196d11a56ec7b269977c16 (patch)
treee399a174cff1c328b4e7ebd71778cfcb81fc3383 /gtk2_ardour/gain_meter.cc
parent9b770c7aff5ad38d5363b232b85018a622596877 (diff)
Make gain controls step by roughly 1.0/0.1 dB.
Shoot for roughly 30 steps for all controls. Always keep sensible step information in ParameterDescriptor and just convert for the UI. This is a little weird, but it's less weird than it was before, and works.
Diffstat (limited to 'gtk2_ardour/gain_meter.cc')
-rw-r--r--gtk2_ardour/gain_meter.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 7b7ad33f9a..1dfd086b95 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -49,6 +49,7 @@
#include "ardour/meter.h"
#include "ardour/audio_track.h"
#include "ardour/midi_track.h"
+#include "ardour/dB.h"
#include "i18n.h"
@@ -82,11 +83,14 @@ reset_cursor_to_default_state (Gtk::StateType, Gtk::Entry* widget)
}
GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int fader_girth)
- : gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1)
+ : gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), // value
+ 0.0, // lower
+ 1.0, // upper
+ dB_coeff_step(Config->get_max_gain()) / 10.0, // step increment
+ dB_coeff_step(Config->get_max_gain())) // page increment
, gain_automation_style_button ("")
, gain_automation_state_button ("")
, _data_type (DataType::AUDIO)
-
{
using namespace Menu_Helpers;
@@ -260,8 +264,8 @@ GainMeterBase::setup_gain_adjustment ()
_data_type = DataType::AUDIO;
gain_adjustment.set_lower (0.0);
gain_adjustment.set_upper (1.0);
- gain_adjustment.set_step_increment (0.01);
- gain_adjustment.set_page_increment (0.1);
+ gain_adjustment.set_step_increment (dB_coeff_step(Config->get_max_gain()) / 10.0);
+ gain_adjustment.set_page_increment (dB_coeff_step(Config->get_max_gain()));
gain_slider->set_default_value (gain_to_slider_position (1));
} else {
_data_type = DataType::MIDI;