summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorJulien ROGER <gulien.roger@gmail.com>2016-11-30 17:02:20 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-01-05 09:20:50 +0000
commit481334ae2a313e684897f3096107c2a832ca5759 (patch)
tree56d9acb58ca4ae8fed9ab62180eb692df577661c /libs/ardour/session.cc
parent0eedb7f86609c0d9ec9ecc7a0b77fa949d158937 (diff)
Proposed fix managing shared playlists (see #7150)
Actually, when duplicating a track with "share playlist", the current playlist is owned by the new created track(orig-track-id). The sharing mecanism is made by diskstreams pointing on the same(shared) playlist. Since playlist now owned by the new track, selecting another playlist in the original track "forgets" the playlist for this track.You can't select the shared playlist anymore from the original track. This commit adds a way to keep trace of shared playlist between tracks.
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 3575a5c152..f16324dca8 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3255,7 +3255,15 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
boost::shared_ptr<Playlist> playlist = playlists->by_name (playlist_name);
// Use same name as Route::set_name_in_state so playlist copy
// is picked up when creating the Route in XMLRouteFactory below
- PlaylistFactory::create (playlist, string_compose ("%1.1", name));
+ playlist = PlaylistFactory::create (playlist, string_compose ("%1.1", name));
+ playlist->reset_shares ();
+ }
+ } else if (pd == SharePlaylist) {
+ XMLNode* ds_node = find_named_node (node_copy, "Diskstream");
+ if (ds_node) {
+ const std::string playlist_name = ds_node->property (X_("playlist"))->value ();
+ boost::shared_ptr<Playlist> playlist = playlists->by_name (playlist_name);
+ playlist->share_with ((node_copy.property (X_("id")))->value());
}
}