Browse Source

do not forget - your own addition :-)

dds
Frank Bösing 10 years ago
parent
commit
94c7aced03
2 changed files with 9 additions and 0 deletions
  1. +8
    -0
      play_queue.cpp
  2. +1
    -0
      play_queue.h

+ 8
- 0
play_queue.cpp View File

#include "play_queue.h" #include "play_queue.h"
#include "utility/dspinst.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) int16_t * AudioPlayQueue::getBuffer(void)
{ {
if (userblock) return userblock->data;
while (1) { while (1) {
userblock = allocate(); userblock = allocate();
if (userblock) return userblock->data; if (userblock) return userblock->data;

+ 1
- 0
play_queue.h View File

userblock(NULL), head(0), tail(0) { } userblock(NULL), head(0), tail(0) { }
void play(int16_t data); void play(int16_t data);
void play(const int16_t *data, uint32_t len); void play(const int16_t *data, uint32_t len);
bool available(void);
int16_t * getBuffer(void); int16_t * getBuffer(void);
void playBuffer(void); void playBuffer(void);
void stop(void); void stop(void);

Loading…
Cancel
Save