19 #include "../../debug.h"
23 using namespace Audio;
26 Exception(
"%s\nResult code: %d\nSampling mode: %d\nSample format: %d\nChannels: %d\nBuffers: %d of %d samples\n",
27 message, resultCode,
mode.sampleRate,
mode.sampleFormat,
mode.numChannels,
mode.numBuffers,
mode.bufferLength)
31 Exception(
"%s\nResult code: %d", message, resultCode)
37 dtime bufferLength,
int numBuffers):
38 sampleRate(sampleRate),
40 numChannels((unsigned char) numChannels),
41 bufferLength(bufferLength),
42 numBuffers((unsigned char) numBuffers)
65 Mode(sampleRate,
format, numChannels, bufferLength, 2)
ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
void advanceTime()
Moves time pointer one buffer forward.
virtual void initialize(Mode mode)
Initializes the playback setting its main parameters.
void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu)
Instruction called before the task is executed.
PlaybackException(const char *message, int resultCode)
virtual void setClock(dtime time)
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
virtual ThreadIndex getMaxThreads()
Returns the maximum number of working threads for rendering from this source.
virtual void prepare(const dtime sampleRate, const AudioSampleFormat sampleFormat, const unsigned char numChannels, const dtime maxBufferLen)=0
Prepares a source to render audio data.
Base class for all exceptions.
Internal low-level GPU control API.
static void insanity(const char *message)
unsigned char ThreadIndex
number of threads / thread index
AudioSampleFormat
Format of audio samples.
@ Int8
signed integer, 8 bit per sample
@ Int32
signed integer, 32 bit per sample
@ Float32
floating point, 32 bit per sample
@ Int16
signed integer, 16 bit per sample
AudioSampleFormat sampleFormat
format of each sample
dtime sampleRate
samples per second / sample rate in Hz
unsigned char numBuffers
number of atomic buffers
unsigned char numChannels
number of channels
dtime bufferLength
length of each atomic buffer in samples
JNIEnv jobject jint format