diff --git a/core/playlists/generic.c b/core/playlists/generic.c index b59c3741..8acae980 100644 --- a/core/playlists/generic.c +++ b/core/playlists/generic.c @@ -2,7 +2,7 @@ * Copyright 2016 (c) Anna Schumaker. */ #include -#include +#include /* diff --git a/include/core/playlist.h b/include/core/playlist.h index 9fe9edf0..3bb062a8 100644 --- a/include/core/playlist.h +++ b/include/core/playlist.h @@ -7,12 +7,10 @@ */ #ifndef OCARINA_CORE_PLAYLIST_H #define OCARINA_CORE_PLAYLIST_H - #include #include #include #include -#include /* Called to initialize the playlist manager. */ diff --git a/include/core/playlists/artist.h b/include/core/playlists/artist.h index 4f4a6952..5e18a356 100644 --- a/include/core/playlists/artist.h +++ b/include/core/playlists/artist.h @@ -3,7 +3,7 @@ */ #ifndef OCARINA_CORE_PLAYLISTS_ARTIST_H #define OCARINA_CORE_PLAYLISTS_ARTIST_H -#include +#include /* Artist playlist type. */ extern struct playlist_type pl_artist; diff --git a/include/core/playlists/generic.h b/include/core/playlists/generic.h new file mode 100644 index 00000000..739dade8 --- /dev/null +++ b/include/core/playlists/generic.h @@ -0,0 +1,33 @@ +/* + * Copyright 2016 (c) Anna Schumaker. + */ +#ifndef OCARINA_CORE_PLAYLISTS_GENERIC_H +#define OCARINA_CORE_PLAYLISTS_GENERIC_H +#include + +/* 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 */ diff --git a/include/core/playlists/library.h b/include/core/playlists/library.h index 4ab239e0..512dc8a3 100644 --- a/include/core/playlists/library.h +++ b/include/core/playlists/library.h @@ -3,8 +3,7 @@ */ #ifndef OCARINA_CORE_PLAYLISTS_LIBRARY_H #define OCARINA_CORE_PLAYLISTS_LIBRARY_H -#include - +#include /* Library playlist type. */ extern struct playlist_type pl_library; diff --git a/include/core/playlists/type.h b/include/core/playlists/playlist.h similarity index 51% rename from include/core/playlists/type.h rename to include/core/playlists/playlist.h index dd2a8304..1edcecd6 100644 --- a/include/core/playlists/type.h +++ b/include/core/playlists/playlist.h @@ -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 #include -#include #include 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 */ diff --git a/include/core/playlists/system.h b/include/core/playlists/system.h index 6b442e51..01e9edbe 100644 --- a/include/core/playlists/system.h +++ b/include/core/playlists/system.h @@ -3,8 +3,7 @@ */ #ifndef OCARINA_CORE_PLAYLISTS_SYSTEM_H #define OCARINA_CORE_PLAYLISTS_SYSTEM_H -#include - +#include enum sys_playlist_t { SYS_PL_FAVORITES, /* Songs that the user likes. */ diff --git a/include/core/playlists/user.h b/include/core/playlists/user.h index 88a6743c..c1648d7e 100644 --- a/include/core/playlists/user.h +++ b/include/core/playlists/user.h @@ -3,8 +3,7 @@ */ #ifndef OCARINA_CORE_PLAYLISTS_USER_H #define OCARINA_CORE_PLAYLISTS_USER_H -#include - +#include struct user_playlist { struct playlist pl_playlist;