2015-12-02 10:22:11 -05:00
|
|
|
/*
|
2013-12-31 15:44:44 -05:00
|
|
|
* Copyright 2013 (c) Anna Schumaker.
|
2015-12-02 10:22:11 -05:00
|
|
|
*
|
|
|
|
* Queues are lists of tracks that the user has requested to play next.
|
|
|
|
* Users of queues are expected to implement their own save and load functions,
|
|
|
|
* and to provide a filled out queue_ops structure during initialization.
|
2013-12-31 15:44:44 -05:00
|
|
|
*/
|
2014-06-21 09:37:47 -04:00
|
|
|
#ifndef OCARINA_CORE_QUEUE_H
|
|
|
|
#define OCARINA_CORE_QUEUE_H
|
2013-12-31 15:44:44 -05:00
|
|
|
|
2014-06-05 10:19:22 -04:00
|
|
|
#include <core/file.h>
|
2014-12-02 08:24:36 -05:00
|
|
|
#include <core/tags/track.h>
|
2014-05-11 19:52:08 -04:00
|
|
|
|
2015-12-02 10:22:11 -05:00
|
|
|
struct queue;
|
2013-12-31 15:44:44 -05:00
|
|
|
|
2014-12-07 09:57:43 -05:00
|
|
|
|
2015-11-23 08:36:29 -05:00
|
|
|
struct queue_ops {
|
2016-01-12 08:02:28 -05:00
|
|
|
/* Called to tell a higher layer that a queue has been initialized. */
|
2016-05-02 07:52:18 -04:00
|
|
|
void *(*qop_init)(struct queue *, void *);
|
2015-11-23 08:36:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-16 09:12:15 -05:00
|
|
|
struct queue {
|
2016-04-03 09:52:16 -04:00
|
|
|
void *q_private; /* The queue's private data. */
|
2013-12-31 15:44:44 -05:00
|
|
|
|
2016-04-03 09:40:01 -04:00
|
|
|
const struct queue_ops *q_ops; /* The queue's operations vector. */
|
2013-12-31 15:44:44 -05:00
|
|
|
};
|
|
|
|
|
2015-11-19 08:08:14 -05:00
|
|
|
|
2015-11-23 08:36:29 -05:00
|
|
|
/* Called to initialize a queue. */
|
2016-09-19 10:55:29 -04:00
|
|
|
void queue_init(struct queue *, const struct queue_ops *, void *);
|
2015-11-23 08:36:29 -05:00
|
|
|
|
2014-06-21 09:37:47 -04:00
|
|
|
#endif /* OCARINA_CORE_QUEUE_H */
|