core/tempq: Remove unused TempQueue class
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
9633806c2d
commit
27eab88b9c
|
@ -8,34 +8,14 @@ extern "C" {
|
|||
#include <core/deck.h>
|
||||
#include <core/file.h>
|
||||
|
||||
static std::list<TempQueue> queue_deck;
|
||||
static std::list<struct queue> queue_deck;
|
||||
static struct file deck_file;
|
||||
|
||||
|
||||
unsigned int TempQueue :: add(struct track *track)
|
||||
{
|
||||
unsigned int res = queue_add(this, track);
|
||||
tempq_save(this, Q_ENABLED);
|
||||
return res;
|
||||
}
|
||||
|
||||
void TempQueue :: del(struct track *track)
|
||||
{
|
||||
queue_remove_all(this, track);
|
||||
tempq_save(this, Q_ENABLED);
|
||||
}
|
||||
|
||||
void TempQueue :: del(unsigned int id)
|
||||
{
|
||||
queue_remove(this, id);
|
||||
tempq_save(this, Q_ENABLED);
|
||||
}
|
||||
|
||||
|
||||
static unsigned int __tempq_index(struct queue *queue)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
std::list<TempQueue>::iterator it;
|
||||
std::list<struct queue>::iterator it;
|
||||
|
||||
for (it = queue_deck.begin(); it != queue_deck.end(); it++) {
|
||||
if (&(*it) == queue)
|
||||
|
@ -80,7 +60,7 @@ void tempq_deinit()
|
|||
|
||||
void tempq_save(struct queue *queue, enum queue_flags flag)
|
||||
{
|
||||
std::list<TempQueue>::iterator it;
|
||||
std::list<struct queue>::iterator it;
|
||||
unsigned int i;
|
||||
|
||||
if (!file_open(&deck_file, OPEN_WRITE))
|
||||
|
@ -102,8 +82,9 @@ void tempq_save(struct queue *queue, enum queue_flags flag)
|
|||
struct queue *tempq_alloc(struct queue_ops *ops, unsigned int flags)
|
||||
{
|
||||
struct queue *queue;
|
||||
struct queue new_queue;
|
||||
|
||||
queue_deck.push_back(TempQueue());
|
||||
queue_deck.push_back(new_queue);
|
||||
queue = &queue_deck.back();
|
||||
queue_init(queue, flags | Q_ENABLED | Q_SAVE_FLAGS | Q_SAVE_SORT, ops);
|
||||
tempq_save(queue, Q_ENABLED);
|
||||
|
@ -112,7 +93,7 @@ struct queue *tempq_alloc(struct queue_ops *ops, unsigned int flags)
|
|||
|
||||
void tempq_free(struct queue *queue)
|
||||
{
|
||||
std::list<TempQueue>::iterator it;
|
||||
std::list<struct queue>::iterator it;
|
||||
|
||||
for (it = queue_deck.begin(); it != queue_deck.end(); it++) {
|
||||
if (&(*it) == queue) {
|
||||
|
@ -127,7 +108,7 @@ void tempq_free(struct queue *queue)
|
|||
|
||||
struct queue *tempq_get(unsigned int index)
|
||||
{
|
||||
std::list<TempQueue>::iterator it;
|
||||
std::list<struct queue>::iterator it;
|
||||
unsigned int i;
|
||||
|
||||
it = queue_deck.begin();
|
||||
|
@ -142,8 +123,8 @@ struct queue *tempq_get(unsigned int index)
|
|||
void tempq_move(struct queue *queue, unsigned int index)
|
||||
{
|
||||
unsigned int old_pos = __tempq_index(queue);
|
||||
std::list<TempQueue>::iterator it_old = queue_deck.begin();
|
||||
std::list<TempQueue>::iterator it_new = queue_deck.begin();
|
||||
std::list<struct queue>::iterator it_old = queue_deck.begin();
|
||||
std::list<struct queue>::iterator it_new = queue_deck.begin();
|
||||
|
||||
for (unsigned int i = 0; i < queue_deck.size(); i++) {
|
||||
if (i < old_pos)
|
||||
|
@ -163,7 +144,7 @@ void tempq_move(struct queue *queue, unsigned int index)
|
|||
struct track *tempq_next()
|
||||
{
|
||||
struct track *track = NULL;
|
||||
std::list<TempQueue>::iterator it;
|
||||
std::list<struct queue>::iterator it;
|
||||
|
||||
for (it = queue_deck.begin(); it != queue_deck.end(); it++) {
|
||||
if (queue_has_flag(&(*it), Q_ENABLED) == false)
|
||||
|
|
|
@ -10,19 +10,6 @@ extern "C" {
|
|||
#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:
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue