summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-16 23:03:59 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-16 23:03:59 +0000
commit0c9c47086c49d27a38cef5f5cc819e1aec56857c (patch)
tree0fafbaa13412cc26011e547c1ce779cbf294f3a8 /libs/ardour/route.cc
parent58dbe9ed13cede08f9e11f428fa6c188325db009 (diff)
Slightly unpleasant fix for creation of tracks from
templates; it would be nice if we could set things up using the Route's logic for setting names of its children, rather than repeating the same logic in XML-land (#4303). git-svn-id: svn://localhost/ardour2/branches/3.0@10655 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 57793098d8..b13602635d 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -3286,6 +3286,38 @@ Route::set_name (const string& str)
return ret;
}
+/** Set the name of a route in an XML description.
+ * @param node XML <Route> node to set the name in.
+ * @param name New name.
+ */
+void
+Route::set_name_in_state (XMLNode& node, string const & name)
+{
+ node.add_property (X_("name"), name);
+
+ XMLNodeList children = node.children();
+ for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
+
+ if ((*i)->name() == X_("IO")) {
+
+ IO::set_name_in_state (**i, name);
+
+ } else if ((*i)->name() == X_("Processor")) {
+
+ XMLProperty* role = (*i)->property (X_("role"));
+ if (role && role->value() == X_("Main")) {
+ (*i)->add_property (X_("name"), name);
+ }
+
+ } else if ((*i)->name() == X_("Diskstream")) {
+
+ (*i)->add_property (X_("playlist"), string_compose ("%1.1", name).c_str());
+ (*i)->add_property (X_("name"), name);
+
+ }
+ }
+}
+
boost::shared_ptr<Send>
Route::internal_send_for (boost::shared_ptr<const Route> target) const
{