summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-07 02:34:09 +0200
committerRobin Gareus <robin@gareus.org>2017-07-07 02:35:00 +0200
commitdeba170d6c3a791633def422a59cf0f80d63be13 (patch)
treef4f25a435bf6929251a729c558ffe1d2188ac5fc
parentb732aa2ca18465f51839ba93270280c9f3609bd1 (diff)
Consistent ControlList freezing -- fixes #7419
AudioRegion::set_fade_in() freezes the original ControlList, then assigns a new one and thaws that. Frozen state needs to be retained during assignment. Related: The overloaded assignment operator in AutomationList performed duplicate signal emission and didn't freeze the list.
-rw-r--r--libs/ardour/automation_list.cc9
-rw-r--r--libs/evoral/src/ControlList.cpp4
2 files changed, 7 insertions, 6 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index 8ceab4f3ea..27bc64462e 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -167,13 +167,14 @@ AutomationList&
AutomationList::operator= (const AutomationList& other)
{
if (this != &other) {
-
+ ControlList::freeze ();
+ /* ControlList::operator= calls copy_events() which calls
+ * mark_dirty() and maybe_signal_changed()
+ */
ControlList::operator= (other);
_state = other._state;
_touching = other._touching;
-
- mark_dirty ();
- maybe_signal_changed ();
+ ControlList::thaw ();
}
return *this;
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index a05c1f9308..a0660ee000 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -152,7 +152,8 @@ ControlList&
ControlList::operator= (const ControlList& other)
{
if (this != &other) {
- _frozen = 0;
+ /* list should be frozen before assignment */
+ assert (_frozen > 0);
_changed_when_thawed = false;
_sort_pending = false;
@@ -166,7 +167,6 @@ ControlList::operator= (const ControlList& other)
_desc = other._desc;
_interpolation = other._interpolation;
- // XXX copy_events() emits Dirty, but this is just assignment copy/construction
copy_events (other);
}