/* * 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 #include /* 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 select the current playlist. */ bool playlist_select(enum playlist_type_t, const gchar *); /* 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 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 update tracks on a playlist. */ void playlist_update(enum playlist_type_t, const gchar *); /* 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. */ void playlist_sort(enum playlist_type_t, const gchar *, enum compare_t, bool); /* 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 access the playlist. */ struct playlist *playlist_get(enum playlist_type_t, const gchar *); /* Called to access the current playlist. */ struct playlist *playlist_cur(void); /* Called to access the playlist queue. */ struct queue *playlist_get_queue(enum playlist_type_t, const gchar *); /* Called to convert a playlist name to an integer id. */ unsigned int playlist_get_id(enum playlist_type_t, const gchar *); /* Called to convert a playlist id to a name. */ gchar *playlist_get_name(enum playlist_type_t, unsigned int); #endif /* OCARINA_CORE_PLAYLIST_H */