2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2013-09-05 09:37:54 +02:00
|
|
|
#ifndef MPD_SONG_ENUMERATOR_HXX
|
|
|
|
#define MPD_SONG_ENUMERATOR_HXX
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2016-02-07 08:23:30 +01:00
|
|
|
#include <memory>
|
|
|
|
|
2014-01-07 21:39:47 +01:00
|
|
|
class DetachedSong;
|
2013-01-29 18:56:35 +01:00
|
|
|
|
2013-09-05 09:37:54 +02:00
|
|
|
/**
|
|
|
|
* An object which provides serial access to a number of #Song
|
|
|
|
* objects. It is used to enumerate the contents of a playlist file.
|
|
|
|
*/
|
|
|
|
class SongEnumerator {
|
2013-01-29 18:56:35 +01:00
|
|
|
public:
|
2021-05-31 07:30:34 +02:00
|
|
|
virtual ~SongEnumerator() noexcept = default;
|
2013-09-05 09:37:54 +02:00
|
|
|
|
|
|
|
/**
|
2016-02-07 08:23:30 +01:00
|
|
|
* Obtain the next song. Returns nullptr if there are no more
|
|
|
|
* songs.
|
2018-01-20 20:11:15 +01:00
|
|
|
*
|
|
|
|
* Throws on error.
|
2013-09-05 09:37:54 +02:00
|
|
|
*/
|
2016-02-07 08:23:30 +01:00
|
|
|
virtual std::unique_ptr<DetachedSong> NextSong() = 0;
|
2013-01-29 18:56:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|