--- a/sc2src/rcvqueue.h
+++ b/sc2src/rcvqueue.h
@@ -73,6 +73,7 @@
class AudioEater {
public:
enum BOrder {BO_MSB, BO_LSB, BO_HOST};
+ enum AudioState { UNKNOWN, STOPPED, PLAYING };
struct Context {
Context(WorkQueue<AudioMessage*> *q) : queue(q) {}
WorkQueue<AudioMessage*> *queue{nullptr};
@@ -80,14 +81,15 @@
};
// Constructor called by downstream module to set its params
- AudioEater(BOrder o, void *(*w)(void *))
- : input_border(o), worker(w) {
+ AudioEater(BOrder o, void *(*w)(void *), AudioState (*s)() = NULL)
+ : input_border(o), worker(w), state(s) {
}
BOrder input_border;
/** Worker routine for fetching bufs from the rcvqueue and sending them
* further. The param is actually an AudioEater::Context */
void *(*worker)(void *);
+ AudioState (*state)();
/** Packet counter. This is only used from the watcher thread to
detect activity/inactivity, by polling every few seconds, so no