aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistQueue.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-05 09:37:54 +0200
committerMax Kellermann <max@duempel.org>2013-09-05 09:40:55 +0200
commit8929f88e6d78d538d943e80b66fcf21706e53974 (patch)
tree01232fd55f40dfa1cded59cb28a79b257ebb19e4 /src/PlaylistQueue.cxx
parent5348808bf594de927cc64eebae9118d6971343b1 (diff)
downloadmpd-8929f88e6d78d538d943e80b66fcf21706e53974.tar.gz
mpd-8929f88e6d78d538d943e80b66fcf21706e53974.tar.xz
mpd-8929f88e6d78d538d943e80b66fcf21706e53974.zip
PlaylistPlugin: add interface SongEnumerator
Replaces struct playlist_provider.
Diffstat (limited to 'src/PlaylistQueue.cxx')
-rw-r--r--src/PlaylistQueue.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/PlaylistQueue.cxx b/src/PlaylistQueue.cxx
index af68176fe..901ee578d 100644
--- a/src/PlaylistQueue.cxx
+++ b/src/PlaylistQueue.cxx
@@ -24,10 +24,11 @@
#include "PlaylistSong.hxx"
#include "Playlist.hxx"
#include "InputStream.hxx"
+#include "SongEnumerator.hxx"
#include "Song.hxx"
enum playlist_result
-playlist_load_into_queue(const char *uri, struct playlist_provider *source,
+playlist_load_into_queue(const char *uri, SongEnumerator &e,
unsigned start_index, unsigned end_index,
struct playlist *dest, struct player_control *pc,
bool secure)
@@ -37,7 +38,7 @@ playlist_load_into_queue(const char *uri, struct playlist_provider *source,
char *base_uri = uri != NULL ? g_path_get_dirname(uri) : NULL;
for (unsigned i = 0;
- i < end_index && (song = playlist_plugin_read(source)) != NULL;
+ i < end_index && (song = e.NextSong()) != NULL;
++i) {
if (i < start_index) {
/* skip songs before the start index */
@@ -72,15 +73,15 @@ playlist_open_into_queue(const char *uri,
Cond cond;
struct input_stream *is;
- struct playlist_provider *playlist =
- playlist_open_any(uri, mutex, cond, &is);
+ auto playlist = playlist_open_any(uri, mutex, cond, &is);
if (playlist == NULL)
return PLAYLIST_RESULT_NO_SUCH_LIST;
enum playlist_result result =
- playlist_load_into_queue(uri, playlist, start_index, end_index,
+ playlist_load_into_queue(uri, *playlist,
+ start_index, end_index,
dest, pc, secure);
- playlist_plugin_close(playlist);
+ delete playlist;
if (is != NULL)
is->Close();