2015-12-10 13:59:21 -05:00
|
|
|
/*
|
2013-12-22 17:24:09 -05:00
|
|
|
* Copyright 2013 (c) Anna Schumaker.
|
2015-12-10 12:33:15 -05:00
|
|
|
*
|
|
|
|
* The playlist manager is in charge of the various playlists Ocarina
|
|
|
|
* knows about. This code also manages a special queue used by the GUI
|
|
|
|
* to display the tracks in each playlist.
|
2013-12-22 17:24:09 -05:00
|
|
|
*/
|
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-30 10:01:39 -05:00
|
|
|
#include <core/containers/index.h>
|
2014-06-05 10:19:22 -04:00
|
|
|
#include <core/queue.h>
|
2013-12-22 17:53:58 -05:00
|
|
|
|
2015-12-10 13:26:22 -05:00
|
|
|
enum playlist_t {
|
|
|
|
PL_FAVORITED, /* Songs that the user likes. */
|
2016-02-26 15:37:27 -05:00
|
|
|
PL_HIDDEN, /* Songs that the user has hidden. */
|
2015-12-10 13:26:22 -05:00
|
|
|
PL_UNPLAYED, /* Songs that have not been played yet. */
|
|
|
|
PL_MOST_PLAYED, /* Songs with an above average play count. */
|
|
|
|
PL_LEAST_PLAYED, /* Songs with a below average play count. */
|
|
|
|
};
|
|
|
|
|
2015-12-09 08:11:21 -05:00
|
|
|
/* Called to initialize the playlist manager. */
|
|
|
|
void playlist_init(struct queue_ops *);
|
|
|
|
|
2015-12-09 09:20:18 -05:00
|
|
|
/* Called to deinitialize the playlist manager. */
|
|
|
|
void playlist_deinit();
|
|
|
|
|
2015-12-09 09:31:12 -05:00
|
|
|
|
2015-12-10 08:26:51 -05:00
|
|
|
/* Called to add a track to a playlist. */
|
2015-12-10 14:44:31 -05:00
|
|
|
bool playlist_add(enum playlist_t, struct track *);
|
2015-12-10 08:26:51 -05:00
|
|
|
|
2015-12-10 09:20:42 -05:00
|
|
|
/* Called to remove a track from a playlist. */
|
2015-12-11 08:21:21 -05:00
|
|
|
bool playlist_remove(enum playlist_t, struct track *);
|
2015-12-10 09:20:42 -05:00
|
|
|
|
2015-12-10 08:26:51 -05:00
|
|
|
|
2015-12-09 09:31:12 -05:00
|
|
|
/* Called to check if a specific track is in the playlist. */
|
2015-12-10 13:26:22 -05:00
|
|
|
bool playlist_has(enum playlist_t, struct track *);
|
2015-12-09 09:31:12 -05:00
|
|
|
|
2015-12-09 09:55:55 -05:00
|
|
|
/* Called to fill the queue with a specific playlist. */
|
2015-12-10 13:26:22 -05:00
|
|
|
void playlist_select(enum playlist_t);
|
2015-12-09 09:55:55 -05:00
|
|
|
|
2015-12-09 10:38:57 -05:00
|
|
|
|
|
|
|
/* Called to access the playlist queue. */
|
|
|
|
struct queue *playlist_get_queue();
|
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_CORE_PLAYLIST_H */
|