From ea1a103b26c87b821e41329b4eef7cf5d91770ee Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 May 2010 00:47:16 +0000 Subject: [PATCH] Reset both IO names rather than just one when setting up the use of a track template. git-svn-id: svn://localhost/ardour2/branches/3.0@7085 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index f0aaf054ff..2d4aefd388 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1828,13 +1828,19 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template /*NOTREACHED*/ } - IO::set_name_in_state (*node_copy.children().front(), name); + /* set IO children to use the new name */ + XMLNodeList const & children = node_copy.children (); + for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { + if ((*i)->name() == IO::state_node_name) { + IO::set_name_in_state (**i, name); + } + } Track::zero_diskstream_id_in_xml (node_copy); try { shared_ptr route (XMLRouteFactory (node_copy, 3000)); - + if (route == 0) { error << _("Session: cannot create track/bus from template description") << endmsg; goto out;