89 lines
2.0 KiB
C++
89 lines
2.0 KiB
C++
/**
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_CORE_PLAYLIST_H
|
|
#define OCARINA_CORE_PLAYLIST_H
|
|
|
|
extern "C" {
|
|
#include <core/containers/index.h>
|
|
#include <core/queue.h>
|
|
}
|
|
|
|
#include <string>
|
|
|
|
/**
|
|
* The playlist namespace is in charge of managing the various playlists
|
|
* Ocarina knows aboit. It is also in charge of a special queue that the
|
|
* UI uses to display Tracks in each playlist.
|
|
*
|
|
* Currently supported playlists are:
|
|
*
|
|
* Name | Description
|
|
* ----------|------------
|
|
* Banned | Songs that the user doesn't like.
|
|
* Favorites | Songs that the user likes.
|
|
*/
|
|
namespace playlist
|
|
{
|
|
|
|
/**
|
|
* Read playlist information from disk and removed banned tracks
|
|
* from the Library queue.
|
|
*/
|
|
void init(struct queue_ops *);
|
|
|
|
/**
|
|
* Check if a specific track is in a playlist.
|
|
*
|
|
* @param track The track in question.
|
|
* @param name The name of the playlist to check.
|
|
* @return True if the track is in the playlist, false otherwise.
|
|
*/
|
|
bool has(struct track *, const std::string &);
|
|
|
|
/**
|
|
* Add a track to a playlist.
|
|
*
|
|
* Tracks added to the Banned playlist will be removed from
|
|
* the library queue.
|
|
*
|
|
* @param track The track to add.
|
|
* @param name The name of the playlist to add to.
|
|
*/
|
|
void add(struct track *, const std::string &);
|
|
|
|
/**
|
|
* Remove a track from a playlist.
|
|
*
|
|
* Tracks removed from the Banned playlist will be added back
|
|
* to the library queue.
|
|
*
|
|
* @param track The track to remove.
|
|
* @param name The name of the playlist to remove from.
|
|
*/
|
|
void del(struct track *, const std::string &);
|
|
|
|
/**
|
|
* Use to change the currently displayed playlist.
|
|
*
|
|
* @param name The name of the queue to queue up.
|
|
*/
|
|
void select(const std::string &);
|
|
|
|
/**
|
|
* Use to access specific tracks in a playlist.
|
|
*
|
|
* @param name The playlist to access.
|
|
* @return The index_entry containing the tracks.
|
|
*/
|
|
index_entry *get_tracks(const std::string &);
|
|
|
|
/**
|
|
* @return The playlist queue.
|
|
*/
|
|
queue *get_queue();
|
|
|
|
};
|
|
|
|
#endif /* OCARINA_CORE_PLAYLIST_H */
|