2014-02-17 15:47:19 -05:00
|
|
|
/*
|
|
|
|
* Copyright 2014 (c) Anna Schumaker.
|
|
|
|
*/
|
2015-12-12 09:04:25 -05:00
|
|
|
extern "C" {
|
2016-01-13 09:37:05 -05:00
|
|
|
#include <gui/queue.h>
|
2016-01-20 16:19:08 -05:00
|
|
|
#include <gui/sidebar.h>
|
2015-12-12 09:04:25 -05:00
|
|
|
}
|
2014-02-17 15:47:19 -05:00
|
|
|
|
2014-02-17 17:40:18 -05:00
|
|
|
|
2016-01-12 08:02:28 -05:00
|
|
|
static void *history_init(struct queue *queue)
|
|
|
|
{
|
2016-01-14 08:00:04 -05:00
|
|
|
return gui_queue_alloc(queue, "History", 0);
|
2016-01-13 08:18:03 -05:00
|
|
|
}
|
|
|
|
|
2015-11-29 19:45:39 -05:00
|
|
|
static void history_added(struct queue *queue, unsigned int pos)
|
|
|
|
{
|
2016-01-18 09:11:30 -05:00
|
|
|
gui_queue_added(queue, pos);
|
2016-01-20 16:19:08 -05:00
|
|
|
gui_sidebar_set_size(gui_queue(queue));
|
2015-11-29 19:45:39 -05:00
|
|
|
}
|
|
|
|
|
2016-01-22 08:11:09 -05:00
|
|
|
static bool history_erase(struct queue *queue, struct track *track)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-11-29 20:01:12 -05:00
|
|
|
static void history_removed(struct queue *queue, unsigned int pos)
|
|
|
|
{
|
2016-01-18 09:11:30 -05:00
|
|
|
gui_queue_removed(queue, pos);
|
2016-01-20 16:19:08 -05:00
|
|
|
gui_sidebar_set_size(gui_queue(queue));
|
2015-11-29 20:01:12 -05:00
|
|
|
}
|
|
|
|
|
2015-11-29 19:45:39 -05:00
|
|
|
struct queue_ops history_ops = {
|
2016-01-12 08:02:28 -05:00
|
|
|
history_init,
|
2016-01-13 09:37:05 -05:00
|
|
|
gui_queue_free,
|
2015-11-29 19:45:39 -05:00
|
|
|
history_added,
|
2016-01-22 08:11:09 -05:00
|
|
|
history_erase,
|
2015-11-29 20:01:12 -05:00
|
|
|
history_removed,
|
2016-01-20 16:49:37 -05:00
|
|
|
gui_queue_cleared,
|
2015-11-29 19:45:39 -05:00
|
|
|
NULL,
|
2016-01-20 16:49:37 -05:00
|
|
|
gui_queue_updated,
|
2015-11-29 19:45:39 -05:00
|
|
|
};
|