summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_control.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-03-12 22:58:00 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:40 -0400
commit194b213456df43cb522651db6f27286a48eadec6 (patch)
tree5b415907ecd38ad92b79834b56105a821ce961e1 /libs/ardour/automation_control.cc
parent5531c834963726d5a35db078e17a7508f2b9d72d (diff)
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
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r--libs/ardour/automation_control.cc20
1 files changed, 17 insertions, 3 deletions
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,17 +299,23 @@ AutomationControl::add_master (boost::shared_ptr<AutomationControl> m)
*/
- m->Changed.connect_same_thread (res.first->second.connection, boost::bind (&PBD::Signal2<void,bool,Controllable::GroupControlDisposition>::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);
}
@@ -319,6 +323,16 @@ AutomationControl::add_master (boost::shared_ptr<AutomationControl> m)
}
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<AutomationControl> wm)
{
boost::shared_ptr<AutomationControl> m = wm.lock();