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(_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 diff --git a/libs/ardour/phase_control.cc b/libs/ardour/phase_control.cc index 9757c104b9..04dd3ce361 100644 --- a/libs/ardour/phase_control.cc +++ b/libs/ardour/phase_control.cc @@ -49,7 +49,6 @@ PhaseControl::set_phase_invert (uint32_t c, bool yn) if (_phase_invert[c] != yn) { _phase_invert[c] = yn; AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup); - _session.set_dirty (); } } @@ -59,8 +58,6 @@ PhaseControl::set_phase_invert (boost::dynamic_bitset<> p) if (_phase_invert != p) { _phase_invert = p; AutomationControl::actually_set_value (_phase_invert.to_ulong(), Controllable::NoGroup); - Changed (true, Controllable::NoGroup); /* EMIT SIGNAL */ - _session.set_dirty (); } } diff --git a/libs/ardour/slavable_automation_control.cc b/libs/ardour/slavable_automation_control.cc index a80598439d..dc7e59c387 100644 --- a/libs/ardour/slavable_automation_control.cc +++ b/libs/ardour/slavable_automation_control.cc @@ -113,8 +113,6 @@ SlavableAutomationControl::actually_set_value (double val, Controllable::GroupCo be retrieved by AutomationControl::get_value () */ AutomationControl::actually_set_value (val, group_override); - - _session.set_dirty (); } void diff --git a/libs/ardour/solo_isolate_control.cc b/libs/ardour/solo_isolate_control.cc index 7964f7eb66..c2d7f13d2c 100644 --- a/libs/ardour/solo_isolate_control.cc +++ b/libs/ardour/solo_isolate_control.cc @@ -102,7 +102,6 @@ SoloIsolateControl::actually_set_value (double val, PBD::Controllable::GroupCont */ AutomationControl::actually_set_value (val, gcd); - _session.set_dirty (); } void diff --git a/libs/ardour/solo_safe_control.cc b/libs/ardour/solo_safe_control.cc index 01d56ddf58..971b97033d 100644 --- a/libs/ardour/solo_safe_control.cc +++ b/libs/ardour/solo_safe_control.cc @@ -46,7 +46,6 @@ SoloSafeControl::actually_set_value (double val, PBD::Controllable::GroupControl */ AutomationControl::actually_set_value (val, gcd); - _session.set_dirty (); } double