return Control::get_double() * get_masters_value_locked ();
}
-void
-SlavableAutomationControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd)
-{
- {
- Glib::Threads::RWLock::WriterLock lm (master_lock);
-
- if (!_masters.empty()) {
- /* need to scale given value by current master's scaling */
- value /= get_masters_value_locked();
- }
- }
-
- /* this will call Control::set_double() and emit Changed signals as appropriate */
- AutomationControl::actually_set_value (value, gcd);
-}
-
/** Get the current effective `user' value based on automation state */
double
SlavableAutomationControl::get_value() const
}
}
+void
+SlavableAutomationControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd)
+{
+ if (!_desc.toggled) {
+
+ Glib::Threads::RWLock::WriterLock lm (master_lock);
+
+ if (!_masters.empty()) {
+ /* need to scale given value by current master's scaling */
+ const double masters_value = get_masters_value_locked();
+ if (masters_value == 0.0) {
+ value = 0.0;
+ } else {
+ value /= masters_value;
+ value = std::max (lower(), std::min(upper(), value));
+ }
+ }
+ }
+
+ /* this will call Control::set_double() and emit Changed signals as appropriate */
+ AutomationControl::actually_set_value (value, gcd);
+}
+
void
SlavableAutomationControl::add_master (boost::shared_ptr<AutomationControl> m, bool loading)
{
const double master_value = m->get_value();
if (master_value == 0.0) {
- actually_set_value (0.0, Controllable::NoGroup);
+ AutomationControl::set_double (0.0, Controllable::NoGroup);
} else {
/* scale control's own value by
amount that the master will
void
SlavableAutomationControl::remove_master (boost::shared_ptr<AutomationControl> m)
{
- Masters::size_type erased = 0;
-
pre_remove_master (m);
{
return;
}
- if (erased) {
- MasterStatusChange (); /* EMIT SIGNAL */
- }
+ MasterStatusChange (); /* EMIT SIGNAL */
/* no need to update boolean masters records, since the MR will have
* been removed already.