summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-10-14 11:42:35 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-10-14 11:42:41 -0400
commit9066dd731b7a4df67562bb581d15ac318673e6ab (patch)
tree73ebc555a2e76ab2492c26bc4fb09b310b7584c1 /libs/ardour
parent92f1eb6be9df2ad0194872ea40c776b6c1983d08 (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')
-rw-r--r--libs/ardour/automation_control.cc23
-rw-r--r--libs/ardour/phase_control.cc3
-rw-r--r--libs/ardour/slavable_automation_control.cc2
-rw-r--r--libs/ardour/solo_isolate_control.cc1
-rw-r--r--libs/ardour/solo_safe_control.cc1
5 files changed, 18 insertions, 12 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
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