Async 1.8.0
|
A class that just passes the audio through and fires an event when the stream state changes. More...
#include <AsyncAudioStreamStateDetector.h>
Public Member Functions | |
AudioStreamStateDetector (void) | |
Default constuctor. | |
virtual | ~AudioStreamStateDetector (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 | allSamplesFlushed (void) |
The registered sink has flushed all samples. | |
bool | isIdle (void) const |
Check if the steam is idle or not. | |
bool | isActive (void) const |
Check if the steam is active or not. | |
bool | isFlushing (void) const |
Check if the steam is flushing or not. | |
![]() | |
AudioPassthrough (void) | |
Default constuctor. | |
virtual | ~AudioPassthrough (void) |
Destructor. | |
virtual void | resumeOutput (void) |
Resume audio output to the sink. | |
![]() | |
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. | |
Public Attributes | |
sigc::signal< void, bool, bool > | sigStreamStateChanged |
A signal that is emitted when the stream state changes. | |
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. | |
A class that just passes the audio through and fires an event when the stream state changes.
Definition at line 111 of file AsyncAudioStreamStateDetector.h.
|
inline |
Default constuctor.
Definition at line 117 of file AsyncAudioStreamStateDetector.h.
|
inlinevirtual |
Destructor.
Definition at line 122 of file AsyncAudioStreamStateDetector.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::AudioPassthrough.
Definition at line 170 of file AsyncAudioStreamStateDetector.h.
References Async::AudioPassthrough::allSamplesFlushed(), and sigStreamStateChanged.
|
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::AudioPassthrough.
Definition at line 153 of file AsyncAudioStreamStateDetector.h.
References Async::AudioPassthrough::flushSamples(), and sigStreamStateChanged.
|
inline |
Check if the steam is active or not.
Definition at line 191 of file AsyncAudioStreamStateDetector.h.
|
inline |
Check if the steam is flushing or not.
Definition at line 198 of file AsyncAudioStreamStateDetector.h.
|
inline |
Check if the steam is idle or not.
Definition at line 184 of file AsyncAudioStreamStateDetector.h.
|
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::AudioPassthrough.
Definition at line 135 of file AsyncAudioStreamStateDetector.h.
References sigStreamStateChanged, and Async::AudioPassthrough::writeSamples().
sigc::signal<void, bool, bool> Async::AudioStreamStateDetector::sigStreamStateChanged |
A signal that is emitted when the stream state changes.
is_active | Is true if the stream is active |
is_idle | Is true if the stream is idle |
Definition at line 205 of file AsyncAudioStreamStateDetector.h.
Referenced by allSamplesFlushed(), flushSamples(), and writeSamples().