2b426cff48
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
35 lines
615 B
C
35 lines
615 B
C
/*
|
|
* Copyright 2015 (c) Anna Schumaker.
|
|
*/
|
|
#include <core/history.h>
|
|
|
|
static struct queue history_queue;
|
|
#define HISTORY_FLAGS Q_ENABLED | Q_REPEAT | Q_NO_SORT | Q_ADD_FRONT
|
|
|
|
|
|
void history_init(struct queue_ops *history_ops)
|
|
{
|
|
queue_init(&history_queue, HISTORY_FLAGS, history_ops);
|
|
}
|
|
|
|
void history_deinit()
|
|
{
|
|
queue_deinit(&history_queue);
|
|
}
|
|
|
|
void history_add(struct track *track)
|
|
{
|
|
queue_add(&history_queue, track);
|
|
queue_iter_set(&history_queue, &history_queue.q_cur, 0);
|
|
}
|
|
|
|
struct track *history_prev()
|
|
{
|
|
return queue_next(&history_queue);
|
|
}
|
|
|
|
struct queue *history_get_queue()
|
|
{
|
|
return &history_queue;
|
|
}
|