diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-27 18:56:26 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-27 18:56:26 +0000 |
commit | 74cc8f6067f9a7e6560e8abca9ec0a205597c028 (patch) | |
tree | 1bce480d2134ac33bbe5295841288f1d92444e52 /gtk2_ardour/route_ui.cc | |
parent | 8000b39c8cbfdafbf806e04f9db7f82c81f92cae (diff) |
Fix multiple creation of identical automation tracks. Fixes #3482.
git-svn-id: svn://localhost/ardour2/branches/3.0@7848 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r-- | gtk2_ardour/route_ui.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 6a79ce0282..b69c6aaeeb 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -94,6 +94,7 @@ RouteUI::init () { self_destruct = true; xml_node = 0; + _xml_node_version = Stateful::current_state_version; mute_menu = 0; solo_menu = 0; sends_menu = 0; @@ -1266,12 +1267,15 @@ RouteUI::ensure_xml_node () if ((xml_node = _route->extra_xml ("GUI")) == 0) { xml_node = new XMLNode ("GUI"); _route->add_extra_xml (*xml_node); + } else { + /* the Route has one, so it must have been loaded */ + _xml_node_version = Stateful::loading_state_version; } } } XMLNode* -RouteUI::get_automation_child_xml_node (Evoral::Parameter param, int version) +RouteUI::get_automation_child_xml_node (Evoral::Parameter param) { ensure_xml_node (); @@ -1282,15 +1286,16 @@ RouteUI::get_automation_child_xml_node (Evoral::Parameter param, int version) for (iter = kids.begin(); iter != kids.end(); ++iter) { - if (version < 3000) { + if (_xml_node_version < 3000) { if ((*iter)->name() == sym) { return *iter; } } else { if ((*iter)->name() == AutomationTimeAxisView::state_node_name) { XMLProperty* type = (*iter)->property("automation-id"); - if (type && type->value() == sym) + if (type && type->value() == sym) { return *iter; + } } } } |