2013-01-29 18:56:35 +01:00
|
|
|
/*
|
2018-10-31 17:54:59 +01:00
|
|
|
* Copyright 2003-2018 The Music Player Daemon Project
|
2013-01-29 18:56:35 +01:00
|
|
|
* http://www.musicpd.org
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MPD_MEMORY_PLAYLIST_PROVIDER_HXX
|
|
|
|
#define MPD_MEMORY_PLAYLIST_PROVIDER_HXX
|
|
|
|
|
2013-09-05 09:37:54 +02:00
|
|
|
#include "SongEnumerator.hxx"
|
2018-08-02 13:45:43 +02:00
|
|
|
#include "song/DetachedSong.hxx"
|
2018-08-20 16:19:17 +02:00
|
|
|
#include "util/Compiler.h"
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2013-01-29 18:51:40 +01:00
|
|
|
#include <forward_list>
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2013-09-05 09:37:54 +02:00
|
|
|
class MemorySongEnumerator final : public SongEnumerator {
|
2014-01-07 21:39:47 +01:00
|
|
|
std::forward_list<DetachedSong> songs;
|
2013-01-29 18:56:35 +01:00
|
|
|
|
|
|
|
public:
|
2014-01-07 21:39:47 +01:00
|
|
|
MemorySongEnumerator(std::forward_list<DetachedSong> &&_songs)
|
2013-09-05 09:37:54 +02:00
|
|
|
:songs(std::move(_songs)) {}
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2016-02-07 08:23:30 +01:00
|
|
|
virtual std::unique_ptr<DetachedSong> NextSong() override;
|
2013-01-29 18:56:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|