Async
1.5.0
|
An adapter class to connect to an AudioSource class using SigC. More...
#include <AsyncSigCAudioSink.h>
Public Member Functions | |
SigCAudioSink (void) | |
Default constuctor. More... | |
~SigCAudioSink (void) | |
Destructor. More... | |
virtual int | writeSamples (const float *samples, int count) |
Write samples into this audio sink. More... | |
virtual void | flushSamples (void) |
Tell the sink to flush the previously written samples. More... | |
void | resumeOutput (void) |
Tell the source that we are ready to accept more samples. More... | |
void | allSamplesFlushed (void) |
Tell the source that all samples have been flushed. More... | |
![]() | |
AudioSink (void) | |
Default constuctor. More... | |
virtual | ~AudioSink (void) |
Destructor. More... | |
bool | registerSource (AudioSource *source) |
Register an audio source to provide samples to this sink. More... | |
void | unregisterSource (void) |
Unregister the previously registered audio source. More... | |
bool | isRegistered (void) const |
Check if an audio source has been registered. More... | |
AudioSource * | source (void) const |
Get the registered audio source. More... | |
Public Attributes | |
sigc::signal< int, float *, int > | sigWriteSamples |
Signal that is emitted when the source write samples. More... | |
sigc::signal< void > | sigFlushSamples |
Signal emitted when the source are finished writing samples. More... | |
Additional Inherited Members | |
![]() | |
void | sourceResumeOutput (void) |
Tell the source that we are ready to accept more samples. More... | |
void | sourceAllSamplesFlushed (void) |
Tell the source that all samples have been flushed. More... | |
bool | setHandler (AudioSink *handler) |
Setup another sink to handle the incoming audio. More... | |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. More... | |
AudioSink * | handler (void) const |
An adapter class to connect to an AudioSource class using SigC.
This is an adapter class that can be used to interact with an AudioSource class using SigC signals and slots.
Definition at line 134 of file AsyncSigCAudioSink.h.
|
inline |
Default constuctor.
Definition at line 176 of file AsyncSigCAudioSink.h.
|
inline |
Destructor.
Definition at line 181 of file AsyncSigCAudioSink.h.
|
inline |
Tell the source that all samples have been flushed.
This function is called by the object user to indicate that all samples have been flushed. It may only be called after a flushSamples call has been received and no more samples has been written to the sink.
Definition at line 235 of file AsyncSigCAudioSink.h.
|
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. When called by the conected source, the sigFlushSamples signal will be emitted.
Reimplemented from Async::AudioSink.
Definition at line 211 of file AsyncSigCAudioSink.h.
|
inline |
Tell the source that we are ready to accept more samples.
This function should be called by the object user to indicate to the connected source that we are now ready to accept more samples.
Definition at line 222 of file AsyncSigCAudioSink.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. When called by the source, the sigWriteSamples function will be emitted.
Reimplemented from Async::AudioSink.
Definition at line 196 of file AsyncSigCAudioSink.h.
sigc::signal<void> Async::SigCAudioSink::sigFlushSamples |
Signal emitted when the source are finished writing samples.
This signal is emitted when the connected source object have finished writing samples. When done flushing, the allSamplesFlushed function should be called.
Definition at line 259 of file AsyncSigCAudioSink.h.
sigc::signal<int, float *, int> Async::SigCAudioSink::sigWriteSamples |
Signal that is emitted when the source write samples.
samples | The buffer containing the samples |
count | The number of samples in the buffer |
This signal is emitted when the connected source object write samples. If 0 is returned, the source should write no more samples until the resumeOutput function in the source have been called.
Definition at line 250 of file AsyncSigCAudioSink.h.