core/playlist: Clean up playlist headers
I renamed "type.h" to "playlist.h" to better match what it does. Additionally, I moved generic playlist functions into a new header file. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
ed095eb987
commit
93cb7145e6
|
@ -2,7 +2,7 @@
|
|||
* Copyright 2016 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <core/idle.h>
|
||||
#include <core/playlists/type.h>
|
||||
#include <core/playlists/generic.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
*/
|
||||
#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. */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_ARTIST_H
|
||||
#define OCARINA_CORE_PLAYLISTS_ARTIST_H
|
||||
#include <core/playlists/type.h>
|
||||
#include <core/playlists/generic.h>
|
||||
|
||||
/* Artist playlist type. */
|
||||
extern struct playlist_type pl_artist;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright 2016 (c) Anna Schumaker.
|
||||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_GENERIC_H
|
||||
#define OCARINA_CORE_PLAYLISTS_GENERIC_H
|
||||
#include <core/playlists/playlist.h>
|
||||
|
||||
/* Generic playlist init function. */
|
||||
void playlist_generic_init(struct playlist *, unsigned int, struct queue_ops *);
|
||||
|
||||
/* Generic playlist can-select function. */
|
||||
bool playlist_generic_can_select(struct playlist *);
|
||||
|
||||
/* Generic playlist clear operation. */
|
||||
void playlist_generic_clear(struct playlist *);
|
||||
|
||||
/* Generic playlist add track operations. */
|
||||
bool playlist_generic_add_track(struct playlist *, struct track *);
|
||||
bool playlist_generic_add_track_front(struct playlist *, struct track *);
|
||||
|
||||
/* Generic playlist remove track operation. */
|
||||
bool playlist_generic_remove_track(struct playlist *, struct track *);
|
||||
|
||||
/* Generic playlist set_flag operation. */
|
||||
void playlist_generic_set_flag(struct playlist *, enum queue_flags, bool);
|
||||
|
||||
/* Generic playlist sorting operation. */
|
||||
void playlist_generic_sort(struct playlist *, enum compare_t, bool);
|
||||
|
||||
/* Generic playlist next track operation. */
|
||||
struct track *playlist_generic_next(struct playlist *);
|
||||
|
||||
#endif /* OCARINA_CORE_PLAYLISTS_GENERIC_H */
|
|
@ -3,8 +3,7 @@
|
|||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_LIBRARY_H
|
||||
#define OCARINA_CORE_PLAYLISTS_LIBRARY_H
|
||||
#include <core/playlists/type.h>
|
||||
|
||||
#include <core/playlists/generic.h>
|
||||
|
||||
/* Library playlist type. */
|
||||
extern struct playlist_type pl_library;
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
/*
|
||||
* Copyright 2016 (c) Anna Schumaker.
|
||||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_TYPE_H
|
||||
#define OCARINA_CORE_PLAYLISTS_TYPE_H
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_PLAYLIST_H
|
||||
#define OCARINA_CORE_PLAYLISTS_PLAYLIST_H
|
||||
#include <core/queue.h>
|
||||
#include <core/tags/track.h>
|
||||
#include <glib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct playlist;
|
||||
|
||||
|
||||
enum playlist_type_t {
|
||||
PL_SYSTEM,
|
||||
PL_ARTIST,
|
||||
|
@ -45,11 +43,12 @@ struct playlist_ops {
|
|||
|
||||
|
||||
struct playlist {
|
||||
enum playlist_type_t pl_type; /* This playlist's type. */
|
||||
gchar *pl_name; /* This playlist's name. */
|
||||
unsigned int pl_id; /* This playlist's identifier. */
|
||||
void *pl_private; /* This playlist's private data. */
|
||||
struct queue pl_queue; /* This playlist's queue of tracks. */
|
||||
enum playlist_type_t pl_type; /* This playlist's type. */
|
||||
gchar *pl_name; /* This playlist's name. */
|
||||
unsigned int pl_id; /* This playlist's identifier. */
|
||||
|
||||
void *pl_private; /* This playlist's private data. */
|
||||
struct queue pl_queue; /* This playlist's queue of tracks. */
|
||||
|
||||
const struct playlist_ops *pl_ops; /* This playlist's supported operations. */
|
||||
};
|
||||
|
@ -78,31 +77,4 @@ struct playlist_type {
|
|||
void (*pl_played)(struct track *);
|
||||
};
|
||||
|
||||
|
||||
/* Generic playlist init function. */
|
||||
void playlist_generic_init(struct playlist *, unsigned int, struct queue_ops *);
|
||||
|
||||
/* Generic playlist can-select function. */
|
||||
bool playlist_generic_can_select(struct playlist *);
|
||||
|
||||
/* Generic playlist clear operation. */
|
||||
void playlist_generic_clear(struct playlist *);
|
||||
|
||||
/* Generic playlist add track operations. */
|
||||
bool playlist_generic_add_track(struct playlist *, struct track *);
|
||||
bool playlist_generic_add_track_front(struct playlist *, struct track *);
|
||||
|
||||
/* Generic playlist remove track operation. */
|
||||
bool playlist_generic_remove_track(struct playlist *, struct track *);
|
||||
|
||||
/* Generic playlist set_flag operation. */
|
||||
void playlist_generic_set_flag(struct playlist *, enum queue_flags, bool);
|
||||
|
||||
/* Generic playlist sorting operation. */
|
||||
void playlist_generic_sort(struct playlist *, enum compare_t, bool);
|
||||
|
||||
/* Generic playlist next track operation. */
|
||||
struct track *playlist_generic_next(struct playlist *);
|
||||
|
||||
|
||||
#endif /* OCARINA_CORE_PLAYLISTS_TYPE_H */
|
||||
#endif /* OCARINA_CORE_PLAYLISTS_PLAYLIST_H */
|
|
@ -3,8 +3,7 @@
|
|||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_SYSTEM_H
|
||||
#define OCARINA_CORE_PLAYLISTS_SYSTEM_H
|
||||
#include <core/playlists/type.h>
|
||||
|
||||
#include <core/playlists/generic.h>
|
||||
|
||||
enum sys_playlist_t {
|
||||
SYS_PL_FAVORITES, /* Songs that the user likes. */
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
*/
|
||||
#ifndef OCARINA_CORE_PLAYLISTS_USER_H
|
||||
#define OCARINA_CORE_PLAYLISTS_USER_H
|
||||
#include <core/playlists/type.h>
|
||||
|
||||
#include <core/playlists/generic.h>
|
||||
|
||||
struct user_playlist {
|
||||
struct playlist pl_playlist;
|
||||
|
|
Loading…
Reference in New Issue