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
|
2016-05-16 07:48:29 -04:00
|
|
|
#include <core/playlists/artist.h>
|
2016-09-24 10:53:25 -04:00
|
|
|
#include <core/playlists/generic.h>
|
2016-05-13 13:50:59 -04:00
|
|
|
#include <core/playlists/library.h>
|
2016-05-09 11:18:28 -04:00
|
|
|
#include <core/playlists/system.h>
|
2016-08-14 10:20:15 -04:00
|
|
|
#include <core/playlists/user.h>
|
2013-12-22 17:53:58 -05:00
|
|
|
|
2016-04-24 09:57:50 -04:00
|
|
|
|
2015-12-09 08:11:21 -05:00
|
|
|
/* Called to initialize the playlist manager. */
|
2016-09-22 13:37:34 -04:00
|
|
|
void playlist_init(struct playlist_callbacks *);
|
2015-12-09 08:11:21 -05:00
|
|
|
|
2015-12-09 09:20:18 -05:00
|
|
|
/* Called to deinitialize the playlist manager. */
|
|
|
|
void playlist_deinit();
|
|
|
|
|
2016-08-12 16:12:17 -04:00
|
|
|
/* Called to force-save all playlists. */
|
|
|
|
void playlist_save();
|
|
|
|
|
2016-09-13 10:59:20 -04:00
|
|
|
/* Called to notify all playlists that a track has been played. */
|
|
|
|
void playlist_played(struct track *);
|
|
|
|
|
2016-09-20 10:00:12 -04:00
|
|
|
/* Called to notify all playlists that a track has been selected. */
|
|
|
|
void playlist_selected(struct track *);
|
|
|
|
|
2015-12-09 09:31:12 -05:00
|
|
|
|
2016-05-09 10:38:47 -04:00
|
|
|
/* Called to create a new playlist. */
|
2016-09-09 08:35:52 -04:00
|
|
|
struct playlist *playlist_new(enum playlist_type_t, const gchar *);
|
2016-05-09 10:38:47 -04:00
|
|
|
|
|
|
|
/* Called to delete a playlist. */
|
2016-09-09 10:17:37 -04:00
|
|
|
bool playlist_delete(struct playlist *);
|
2016-05-09 10:38:47 -04:00
|
|
|
|
|
|
|
|
2016-09-12 10:59:46 -04:00
|
|
|
/* Called to look up playlists either by name or id. */
|
2016-09-12 13:49:27 -04:00
|
|
|
struct playlist *playlist_lookup(enum playlist_type_t, const gchar *);
|
2016-09-12 10:59:46 -04:00
|
|
|
struct playlist *playlist_get(enum playlist_type_t, unsigned int);
|
2016-09-12 13:49:27 -04:00
|
|
|
|
2016-09-12 16:02:46 -04:00
|
|
|
/* Called to access the current playlist. */
|
|
|
|
struct playlist *playlist_current(void);
|
|
|
|
|
2016-09-12 13:49:27 -04:00
|
|
|
|
2016-09-12 13:08:24 -04:00
|
|
|
/* Called to select the current playlist. */
|
|
|
|
bool playlist_select(struct playlist *);
|
|
|
|
|
2016-09-13 08:47:45 -04:00
|
|
|
/* Called to get the next track from the default playlist. */
|
|
|
|
struct track *playlist_next(void);
|
|
|
|
|
|
|
|
/* Called to get a previously played track. */
|
|
|
|
struct track *playlist_prev(void);
|
|
|
|
|
2016-09-12 13:08:24 -04:00
|
|
|
|
2015-12-10 08:26:51 -05:00
|
|
|
/* Called to add a track to a playlist. */
|
2016-09-10 12:08:11 -04:00
|
|
|
bool playlist_add(struct playlist *, 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. */
|
2016-09-10 13:11:18 -04:00
|
|
|
bool playlist_remove(struct playlist *, struct track *);
|
2015-12-10 09:20:42 -05:00
|
|
|
|
2015-12-09 09:31:12 -05:00
|
|
|
/* Called to check if a specific track is in the playlist. */
|
2016-09-10 13:46:30 -04:00
|
|
|
bool playlist_has(struct playlist *, struct track *);
|
2015-12-09 09:55:55 -05:00
|
|
|
|
2015-12-09 10:38:57 -05:00
|
|
|
|
2016-05-01 19:55:47 -04:00
|
|
|
/* Called to set the playlist's random flag. */
|
2016-09-12 08:17:41 -04:00
|
|
|
void playlist_set_random(struct playlist *, bool);
|
2016-05-01 19:55:47 -04:00
|
|
|
|
2016-05-04 09:55:37 -04:00
|
|
|
/* Called to change the sort order of the playlist. */
|
2016-09-16 15:48:42 -04:00
|
|
|
bool playlist_sort(struct playlist *, enum compare_t);
|
2016-05-04 09:55:37 -04:00
|
|
|
|
2016-09-21 16:49:02 -04:00
|
|
|
|
|
|
|
/* Called to set the playlist's search text */
|
|
|
|
void playlist_set_search(struct playlist *, const gchar *);
|
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_CORE_PLAYLIST_H */
|