ocarina/include/core/playlist.h

72 lines
1.7 KiB
C
Raw Normal View History

/**
* 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
{
/**
* 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 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 &);
};
/* Called to initialize the playlist manager. */
void playlist_init(struct queue_ops *);
/* Called to deinitialize the playlist manager. */
void playlist_deinit();
/* Called to add a track to a playlist. */
void playlist_add(const gchar *, struct track *);
/* Called to check if a specific track is in the playlist. */
bool playlist_has(const gchar *, struct track *);
/* Called to fill the queue with a specific playlist. */
void playlist_select(const gchar *);
/* Called to access the playlist queue. */
struct queue *playlist_get_queue();
#endif /* OCARINA_CORE_PLAYLIST_H */