2015-08-08 12:02:49 -04:00
|
|
|
|
|
|
|
#ifndef SRC_QUEUE_H_
|
|
|
|
#define SRC_QUEUE_H_
|
|
|
|
|
|
|
|
|
2015-09-12 02:22:52 -04:00
|
|
|
#include "db.h"
|
|
|
|
|
2015-08-08 12:02:49 -04:00
|
|
|
enum repeat_mode {
|
|
|
|
REPEAT_OFF = 0,
|
|
|
|
REPEAT_SONG = 1,
|
|
|
|
REPEAT_ALL = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal representation of a queue
|
|
|
|
*/
|
|
|
|
struct queue;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal representation of a list of queue items
|
|
|
|
*/
|
|
|
|
struct queue_item;
|
|
|
|
|
|
|
|
|
|
|
|
struct queue *
|
|
|
|
queue_new();
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_free(struct queue *queue);
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
queue_count(struct queue *queue);
|
|
|
|
|
|
|
|
int
|
2015-10-03 02:24:13 -04:00
|
|
|
queueitem_pos(struct queue_item *item, uint32_t id);
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
queueitem_id(struct queue_item *item);
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
queueitem_item_id(struct queue_item *item);
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
queueitem_len(struct queue_item *item);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
enum data_kind
|
|
|
|
queueitem_data_kind(struct queue_item *item);
|
|
|
|
|
|
|
|
enum media_kind
|
|
|
|
queueitem_media_kind(struct queue_item *item);
|
|
|
|
|
|
|
|
struct queue_item *
|
2015-08-08 12:02:49 -04:00
|
|
|
queue_get_byitemid(struct queue *queue, unsigned int item_id);
|
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue_item *
|
2015-08-08 12:02:49 -04:00
|
|
|
queue_get_byindex(struct queue *queue, unsigned int index, char shuffle);
|
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue_item *
|
2015-08-08 12:02:49 -04:00
|
|
|
queue_get_bypos(struct queue *queue, unsigned int item_id, unsigned int pos, char shuffle);
|
|
|
|
|
|
|
|
int
|
|
|
|
queue_index_byitemid(struct queue *queue, unsigned int item_id, char shuffle);
|
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue_item *
|
2015-09-19 02:23:41 -04:00
|
|
|
queue_next(struct queue *queue, unsigned int item_id, char shuffle, enum repeat_mode r_mode, int reshuffle);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue_item *
|
2015-08-08 12:02:49 -04:00
|
|
|
queue_prev(struct queue *queue, unsigned int item_id, char shuffle, enum repeat_mode r_mode);
|
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue *
|
|
|
|
queue_new_byindex(struct queue *queue, unsigned int index, unsigned int count, char shuffle);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
2015-10-03 02:24:13 -04:00
|
|
|
struct queue *
|
|
|
|
queue_new_bypos(struct queue *queue, unsigned int item_id, unsigned int count, char shuffle);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
queue_add(struct queue *queue, struct queue_item *item);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_add_after(struct queue *queue, struct queue_item *item, unsigned int item_id);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_move_bypos(struct queue *queue, unsigned int item_id, unsigned int from_pos, unsigned int to_offset, char shuffle);
|
|
|
|
|
2015-10-30 02:11:34 -04:00
|
|
|
void
|
|
|
|
queue_move_byitemid(struct queue *queue, unsigned int item_id, unsigned int to_pos, char shuffle);
|
|
|
|
|
2015-08-08 12:02:49 -04:00
|
|
|
void
|
|
|
|
queue_remove_byitemid(struct queue *queue, unsigned int item_id);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_remove_byindex(struct queue *queue, unsigned int index, char shuffle);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_remove_bypos(struct queue *queue, unsigned int item_id, unsigned int pos, char shuffle);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_clear(struct queue *queue);
|
|
|
|
|
|
|
|
void
|
|
|
|
queue_shuffle(struct queue *queue, unsigned int item_id);
|
|
|
|
|
|
|
|
struct queue_item *
|
2015-10-03 02:24:13 -04:00
|
|
|
queueitem_make_byquery(struct query_params *qp);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
|
|
|
struct queue_item *
|
2015-10-03 02:24:13 -04:00
|
|
|
queueitem_make_byplid(int plid);
|
2015-08-08 12:02:49 -04:00
|
|
|
|
2015-09-12 02:22:52 -04:00
|
|
|
struct queue_item *
|
2015-10-03 02:24:13 -04:00
|
|
|
queueitem_make_byid(uint32_t id);
|
2015-09-12 02:22:52 -04:00
|
|
|
|
2015-08-08 12:02:49 -04:00
|
|
|
#endif /* SRC_QUEUE_H_ */
|