gui: Wire up gui_queue_{alloc|free}() in the queue operations

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-01-13 09:37:05 -05:00
parent 2d6e42832b
commit f098811a28
5 changed files with 13 additions and 26 deletions

View File

@ -5,6 +5,7 @@ extern "C" {
#include <core/collection.h>
#include <core/playlist.h>
#include <gui/builder.h>
#include <gui/queue.h>
}
#include <gui/tabs.h>
#include <gui/queue/label.h>
@ -55,11 +56,7 @@ static CollectionTab *collection_tab;
static void *collection_init(struct queue *queue)
{
return collection_tab;
}
static void collection_deinit(struct queue *queue)
{
return gui_queue_alloc(queue, "Collection");
}
static void collection_added(struct queue *queue, unsigned int pos)
@ -88,7 +85,7 @@ static void collection_updated(struct queue *queue, unsigned int pos)
struct queue_ops collection_ops = {
collection_init,
collection_deinit,
gui_queue_free,
collection_added,
collection_removed,
collection_cleared,

View File

@ -4,6 +4,7 @@
extern "C" {
#include <core/history.h>
#include <gui/builder.h>
#include <gui/queue.h>
}
#include <gui/tabs.h>
#include <gui/queue/label.h>
@ -40,11 +41,7 @@ static HistoryTab *history_tab;
static void *history_init(struct queue *queue)
{
return history_tab;
}
static void history_deinit(struct queue *queue)
{
return gui_queue_alloc(queue, "History");
}
static void history_added(struct queue *queue, unsigned int pos)
@ -70,7 +67,7 @@ static void history_updated(struct queue *queue, unsigned int pos)
struct queue_ops history_ops = {
history_init,
history_deinit,
gui_queue_free,
history_added,
history_removed,
history_cleared,

View File

@ -7,6 +7,7 @@ extern "C" {
#include <core/playlist.h>
#include <gui/builder.h>
#include <gui/playlist.h>
#include <gui/queue.h>
}
#include <gui/tabs.h>
#include <gui/queue/label.h>
@ -86,11 +87,7 @@ static void on_favorite()
static void *playlist_init(struct queue *queue)
{
return p_tab;
}
static void playlist_deinit(struct queue *queue)
{
return gui_queue_alloc(queue, "Playlist");
}
static void playlist_added(struct queue *queue, unsigned int pos)
@ -116,7 +113,7 @@ static void playlist_updated(struct queue *queue, unsigned int pos)
struct queue_ops playlist_ops = {
playlist_init,
playlist_deinit,
gui_queue_free,
playlist_added,
playlist_removed,
playlist_cleared,

View File

@ -7,6 +7,7 @@ extern "C" {
#include <core/string.h>
#include <core/tempq.h>
#include <gui/builder.h>
#include <gui/queue.h>
#include <gui/sidebar.h>
}
#include <gui/tabs.h>
@ -25,12 +26,7 @@ static compare_t sort_fields[] = {
static void *tempq_init(struct queue *queue)
{
return NULL;
}
static void tempq_deinit(struct queue *queue)
{
return gui_queue_alloc(queue, "Queued Tracks");
}
static void tempq_added(struct queue *queue, unsigned int pos)
@ -60,7 +56,7 @@ static void tempq_updated(struct queue *queue, unsigned int pos)
struct queue_ops tempq_ops = {
tempq_init,
tempq_deinit,
gui_queue_free,
tempq_added,
tempq_removed,
tempq_cleared,

View File

@ -21,7 +21,7 @@ void gui_queue_free(struct queue *);
/* Called to access a the struct gui_queue attached to a queue. */
static inline struct gui_queue *gui_queue(struct queue *queue)
{
return queue->q_private;
return (struct gui_queue *)queue->q_private;
}
#endif /* OCARINA_GUI_QUEUE_H */