From 194b213456df43cb522651db6f27286a48eadec6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 12 Mar 2016 22:58:00 -0500 Subject: add implicit mute state to MuteMaster and use when a master of a mute control is enabled/disabled. Add AutomationControl::master_changed() as a virtual method to handle ... master value changes --- libs/ardour/automation_control.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'libs/ardour/automation_control.cc') diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 2ac6574528..b00c615625 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -119,8 +119,6 @@ AutomationControl::set_value (double value, PBD::Controllable::GroupControlDispo Control::set_double (value, _session.transport_frame(), to_list); - cerr << "AC was set to " << value << endl; - Changed (true, gcd); } @@ -301,23 +299,39 @@ AutomationControl::add_master (boost::shared_ptr m) */ - m->Changed.connect_same_thread (res.first->second.connection, boost::bind (&PBD::Signal2::operator(), &Changed, false, _2)); + m->Changed.connect_same_thread (res.first->second.connection, boost::bind (&AutomationControl::master_changed, this, _1, _2)); } new_value = get_value_locked (); } if (res.second) { + /* this will notify everyone that we're now slaved to the master */ MasterStatusChange (); /* EMIT SIGNAL */ } if (new_value != current_value) { + /* force a call to to ::master_changed() to carry the + * consequences that would occur if the master assumed + * its current value WHILE we were slaved. + */ + master_changed (false, Controllable::NoGroup); /* effective value changed by master */ Changed (false, Controllable::NoGroup); } } +void +AutomationControl::master_changed (bool /*from_self*/, GroupControlDisposition gcd) +{ + /* our value has (likely) changed, but not because we were + * modified. Just the master. + */ + + Changed (false, gcd); /* EMIT SIGNAL */ +} + void AutomationControl::master_going_away (boost::weak_ptr wm) { -- cgit v1.2.3