ocarina/include/core/deck.h

69 lines
1.6 KiB
C++

/**
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_DECK_H
#define OCARINA_CORE_DECK_H
extern "C" {
#include <core/queue.h>
}
#include <list>
/**
* A TempQueue is a wrapper around the Queue class that
* allows us to save the list of queues when necessary.
*/
class TempQueue : public queue
{
public:
void read(file &);
unsigned int add(struct track *);
void del(struct track *);
void del(unsigned int);
};
/**
* The deck is used to hold temporary queues created by the user. This
* code is also in charge of maintaining a "recently played" queue of
* songs that have just played.
*
* When saving to disk:
* ... << deck.size() << endl;
* ... << deck[0] << endl;
* ...
* ... << deck[N] <<< endl;
*/
/* Called to initialize the temporary queue manager. */
void tempq_init(struct queue_ops *);
/* Called to deinitialize the temporary queue manager. */
void tempq_deinit();
/* Called to save the temporary queue list. */
void tempq_save(struct queue *, enum queue_flags);
/* Called to allocate a new temporary queue. */
struct queue *tempq_alloc(struct queue_ops *, unsigned int);
/* Called to free a temporary queue. */
void tempq_free(struct queue *);
/* Called to find a temporary queue by index. */
struct queue *tempq_get(unsigned int);
/* Called to move a temporary queue to a new index in the list. */
void tempq_move(struct queue *, unsigned int);
/* Called to find the next track to play. */
struct track *tempq_next();
/* Called to find the number of temporary queues currently allocated. */
unsigned int tempq_count();
#endif /* OCARINA_CORE_DECK_H */