ocarina/include/core/playlist.h

87 lines
1.9 KiB
C++

/**
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_PLAYLIST_H
#define OCARINA_CORE_PLAYLIST_H
#include <core/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();
/**
* 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(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(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(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 IndexEntry containing the tracks.
*/
IndexEntry *get_tracks(const std::string &);
/**
* @return The playlist queue.
*/
Queue *get_queue();
};
#endif /* OCARINA_CORE_PLAYLIST_H */