Beatmup
|
Abstract source of audio signal. More...
#include <source.h>
Public Member Functions | |
virtual | ~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. More... | |
virtual void | setClock (dtime time) |
Called by the source user when an abrupt time change occurs (e.g., due to seeking) More... | |
virtual ThreadIndex | getMaxThreads () |
Returns the maximum number of working threads for rendering from this source. More... | |
virtual void | render (TaskThread &thread, sample8 *buffer, const dtime bufferLength)=0 |
Renders audio data to the target output buffer given by the user. More... | |
Abstract source of audio signal.
Produces samples in time, possibly in multiple threads running in parallel.
|
inlinevirtual |
|
pure virtual |
Prepares a source to render audio data.
Called by the user before any rendering to communicate the configuration of the upcoming rendering process.
sampleRate | The output sample rate in Hz |
sampleFormat | The output sample format |
numChannels | Number of channels in the output |
maxBufferLen | Maximum expected length of target audio buffers on rendering phase, in samples per one channel |
Implemented in Beatmup::Audio::HarmonicSource, and Beatmup::Audio::Signal::Source.
|
virtual |
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
Reimplemented in Beatmup::Audio::HarmonicSource, and Beatmup::Audio::Signal::Source.
Definition at line 29 of file source.cpp.
|
inlinevirtual |
Returns the maximum number of working threads for rendering from this source.
The actual number of threads may be less than the one returned by this function. It is the source duty to deal with the actual number of workers.
Reimplemented in Beatmup::Audio::Signal::Source.
|
pure virtual |
Renders audio data to the target output buffer given by the user.
Called after at least one call to prepare(). The sampling parameters must match the ones communicated on the preparation phase. The requested buffer length does not exceed the one set before. The time is given by the clock set before, and with every call it advances by {bufferLength} samples.
thread | the task thread issuing this rendering call |
buffer | a pointer to the beginning of a channelwise-multiplexed output buffer |
bufferLength | the requested buffer length, in samples per single channel |
Implemented in Beatmup::Audio::HarmonicSource, and Beatmup::Audio::Signal::Source.