-int
-DiskIOProcessor::find_and_use_playlist (DataType dt, const string& name)
-{
- boost::shared_ptr<Playlist> playlist;
-
- if ((playlist = _session.playlists->by_name (name)) == 0) {
- playlist = PlaylistFactory::create (dt, _session, name);
- }
-
- if (!playlist) {
- error << string_compose(_("DiskIOProcessor: \"%1\" isn't an playlist"), name) << endmsg;
- return -1;
- }
-
- return use_playlist (dt, playlist);
-}
-
-int
-DiskIOProcessor::use_new_playlist (DataType dt)
-{
- string newname;
- boost::shared_ptr<Playlist> playlist = _playlists[dt];
-
- if (playlist) {
- newname = Playlist::bump_name (playlist->name(), _session);
- } else {
- newname = Playlist::bump_name (_name, _session);
- }
-
- playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (dt, _session, newname, hidden()));
-
- if (!playlist) {
- return -1;
- }
-
- return use_playlist (dt, playlist);
-}
-
-int
-DiskIOProcessor::use_copy_playlist (DataType dt)
-{
- assert (_playlists[dt]);
-
- if (_playlists[dt] == 0) {
- error << string_compose(_("DiskIOProcessor %1: there is no existing playlist to make a copy of!"), _name) << endmsg;
- return -1;
- }
-
- string newname;
- boost::shared_ptr<Playlist> playlist;
-
- newname = Playlist::bump_name (_playlists[dt]->name(), _session);
-
- if ((playlist = PlaylistFactory::create (_playlists[dt], newname)) == 0) {
- return -1;
- }
-
- playlist->reset_shares();
-
- return use_playlist (dt, playlist);
-}
-