Beatmup
|
Audio::Source reading samples from a given Signal. More...
#include <signal.h>
Public Member Functions | |
Source (Signal &) | |
ThreadIndex | getMaxThreads () |
Returns the maximum number of working threads for rendering from this source. More... | |
void | prepare (const dtime sampleRate, const AudioSampleFormat sampleFormat, const unsigned char numChannels, const dtime maxBufferLen) |
Prepares a source to render audio data. More... | |
void | setClock (dtime time) |
Called by the source user when an abrupt time change occurs (e.g., due to seeking) More... | |
void | render (TaskThread &thread, sample8 *buffer, const dtime bufferLength) |
Renders audio data to the target output buffer given by the user. More... | |
Public Member Functions inherited from Beatmup::Audio::Source | |
virtual | ~Source () |
Private Attributes | |
Signal * | signal |
dtime | time |
AudioSampleFormat | sampleFormat |
unsigned char | numChannels |
Audio::Source reading samples from a given Signal.
Signal::Source::Source | ( | Signal & | signal | ) |
Definition at line 351 of file signal.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 from Beatmup::Audio::Source.
|
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 |
Implements Beatmup::Audio::Source.
Definition at line 354 of file signal.cpp.
|
virtual |
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
Reimplemented from Beatmup::Audio::Source.
Definition at line 365 of file signal.cpp.
|
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 |
Implements Beatmup::Audio::Source.
Definition at line 370 of file signal.cpp.
|
private |
|
private |