| @@ -27,9 +27,17 @@ | |||
| #include "play_queue.h" | |||
| #include "utility/dspinst.h" | |||
| bool AudioPlayQueue::available(void) | |||
| { | |||
| if (userblock) return true; | |||
| userblock = allocate(); | |||
| if (userblock) return true; | |||
| return false; | |||
| } | |||
| int16_t * AudioPlayQueue::getBuffer(void) | |||
| { | |||
| if (userblock) return userblock->data; | |||
| while (1) { | |||
| userblock = allocate(); | |||
| if (userblock) return userblock->data; | |||
| @@ -36,6 +36,7 @@ public: | |||
| userblock(NULL), head(0), tail(0) { } | |||
| void play(int16_t data); | |||
| void play(const int16_t *data, uint32_t len); | |||
| bool available(void); | |||
| int16_t * getBuffer(void); | |||
| void playBuffer(void); | |||
| void stop(void); | |||