diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ffb0022729..4d046b3436 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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 (XMLRouteFactory (node_copy, 3000)); if (route == 0) { diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h index 476e367383..6c099dc0c3 100644 --- a/libs/pbd/pbd/xml++.h +++ b/libs/pbd/pbd/xml++.h @@ -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; diff --git a/libs/pbd/xml++.cc b/libs/pbd/xml++.cc index c46c5638b8..d5d863e9e5 100644 --- a/libs/pbd/xml++.cc +++ b/libs/pbd/xml++.cc @@ -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)