duplicate routes start off unsoloed to avoid issues related to upstream / downstream...
authorDaniel Sheeler <dsheeler@pobox.com>
Sun, 28 May 2017 20:46:22 +0000 (15:46 -0500)
committerDaniel Sheeler <dsheeler@pobox.com>
Mon, 29 May 2017 20:42:27 +0000 (15:42 -0500)
libs/ardour/session.cc
libs/pbd/pbd/xml++.h
libs/pbd/xml++.cc

index ffb002272927cc078516b2caacc5540e5ad2fc9e..4d046b34367f9c4bf8f3b0578eb7b45e4fdef765 100644 (file)
@@ -3401,6 +3401,10 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
                                }
                        }
 
+                       /* new routes start off unsoloed to avoid issues related to
+                          upstream / downstream buses. */
+                       node_copy.remove_node_and_delete(X_("Controllable"), X_("name"), X_("solo"));
+
                        boost::shared_ptr<Route> route (XMLRouteFactory (node_copy, 3000));
 
                        if (route == 0) {
index 476e3673832b197c17fae676d852a83bdd69e12b..6c099dc0c39588534a33067b154ae5612145a13f 100644 (file)
@@ -184,6 +184,8 @@ public:
        void remove_nodes_and_delete(const std::string&);
        /** Remove and delete all nodes with property prop matching val */
        void remove_nodes_and_delete(const std::string& propname, const std::string& val);
+  /** Remove and delete first node with given name and prop matching val */
+       void remove_node_and_delete(const std::string& n, const std::string& propname, const std::string& val);
 
        void dump (std::ostream &, std::string p = "") const;
 
index c46c5638b87257bc1b6838bdcbdeb197ffe90eca..d5d863e9e588e2fe814b4fe5cf75f47c70cbdc62 100644 (file)
@@ -658,6 +658,22 @@ XMLNode::remove_nodes_and_delete(const string& propname, const string& val)
        }
 }
 
+void
+XMLNode::remove_node_and_delete(const string& n, const string& propname,
+ const string& val)
+{
+       for (XMLNodeIterator i = _children.begin(); i != _children.end(); ++i) {
+               if ((*i)->name() == n) {
+                       XMLProperty const * prop = (*i)->property (propname);
+                       if (prop && prop->value() == val) {
+                               delete *i;
+                               _children.erase(i);
+                               break;
+                       }
+               }
+       }
+}
+
 XMLProperty::XMLProperty(const string& n, const string& v)
        : _name(n)
        , _value(v)