22 #include "../../debug.h"
110 virtual void start();
Abstract audio playback base class.
virtual void pushBuffer(sample8 *buffer, int bufferIndex)
Pushes some data to the output.
void prepareBuffers(const AbstractPlayback::Mode &mode)
Allocates all the atomic buffers.
sample8 ** buffers
buffers containing the data to play
virtual void freeBuffer(sample8 *buffer) const
Frees an atomic playing buffer.
OutputMode
Specifies how the output audio signal is handled by the audio backend.
@ PULL
The output is requested by pullOutput(..) called by the audio backend.
@ PUSH
The output is sent to pushOutput(..) called by the rendering thread.
int playIndex
points to the buffer currently being played; updated only in the callback
void bufferQueueCallbackFunc()
virtual sample8 * createBuffer(const AbstractPlayback::Mode &mode) const
Creates an atomic playing buffer.
virtual ~BasicRealtimePlayback()
dtime playingBufferOffset
when pulling output, offset in frames with respect to the currently playing buffer
bool process(TaskThread &thread)
Executes the task on CPU within a given thread.
void pullBuffer(sample8 *buffer, dtime numFrames)
Called in pulling output mode to send data to output.
int sendIndex
points to the first buffer ready for playing
virtual void stop()=0
Stops playback.
BasicRealtimePlayback(OutputMode)
int fillIndex
points to the buffer currently being filled
void initialize(Mode mode)
Initializes the playback setting its main parameters.
const OutputMode outputMode
msize bufferSize
size of each buffer in bytes
dtime skipFrames
when pulling output, number of frames to skip to give some time to the rendering process
virtual void start()
Starts playback.
uint32_t msize
memory size