ensure that the name used the control out IO for a route always uses the desired...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Mar 2009 22:00:14 +0000 (22:00 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Mar 2009 22:00:14 +0000 (22:00 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4909 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/route.cc

index 91c3423388e569144f50e87746eb62f479bf2b60..4553bf2909f3b9f517b4fe591e45f5f3172cc98e 100644 (file)
@@ -1836,8 +1836,20 @@ Route::_set_state (const XMLNode& node, bool call_base)
 
                        delete _control_outs;
                        _control_outs = new IO (_session, coutname);
-                       _control_outs->set_state (**(child->children().begin()));
 
+                       /* fix up the control out name in the XML before setting it. 
+                          Otherwise track templates don't work because the control
+                          outs end up with the stored template name, rather than
+                          the new name of the track based on the template.
+                       */
+
+                       XMLProperty* prop = (*child->children().begin())->property ("name");
+                       if (prop) {
+                               prop->set_value (coutname);
+                       }
+
+                       _control_outs->set_state (**(child->children().begin()));
+                       
                } else if (child->name() == X_("Comment")) {
 
                        /* XXX this is a terrible API design in libxml++ */