summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-24 13:43:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-24 13:43:48 +0000
commitd7e17f088fef2a3ab37fd90881cad1e06ca8878c (patch)
tree03caf9e8d51ede31f8fbe91035570443b47dabf6 /libs/ardour
parent68e72c94c88387e6ab158ffd7c1854afa59c75f3 (diff)
make adding tracks/busses from templates just like adding them at the start of a session, in that IO connections are prevented until they are all added, and then we connect. this should fix the locking issue in #4643
git-svn-id: svn://localhost/ardour2/branches/3.0@11329 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/route.cc18
-rw-r--r--libs/ardour/session.cc4
2 files changed, 21 insertions, 1 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 0282c3b032..ee316de900 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -1869,6 +1869,24 @@ Route::state(bool full_state)
}
for (i = _processors.begin(); i != _processors.end(); ++i) {
+ if (!full_state) {
+ /* template save: do not include internal sends functioning as
+ aux sends because the chance of the target ID
+ in the session where this template is used
+ is not very likely.
+
+ similarly, do not save listen sends which connect to
+ the monitor section, because these will always be
+ added if necessary.
+ */
+ boost::shared_ptr<InternalSend> is;
+
+ if ((is = boost::dynamic_pointer_cast<InternalSend> (*i)) != 0) {
+ if (is->role() == Delivery::Aux || is->role() == Delivery::Listen) {
+ continue;
+ }
+ }
+ }
node->add_child_nocopy((*i)->state (full_state));
}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index f2343e1013..e205ac3e82 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -2003,6 +2003,8 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
XMLNode* node = tree.root();
+ IO::disable_connecting ();
+
control_id = next_control_id ();
while (how_many) {
@@ -2080,6 +2082,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
out:
if (!ret.empty()) {
add_routes (ret, true, true);
+ IO::enable_connecting ();
}
return ret;
@@ -2243,7 +2246,6 @@ Session::add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::
if (!dest->internal_return()) {
dest->add_internal_return();
}
-
for (RouteList::iterator i = senders->begin(); i != senders->end(); ++i) {