From 0396a5cab7e3862643753d980ee03e02f099706d Mon Sep 17 00:00:00 2001 From: carlh Date: Tue, 20 Jul 2010 23:25:02 +0000 Subject: [PATCH] Make AutomationLists clear their events when their state is set to an AutomationList with no Events node. Fixes #3345. git-svn-id: svn+ssh://ardour.org/ardour2/branches/3.0@7456 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/automation_list.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index e7851043..17f346db 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -448,12 +448,25 @@ AutomationList::set_state (const XMLNode& node, int version) _max_xval = 0; // means "no limit ; } + bool have_events = false; + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { if ((*niter)->name() == X_("events")) { deserialize_events (*(*niter)); + have_events = true; } } + if (!have_events) { + /* there was no Events child node; clear any current events */ + freeze (); + clear (); + mark_dirty (); + reposition_for_rt_add (0); + maybe_signal_changed (); + thaw (); + } + return 0; } -- 2.11.4.GIT