8#include <tremor/ivorbisfile.h>
9#include "../drivers/ThreadDriver.h"
17class GuiSoundOggPlayer {
31 bool play(
const uint8_t *data, int32_t length,
int time_pos,
bool loop);
64 static void* threadEntry(
void *arg);
67 static size_t readOgg(
void *ptr,
size_t size,
size_t nmemb,
void *datasource);
68 static int seekOgg(
void *datasource, ogg_int64_t offset,
int whence);
69 static int closeOgg(
void *datasource);
70 static long tellOgg(
void *datasource);
83 volatile bool threadRunning;
84 volatile bool streamPaused;
85 volatile bool streamLoop;
90 static const int BUFFER_SIZE = 16384;
91 uint8_t *pcmBuffer[2];
92 int32_t pcmBufferSize[2];
93 volatile bool bufferReady[2];
95 volatile int decodeIndex;
96 volatile int playIndex;
void consumeBuffer()
Releases the buffer last returned by getReadyBuffer(), letting the decode thread reuse that ring slot...
void pause(bool pause)
Pauses or resumes the decode thread without stopping it.
const uint8_t * getReadyBuffer(int32_t *outSize)
bool play(const uint8_t *data, int32_t length, int time_pos, bool loop)
Starts decoding data on a new thread.
int getSampleRate() const
void stop()
Stops playback and joins the decode thread.