Async 1.8.0
|
This class just let the audio pass through. More...
#include <AsyncAudioPassthrough.h>
Public Member Functions | |
AudioPassthrough (void) | |
Default constuctor. | |
virtual | ~AudioPassthrough (void) |
Destructor. | |
virtual int | writeSamples (const float *samples, int count) |
Write samples into this audio sink. | |
virtual void | flushSamples (void) |
Tell the sink to flush the previously written samples. | |
virtual void | resumeOutput (void) |
Resume audio output to the sink. | |
virtual void | allSamplesFlushed (void) |
The registered sink has flushed all samples. | |
![]() | |
AudioSink (void) | |
Default constuctor. | |
virtual | ~AudioSink (void) |
Destructor. | |
bool | registerSource (AudioSource *source) |
Register an audio source to provide samples to this sink. | |
void | unregisterSource (void) |
Unregister the previously registered audio source. | |
bool | isRegistered (void) const |
Check if an audio source has been registered. | |
AudioSource * | source (void) const |
Get the registered audio source. | |
![]() | |
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. | |
Additional Inherited Members | |
![]() | |
void | sourceResumeOutput (void) |
Tell the source that we are ready to accept more samples. | |
void | sourceAllSamplesFlushed (void) |
Tell the source that all samples have been flushed. | |
bool | setHandler (AudioSink *handler) |
Setup another sink to handle the incoming audio. | |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
AudioSink * | handler (void) const |
![]() | |
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. | |
This class just let the audio pass through.
This class is both a source and a sink and just let the audio pass through. It can be used standalone but maybe is of more use when inheriting from it. For example if you want to snoop in on an audio streem without affecting it, just reimplement the writeSamples method and you have access to the samples. Just remember to call the sinkWriteSamples method to forward the samples.
Definition at line 117 of file AsyncAudioPassthrough.h.
|
inline |
Default constuctor.
Definition at line 123 of file AsyncAudioPassthrough.h.
|
inlinevirtual |
Destructor.
Definition at line 128 of file AsyncAudioPassthrough.h.
|
inlinevirtual |
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.
Reimplemented from Async::AudioSource.
Reimplemented in Async::AudioStreamStateDetector.
Definition at line 178 of file AsyncAudioPassthrough.h.
References Async::AudioSink::sourceAllSamplesFlushed().
Referenced by Async::AudioStreamStateDetector::allSamplesFlushed().
|
inlinevirtual |
Tell the sink to flush the previously written samples.
This function is used to tell the sink to flush previously written samples. When done flushing, the sink should call the sourceAllSamplesFlushed function. This function is normally only called from a connected source object.
Reimplemented from Async::AudioSink.
Reimplemented in Async::AudioStreamStateDetector.
Definition at line 154 of file AsyncAudioPassthrough.h.
References Async::AudioSource::sinkFlushSamples().
Referenced by Async::AudioStreamStateDetector::flushSamples().
|
inlinevirtual |
Resume audio output to the sink.
This function 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 from Async::AudioSource.
Definition at line 166 of file AsyncAudioPassthrough.h.
References Async::AudioSink::sourceResumeOutput().
|
inlinevirtual |
Write samples into this audio sink.
samples | The buffer containing the samples |
count | The number of samples in the buffer |
This function is used to write audio into this audio sink. If it returns 0, no more samples should be written until the resumeOutput function in the source have been called. This function is normally only called from a connected source object.
Reimplemented from Async::AudioSink.
Reimplemented in Async::AudioStreamStateDetector.
Definition at line 141 of file AsyncAudioPassthrough.h.
References Async::AudioSource::sinkWriteSamples().
Referenced by Async::AudioStreamStateDetector::writeSamples().