2014-09-15 08:26:52 -04:00
|
|
|
/**
|
2013-12-22 17:24:09 -05:00
|
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
|
|
*/
|
2014-06-21 09:37:47 -04:00
|
|
|
#ifndef OCARINA_CORE_PLAYLIST_H
|
|
|
|
#define OCARINA_CORE_PLAYLIST_H
|
2013-12-22 17:24:09 -05:00
|
|
|
|
2015-11-07 17:02:06 -05:00
|
|
|
extern "C" {
|
2015-11-30 10:01:39 -05:00
|
|
|
#include <core/containers/index.h>
|
2015-11-07 17:02:06 -05:00
|
|
|
}
|
2014-06-05 10:19:22 -04:00
|
|
|
#include <core/queue.h>
|
2014-02-02 14:05:56 -05:00
|
|
|
|
2013-12-31 15:44:44 -05:00
|
|
|
#include <string>
|
2013-12-22 17:53:58 -05:00
|
|
|
|
2014-09-15 08:26:52 -04:00
|
|
|
/**
|
2014-12-11 08:21:25 -05:00
|
|
|
* 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.
|
2014-09-15 08:26:52 -04:00
|
|
|
*/
|
2013-12-31 16:58:40 -05:00
|
|
|
namespace playlist
|
2013-12-31 15:44:44 -05:00
|
|
|
{
|
2013-12-22 17:53:58 -05:00
|
|
|
|
2014-09-15 08:26:52 -04:00
|
|
|
/**
|
2014-12-11 08:21:25 -05:00
|
|
|
* Read playlist information from disk and removed banned tracks
|
|
|
|
* from the Library queue.
|
2014-09-15 08:26:52 -04:00
|
|
|
*/
|
2013-12-31 16:58:40 -05:00
|
|
|
void init();
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2015-10-24 19:34:45 -04:00
|
|
|
bool has(struct track *, const std::string &);
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a track to a playlist.
|
|
|
|
*
|
2014-12-11 08:21:25 -05:00
|
|
|
* Tracks added to the Banned playlist will be removed from
|
|
|
|
* the library queue.
|
|
|
|
*
|
2014-09-15 08:26:52 -04:00
|
|
|
* @param track The track to add.
|
|
|
|
* @param name The name of the playlist to add to.
|
|
|
|
*/
|
2015-10-24 19:34:45 -04:00
|
|
|
void add(struct track *, const std::string &);
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove a track from a playlist.
|
|
|
|
*
|
2014-12-11 08:21:25 -05:00
|
|
|
* Tracks removed from the Banned playlist will be added back
|
|
|
|
* to the library queue.
|
|
|
|
*
|
2014-09-15 08:26:52 -04:00
|
|
|
* @param track The track to remove.
|
|
|
|
* @param name The name of the playlist to remove from.
|
|
|
|
*/
|
2015-10-24 19:34:45 -04:00
|
|
|
void del(struct track *, const std::string &);
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
2014-12-11 08:21:25 -05:00
|
|
|
* Use to change the currently displayed playlist.
|
2014-09-15 08:26:52 -04:00
|
|
|
*
|
|
|
|
* @param name The name of the queue to queue up.
|
|
|
|
*/
|
2014-02-02 14:05:56 -05:00
|
|
|
void select(const std::string &);
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use to access specific tracks in a playlist.
|
|
|
|
*
|
|
|
|
* @param name The playlist to access.
|
2015-10-21 10:41:42 -04:00
|
|
|
* @return The index_entry containing the tracks.
|
2014-09-15 08:26:52 -04:00
|
|
|
*/
|
2015-10-21 10:41:42 -04:00
|
|
|
index_entry *get_tracks(const std::string &);
|
2014-09-15 08:26:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return The playlist queue.
|
|
|
|
*/
|
2015-11-16 09:12:15 -05:00
|
|
|
queue *get_queue();
|
2013-12-22 20:53:06 -05:00
|
|
|
|
2013-12-22 17:24:09 -05:00
|
|
|
};
|
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_CORE_PLAYLIST_H */
|