13
0

when leaving an active automation state, update fader displays to show correct current value

This commit is contained in:
Paul Davis 2016-01-22 11:43:27 -05:00
parent 01fd887b9e
commit 0c9249604f

View File

@ -848,9 +848,9 @@ GainMeterBase::gain_automation_style_changed ()
void void
GainMeterBase::gain_automation_state_changed () GainMeterBase::gain_automation_state_changed ()
{ {
ENSURE_GUI_THREAD (*this, &GainMeterBase::gain_automation_state_changed) ENSURE_GUI_THREAD (*this, &GainMeterBase::gain_automation_state_changed);
bool x; cerr << "GMB:autostate change to " << _amp->gain_control()->alist()->automation_state() << endl;
switch (_width) { switch (_width) {
case Wide: case Wide:
@ -861,22 +861,24 @@ GainMeterBase::gain_automation_state_changed ()
break; break;
} }
x = (_amp->gain_control()->alist()->automation_state() != ARDOUR::Off); const bool automation_watch_required = (_amp->gain_control()->alist()->automation_state() != ARDOUR::Off);
if (gain_automation_state_button.get_active() != x) { if (gain_automation_state_button.get_active() != automation_watch_required) {
ignore_toggle = true; ignore_toggle = true;
gain_automation_state_button.set_active (x); gain_automation_state_button.set_active (automation_watch_required);
ignore_toggle = false; ignore_toggle = false;
} }
update_gain_sensitive (); update_gain_sensitive ();
/* start watching automation so that things move */
gain_watching.disconnect(); gain_watching.disconnect();
if (x) { if (automation_watch_required) {
/* start watching automation so that things move */
gain_watching = Timers::rapid_connect (sigc::mem_fun (*this, &GainMeterBase::effective_gain_display)); gain_watching = Timers::rapid_connect (sigc::mem_fun (*this, &GainMeterBase::effective_gain_display));
} else {
/* update once to get the correct value shown as we re-enter off/manual mode */
effective_gain_display();
} }
} }