aboutsummaryrefslogtreecommitdiffstats
path: root/src/MemorySongEnumerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/MemorySongEnumerator.cxx (renamed from src/playlist/MemoryPlaylistProvider.cxx)45
1 files changed, 4 insertions, 41 deletions
diff --git a/src/playlist/MemoryPlaylistProvider.cxx b/src/MemorySongEnumerator.cxx
index c2b6d9312..7c9d05daa 100644
--- a/src/playlist/MemoryPlaylistProvider.cxx
+++ b/src/MemorySongEnumerator.cxx
@@ -18,50 +18,13 @@
*/
#include "config.h"
-#include "MemoryPlaylistProvider.hxx"
-#include "Song.hxx"
+#include "MemorySongEnumerator.hxx"
-static void
-memory_playlist_close(struct playlist_provider *_playlist)
-{
- MemoryPlaylistProvider *playlist = (MemoryPlaylistProvider *)_playlist;
-
- delete playlist;
-}
-
-static Song *
-memory_playlist_read(struct playlist_provider *_playlist)
-{
- MemoryPlaylistProvider *playlist = (MemoryPlaylistProvider *)_playlist;
-
- return playlist->Read();
-}
-
-static constexpr struct playlist_plugin memory_playlist_plugin = {
- nullptr,
-
- nullptr,
- nullptr,
- nullptr,
- nullptr,
- memory_playlist_close,
- memory_playlist_read,
-
- nullptr,
- nullptr,
- nullptr,
-};
-
-MemoryPlaylistProvider::MemoryPlaylistProvider(std::forward_list<SongPointer> &&_songs)
- :songs(std::move(_songs)) {
- playlist_provider_init(this, &memory_playlist_plugin);
-}
-
-inline Song *
-MemoryPlaylistProvider::Read()
+Song *
+MemorySongEnumerator::NextSong()
{
if (songs.empty())
- return NULL;
+ return nullptr;
auto result = songs.front().Steal();
songs.pop_front();