summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-03-20 21:16:57 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-03-20 21:16:57 -0700
commitfb74b9e015f1e071992dbad727745e9defab34ae (patch)
treeff049582ed8d249db940d3d4996d5b8dbfad963e
parent02684009ebcb94c71afd2266ece50b7efa2fe108 (diff)
working but still confusing fix for ensuring that playlist shared-with data is correct when duplicating tracks.
Confusing because orig_track_id is still being switched to the NEW track, and shared_with refers to the OLD one
-rw-r--r--libs/ardour/session.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 97db5c9615..2c00fbbd80 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3310,6 +3310,7 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
*/
XMLNode node_copy (node);
+ std::vector<boost::shared_ptr<Playlist> > shared_playlists;
try {
string name;
@@ -3365,12 +3366,12 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
if (node_copy.get_property (X_("audio-playlist"), playlist_id)) {
boost::shared_ptr<Playlist> playlist = _playlists->by_id (playlist_id);
- playlist->share_with ((node_copy.property (X_("id")))->value());
+ shared_playlists.push_back (playlist);
}
if (node_copy.get_property (X_("midi-playlist"), playlist_id)) {
boost::shared_ptr<Playlist> playlist = _playlists->by_id (playlist_id);
- playlist->share_with ((node_copy.property (X_("id")))->value());
+ shared_playlists.push_back (playlist);
}
} else { /* NewPlaylist */
@@ -3453,6 +3454,12 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
goto out;
}
+ /* Fix up sharing of playlists with the new Route/Track */
+
+ for (vector<boost::shared_ptr<Playlist> >::iterator sp = shared_playlists.begin(); sp != shared_playlists.end(); ++sp) {
+ (*sp)->share_with (route->id());
+ }
+
if (boost::dynamic_pointer_cast<Track>(route)) {
/* force input/output change signals so that the new diskstream
picks up the configuration of the route. During session