Anna Schumaker
0754f10883
This was only used by system playlists to keep the unplayed, most played, and least played playlist up to date. We can handle this internally through the playlist_played() handler. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
79 lines
2.3 KiB
C
79 lines
2.3 KiB
C
/*
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*
|
|
* 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.
|
|
*/
|
|
#ifndef OCARINA_CORE_PLAYLIST_H
|
|
#define OCARINA_CORE_PLAYLIST_H
|
|
|
|
#include <core/playlists/artist.h>
|
|
#include <core/playlists/library.h>
|
|
#include <core/playlists/system.h>
|
|
#include <core/playlists/user.h>
|
|
#include <core/queue.h>
|
|
|
|
|
|
/* Called to initialize the playlist manager. */
|
|
void playlist_init(struct queue_ops *);
|
|
|
|
/* Called to deinitialize the playlist manager. */
|
|
void playlist_deinit();
|
|
|
|
/* Called to force-save all playlists. */
|
|
void playlist_save();
|
|
|
|
/* Called to notify all playlists that a track has been played. */
|
|
void playlist_played(struct track *);
|
|
|
|
|
|
/* Called to create a new playlist. */
|
|
struct playlist *playlist_new(enum playlist_type_t, const gchar *);
|
|
|
|
/* Called to delete a playlist. */
|
|
bool playlist_delete(struct playlist *);
|
|
|
|
|
|
/* Called to look up playlists either by name or id. */
|
|
struct playlist *playlist_lookup(enum playlist_type_t, const gchar *);
|
|
struct playlist *playlist_get(enum playlist_type_t, unsigned int);
|
|
|
|
/* Called to access the current playlist. */
|
|
struct playlist *playlist_current(void);
|
|
|
|
|
|
/* Called to select the current playlist. */
|
|
bool playlist_select(struct playlist *);
|
|
|
|
/* 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);
|
|
|
|
|
|
/* Called to add a track to a playlist. */
|
|
bool playlist_add(struct playlist *, struct track *);
|
|
|
|
/* Called to remove a track from a playlist. */
|
|
bool playlist_remove(struct playlist *, struct track *);
|
|
|
|
/* Called to check if a specific track is in the playlist. */
|
|
bool playlist_has(struct playlist *, struct track *);
|
|
|
|
/* Called to find the number of tracks in the playlist. */
|
|
unsigned int playlist_size(struct playlist *);
|
|
|
|
|
|
/* Called to set the playlist's random flag. */
|
|
void playlist_set_random(struct playlist *, bool);
|
|
|
|
/* Called to check the playlist's random flag. */
|
|
bool playlist_get_random(struct playlist *);
|
|
|
|
/* Called to change the sort order of the playlist. */
|
|
bool playlist_sort(struct playlist *, enum compare_t, bool);
|
|
|
|
#endif /* OCARINA_CORE_PLAYLIST_H */
|