diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-20 23:25:02 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-20 23:25:02 +0000 |
commit | f9d88d09797e9ba1fa4a281e66e583d41da7e009 (patch) | |
tree | 20719c598444ce768ec715472f45b313db75e537 | |
parent | f14604694dfb464b85ece1aa4009b7598ce32ea3 (diff) |
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
-rw-r--r-- | libs/ardour/automation_list.cc | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |