From: Carl Hetherington Date: Tue, 20 Jul 2010 23:25:02 +0000 (+0000) Subject: Make AutomationLists clear their events when their state is set to an AutomationList... X-Git-Tag: 3.0-alpha5~1793 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=f9d88d09797e9ba1fa4a281e66e583d41da7e009;p=ardour.git Make AutomationLists clear their events when their state is set to an AutomationList with no Events node. Fixes #3345. git-svn-id: svn://localhost/ardour2/branches/3.0@7456 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index e785104367..17f346db1d 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; }