diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-14 11:42:35 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-10-14 11:42:41 -0400 |
commit | 9066dd731b7a4df67562bb581d15ac318673e6ab (patch) | |
tree | 73ebc555a2e76ab2492c26bc4fb09b310b7584c1 /libs/ardour/automation_control.cc | |
parent | 92f1eb6be9df2ad0194872ea40c776b6c1983d08 (diff) |
much simpler implementation of fix originally in c104c9d4726f3: don't call Session::set_dirty() or emit Changed() unless AutomationControl actually changes value
Diffstat (limited to 'libs/ardour/automation_control.cc')
-rw-r--r-- | libs/ardour/automation_control.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc index 9a6590ebe8..2f9057d28a 100644 --- a/libs/ardour/automation_control.cc +++ b/libs/ardour/automation_control.cc @@ -120,15 +120,28 @@ void AutomationControl::actually_set_value (double value, PBD::Controllable::GroupControlDisposition gcd) { bool to_list = _list && boost::dynamic_pointer_cast<AutomationList>(_list)->automation_write(); - //const double old_value = Control::user_double (); + /* We cannot use ::get_value() here since that is virtual, + and its return value will/may depend on the ordering + of a derived class' own implementation of ::actually_set_value(). + + The derived classes generally need to set their own internal state + before calling this version, which means that ::get_value() + would generally return the *NEW* state, and thus lead to + Changed() not being emitted below. + */ + + const double old_value = Control::user_double (); Control::set_double (value, _session.transport_frame(), to_list); - //AutomationType at = (AutomationType) _parameter.type(); - //std::cerr << "++++ Changed (" << enum_2_string (at) << ", " << enum_2_string (gcd) << ") = " << value - //<< " (was " << old_value << ") @ " << this << std::endl; + if (old_value != value) { + AutomationType at = (AutomationType) _parameter.type(); + std::cerr << "++++ Changed (" << enum_2_string (at) << ", " << enum_2_string (gcd) << ") = " << value + << " (was " << old_value << ") @ " << this << std::endl; - Changed (true, gcd); + Changed (true, gcd); + _session.set_dirty (); + } } void |