ocarina/include/playqueue.h
Anna Schumaker bc3220ae85 playqueue: Generate a string representing current runtime.
I almost did this on the gui side, but then I remembered that this isn't
a trivial job.  I chose to stick with my rule: "if something can be done
in the backend then it should be done in the backend"

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00

52 lines
982 B
C++

/*
* 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),
};
class Playqueue {
private:
std :: vector <unsigned int> tracks;
unsigned int flags;
unsigned int cur;
unsigned int length;
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 */