X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fslavable_automation_control.cc;h=63784dc3a5bd52b947771d18f8941499af41a507;hb=d6b36a13a127d9b152cfe12d596ea862773f9923;hp=a1b9d8064d769b830c1a2876e73710ef45fcbf8c;hpb=e8cebac6a36a45a59cd70f3a0c68a2311366f784;p=ardour.git diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index a1b9d8064d..63784dc3a5 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -95,10 +95,25 @@ SlavableAutomationControl::get_value_locked() const return Control::get_double() * get_masters_value_locked (); } +/** Get the current effective `user' value based on automation state */ +double +SlavableAutomationControl::get_value() const +{ + bool from_list = _list && boost::dynamic_pointer_cast(_list)->automation_playback(); + + Glib::Threads::RWLock::ReaderLock lm (master_lock); + if (!from_list) { + return get_value_locked (); + } else { + return Control::get_double (true, _session.transport_frame()) * get_masters_value_locked(); + } +} + void SlavableAutomationControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd) { - { + if (!_desc.toggled) { + Glib::Threads::RWLock::WriterLock lm (master_lock); if (!_masters.empty()) { @@ -117,20 +132,6 @@ SlavableAutomationControl::actually_set_value (double value, PBD::Controllable:: AutomationControl::actually_set_value (value, gcd); } -/** Get the current effective `user' value based on automation state */ -double -SlavableAutomationControl::get_value() const -{ - bool from_list = _list && boost::dynamic_pointer_cast(_list)->automation_playback(); - - Glib::Threads::RWLock::ReaderLock lm (master_lock); - if (!from_list) { - return get_value_locked (); - } else { - return Control::get_double (true, _session.transport_frame()) * get_masters_value_locked(); - } -} - void SlavableAutomationControl::add_master (boost::shared_ptr m, bool loading) {