ocarina/include/core/playlists/type.h

50 lines
1.2 KiB
C

/*
* Copyright 2016 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_PLAYLISTS_TYPE_H
#define OCARINA_CORE_PLAYLISTS_TYPE_H
#include <core/queue.h>
#include <core/tags/track.h>
#include <glib.h>
#include <stdbool.h>
enum playlist_type_t {
PL_SYSTEM,
PL_MAX_TYPE,
};
struct playlist {
enum playlist_type_t pl_type; /* This playlist's type. */
const gchar *pl_name; /* This playlist's name. */
struct queue pl_queue; /* This playlist's queue of tracks. */
};
#define DEFINE_PLAYLIST(type, name) { .pl_type = type, .pl_name = name }
struct playlist_type {
/* Called to get the queue for the playlist. */
struct queue *(*pl_get_queue)(const gchar *);
/* Called to add a track to the playlist. */
bool (*pl_add_track)(const gchar *, struct track *);
/* Called to remove a track from the playlist. */
bool (*pl_remove_track)(const gchar *, struct track *);
/* Called to update a playlist. */
void (*pl_update)(const gchar *);
/* Called to set a playlist flag. */
void (*pl_set_flag)(const gchar *, enum queue_flags, bool);
/* Called to sort a playlist. */
void (*pl_sort)(const gchar *, enum compare_t, bool);
};
#endif /* OCARINA_CORE_PLAYLISTS_TYPE_H */