From deba170d6c3a791633def422a59cf0f80d63be13 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Jul 2017 02:34:09 +0200 Subject: [PATCH] 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. --- libs/ardour/automation_list.cc | 9 +++++---- libs/evoral/src/ControlList.cpp | 4 ++-- 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); }