b68198028e
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
108 lines
1.9 KiB
C++
108 lines
1.9 KiB
C++
/**
|
|
* @file
|
|
* Copyright 2013 (c) Anna Schumaker.
|
|
*/
|
|
#ifndef OCARINA_CORE_DECK_H
|
|
#define OCARINA_CORE_DECK_H
|
|
|
|
#include <core/queue.h>
|
|
#include <list>
|
|
|
|
|
|
class TempQueue : public Queue
|
|
{
|
|
public:
|
|
TempQueue();
|
|
TempQueue(bool random);
|
|
|
|
void set_flag(queue_flags);
|
|
void unset_flag(queue_flags);
|
|
|
|
unsigned int add(Track *);
|
|
void del(Track *);
|
|
void del(unsigned int);
|
|
|
|
void sort(sort_t, bool);
|
|
};
|
|
|
|
/**
|
|
* Namespace for manipulating Queue deck.
|
|
*/
|
|
namespace deck
|
|
{
|
|
|
|
/**
|
|
* Read the deck file from disk and restore the queues.
|
|
*/
|
|
void init();
|
|
|
|
/**
|
|
* Save the current queues to a file on disk.
|
|
*/
|
|
void write();
|
|
|
|
/**
|
|
* Create a new queue at the end of the deck.
|
|
*
|
|
* @param random Set to true if the new queue should return a random
|
|
* track when queue->next() is called.
|
|
* @return The newly created queue.
|
|
*/
|
|
Queue *create(bool);
|
|
|
|
/**
|
|
* Removes the queue from the deck.
|
|
*
|
|
* @param queue The queue to be removed.
|
|
*/
|
|
void destroy(Queue *);
|
|
|
|
/**
|
|
* Move the queue to a new location.
|
|
*
|
|
* @param queue The queue to be moved.
|
|
* @param index The new index of the queue.
|
|
*/
|
|
void move(Queue *, unsigned int);
|
|
|
|
/**
|
|
* Find the index of the requested queue.
|
|
*
|
|
* @param queue The queue in question.
|
|
* @return The index of the requested queue.
|
|
*/
|
|
unsigned int index(Queue *);
|
|
|
|
/**
|
|
* Access the queue at the specified index.
|
|
*
|
|
* @param index The index of the queue that should be accessed.
|
|
* @return The queue at the requested index.
|
|
*/
|
|
Queue *get(unsigned int);
|
|
|
|
/**
|
|
* @return A track from the first enabled queue. If no queues are
|
|
* enabled, return a track from the Library.
|
|
*/
|
|
Track *next();
|
|
|
|
/**
|
|
* @return A track from the recent tracks queue.
|
|
*/
|
|
Track *prev();
|
|
|
|
/**
|
|
* @return The deck of queues.
|
|
*/
|
|
std::list<TempQueue> &get_queues();
|
|
|
|
/**
|
|
* @return The queue of recent tracks.
|
|
*/
|
|
Queue *get_queue();
|
|
|
|
};
|
|
|
|
#endif /* OCARINA_CORE_DECK_H */
|