Async 1.8.0
|
The base class for an audio source. More...
#include <AsyncAudioSource.h>
Public Member Functions | |
AudioSource (void) | |
Default constuctor. | |
virtual | ~AudioSource (void) |
Destructor. | |
bool | registerSink (AudioSink *sink, bool managed=false) |
Register an audio sink to provide samples to. | |
void | unregisterSink (void) |
Unregister the previously registered audio sink. | |
bool | isRegistered (void) const |
Check if an audio sink has been registered. | |
AudioSink * | sink (void) const |
Get the registered audio sink. | |
bool | sinkManaged (void) const |
Check if the sink is managed or not. | |
void | handleAllSamplesFlushed (void) |
The registered sink has flushed all samples. | |
virtual void | resumeOutput (void) |
Resume audio output to the sink. | |
Protected Member Functions | |
virtual void | allSamplesFlushed (void) |
The registered sink has flushed all samples. | |
int | sinkWriteSamples (const float *samples, int len) |
void | sinkFlushSamples (void) |
bool | setHandler (AudioSource *handler) |
Setup another source to handle the outgoing audio. | |
AudioSource * | handler (void) const |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
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.
|
inline |
Default constuctor.
Definition at line 120 of file AsyncAudioSource.h.
|
virtual |
Destructor.
|
inlineprotectedvirtual |
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::AudioGenerator, Async::AudioIO, Async::AudioJitterFifo, Async::AudioMixer, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, Async::AudioSelector, Async::AudioStreamStateDetector, Async::AudioValve, and Async::SigCAudioSource.
Definition at line 206 of file AsyncAudioSource.h.
References handleAllSamplesFlushed().
Referenced by handleAllSamplesFlushed().
|
protected |
Clear a handler that was previously setup with setHandler.
|
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 175 of file AsyncAudioSource.h.
References allSamplesFlushed().
Referenced by allSamplesFlushed().
|
inlineprotected |
Definition at line 253 of file AsyncAudioSource.h.
|
inline |
Check if an audio sink has been registered.
Definition at line 149 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().
|
inlinevirtual |
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::AudioGenerator, Async::AudioIO, Async::AudioJitterFifo, Async::AudioMixer, Async::AudioPacer, Async::AudioPassthrough, Async::AudioProcessor, Async::AudioSelector, Async::AudioValve, and Async::SigCAudioSource.
Definition at line 189 of file AsyncAudioSource.h.
References resumeOutput().
Referenced by resumeOutput().
|
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.
|
inline |
Get the registered audio sink.
Definition at line 156 of file AsyncAudioSource.h.
Referenced by Async::AudioDebugger::AudioDebugger().
|
protected |
Referenced by Async::AudioGenerator::enable(), Async::AudioDecoder::flushEncodedSamples(), Async::AudioDebugger::flushSamples(), Async::AudioPassthrough::flushSamples(), Async::AudioValve::flushSamples(), Async::SigCAudioSource::flushSamples(), and Async::AudioValve::setOpen().
|
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 166 of file AsyncAudioSource.h.
|
protected |
void Async::AudioSource::unregisterSink | ( | void | ) |
Unregister the previously registered audio sink.