ocarina/include/playqueue.h

56 lines
1.1 KiB
C
Raw Normal View History

/*
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_PLAYQUEUE_H
#define OCARINA_PLAYQUEUE_H
#include <file.h>
#include <library.h>
#include <vector>
enum playqueue_flags {
PQ_ENABLED = (1 << 0),
PQ_RANDOM = (1 << 1),
PQ_REPEAT = (1 << 2),
PQ_SORTED = (1 << 3),
PQ_DISABLE_CHANGED_SIZE = (1 << 3),
};
class Playqueue {
private:
std :: vector <unsigned int> tracks;
unsigned int flags;
unsigned int cur;
unsigned int length;
unsigned int add_sorted(unsigned int, library :: Song &);
public:
Playqueue();
Playqueue(playqueue_flags);
~Playqueue();
void write(File &);
void read(File &);
void set_flag(playqueue_flags);
void unset_flag(playqueue_flags);
const unsigned int get_flags();
unsigned int get_length();
std::string get_length_str();
unsigned int add(unsigned int);
unsigned int add_front(unsigned int);
void del(unsigned int);
void del_track(unsigned int);
unsigned int size();
unsigned int operator[](unsigned int);
unsigned int next();
void reset_cur();
#ifdef CONFIG_TEST
void reset();
#endif /* CONFIG_TEST */
};
#endif /* OCARINA_PLAYQUEUE_H */