The base class for an audio source. More...
#include <AsyncAudioSource.h>
The base class for an audio source.
This is the base class for an audio source. An audio source is a class that can produce audio.
Definition at line 114 of file AsyncAudioSource.h.
Async::AudioSource::AudioSource | ( | void | ) | [inline] |
Default constuctor.
Definition at line 120 of file AsyncAudioSource.h.
virtual Async::AudioSource::~AudioSource | ( | void | ) | [virtual] |
Destructor.
virtual void Async::AudioSource::allSamplesFlushed | ( | void | ) | [inline, protected, virtual] |
The registered sink has flushed all samples.
This function should be implemented by the inheriting class. It will be called when all samples have been flushed in the registered sink. If it is not reimplemented, a handler must be set that handle the function call. This function is normally only called from a connected sink object.
Reimplemented in Async::AudioDebugger, Async::AudioDecoder, Async::AudioDelayLine, Async::AudioFifo, Async::AudioIO, Async::AudioMixer, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, Async::AudioStreamStateDetector, and Async::AudioValve.
Definition at line 205 of file AsyncAudioSource.h.
References handleAllSamplesFlushed().
Referenced by handleAllSamplesFlushed().
void Async::AudioSource::clearHandler | ( | void | ) | [protected] |
Clear a handler that was previously setup with setHandler.
void Async::AudioSource::handleAllSamplesFlushed | ( | void | ) | [inline] |
The registered sink has flushed all samples.
This function will be called when all samples have been flushed in the registered sink. This function is normally only called from a connected sink object.
Definition at line 174 of file AsyncAudioSource.h.
References allSamplesFlushed().
Referenced by allSamplesFlushed().
AudioSource* Async::AudioSource::handler | ( | void | ) | const [inline, protected] |
Definition at line 252 of file AsyncAudioSource.h.
bool Async::AudioSource::isRegistered | ( | void | ) | const [inline] |
Check if an audio sink has been registered.
Definition at line 148 of file AsyncAudioSource.h.
bool Async::AudioSource::registerSink | ( | AudioSink * | sink, | |
bool | managed = false | |||
) |
Register an audio sink to provide samples to.
sink | The audio sink to register | |
managed | If true, the registered sink will be destroyed when this object is destroyed. |
Referenced by Async::AudioDebugger::AudioDebugger().
virtual void Async::AudioSource::resumeOutput | ( | void | ) | [inline, virtual] |
Resume audio output to the sink.
This function must be reimplemented by the inheriting class. It will be called when the registered audio sink is ready to accept more samples. This function is normally only called from a connected sink object.
Reimplemented in Async::AudioDebugger, Async::AudioDecoder, Async::AudioDelayLine, Async::AudioFifo, Async::AudioIO, Async::AudioMixer, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, and Async::AudioValve.
Definition at line 188 of file AsyncAudioSource.h.
References resumeOutput().
Referenced by resumeOutput().
bool Async::AudioSource::setHandler | ( | AudioSource * | handler | ) | [protected] |
Setup another source to handle the outgoing audio.
handler | The source to handle the audio |
This function will setup another source to handle outgoing audio. This can be used when an internal object should handle the audio for this object.
AudioSink* Async::AudioSource::sink | ( | void | ) | const [inline] |
Get the registered audio sink.
Definition at line 155 of file AsyncAudioSource.h.
Referenced by Async::AudioDebugger::AudioDebugger().
void Async::AudioSource::sinkFlushSamples | ( | void | ) | [protected] |
bool Async::AudioSource::sinkManaged | ( | void | ) | const [inline] |
Check if the sink is managed or not.
This function is used to find out if the connected sink is managed or not. A managed sink will automatically be deleted when this source object is deleted.
Definition at line 165 of file AsyncAudioSource.h.
int Async::AudioSource::sinkWriteSamples | ( | const float * | samples, | |
int | len | |||
) | [protected] |
Referenced by Async::AudioValve::writeSamples(), Async::AudioPassthrough::writeSamples(), and Async::AudioDebugger::writeSamples().
void Async::AudioSource::unregisterSink | ( | void | ) |
Unregister the previously registered audio sink.