13
0

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
This commit is contained in:
Paul Davis 2019-03-20 21:16:57 -07:00
parent 02684009eb
commit fb74b9e015

View File

@ -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