/* * 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 #include #include #include /* Called to initialize the playlist manager. */ void playlist_init(struct playlist_callbacks *); /* 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 notify all playlists that a track has been selected. */ void playlist_selected(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 set the playlist's random flag. */ void playlist_set_random(struct playlist *, bool); /* Called to change the sort order of the playlist. */ bool playlist_sort(struct playlist *, enum compare_t); /* Called to set the playlist's search text */ void playlist_set_search(struct playlist *, const gchar *); #endif /* OCARINA_CORE_PLAYLIST_H */