diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-19 23:02:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-19 23:02:55 +0000 |
commit | d5e09076ca69fda1402a12e383de7a7d9bc5f0ec (patch) | |
tree | 0d4df7147098ea57e58d96efb82f57dd5545023c /gtk2_ardour/gain_meter.cc | |
parent | 182b23e744d79b3387a779ea25010924daffe6af (diff) |
much ado about nothing when it comes to gain control
git-svn-id: svn://localhost/ardour2/branches/3.0@9748 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/gain_meter.cc')
-rw-r--r-- | gtk2_ardour/gain_meter.cc | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index f0a8ceb548..b671d5674a 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -79,7 +79,7 @@ GainMeterBase::GainMeterBase (Session* s, const Glib::RefPtr<Gdk::Pixbuf>& pix, bool horizontal, int fader_length) - : gain_adjustment (0.781787, 0.0, 1.0, 0.01, 0.1) // 0.781787 is the value needed for gain to be set to 0. + : gain_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0.0, 1.0, 0.01, 0.1) , gain_automation_style_button ("") , gain_automation_state_button ("") , style_changed (false) @@ -382,7 +382,7 @@ GainMeterBase::show_gain () if (v == 0.0) { strcpy (buf, _("-inf")); } else { - snprintf (buf, sizeof (buf), "%.1f", accurate_coefficient_to_dB (slider_position_to_gain (v))); + snprintf (buf, sizeof (buf), "%.1f", accurate_coefficient_to_dB (slider_position_to_gain_with_max (v, Config->get_max_gain()))); } } else { snprintf (buf, sizeof (buf), "%.1f", v); @@ -395,14 +395,13 @@ void GainMeterBase::gain_adjusted () { if (!ignore_toggle) { - if (_route && _route->amp() == _amp) { - if (_is_midi) { - _route->set_gain (gain_adjustment.get_value(), this); - } else { - _route->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this); - } + if (_is_midi) { + _amp->set_gain (gain_adjustment.get_value(), this); } else { - _amp->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this); + cerr << "reset gain using slider pos " << gain_adjustment.get_value() << " to " + << slider_position_to_gain_with_max (gain_adjustment.get_value(), Config->get_max_gain()) + << endl; + _amp->set_gain (slider_position_to_gain_with_max (gain_adjustment.get_value(), Config->get_max_gain()), this); } } @@ -415,15 +414,11 @@ GainMeterBase::effective_gain_display () gfloat value; if (!_route || _route->output()->n_ports().n_midi() == 0) { - value = gain_to_slider_position (_amp->gain()); + value = gain_to_slider_position_with_max (_amp->gain(), Config->get_max_gain()); } else { value = _amp->gain (); } - //cerr << this << " for " << _io->name() << " EGAIN = " << value - // << " AGAIN = " << gain_adjustment.get_value () << endl; - // stacktrace (cerr, 20); - if (gain_adjustment.get_value() != value) { ignore_toggle = true; gain_adjustment.set_value (value); |