Async 1.8.0
|
An adapter class to connect to an AudioSource class using SigC. More...
#include <AsyncSigCAudioSink.h>
Public Member Functions | |
SigCAudioSink (void) | |
Default constuctor. | |
~SigCAudioSink (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. | |
void | resumeOutput (void) |
Tell the source that we are ready to accept more samples. | |
void | allSamplesFlushed (void) |
Tell the source that all samples have been flushed. | |
![]() | |
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. | |
Public Attributes | |
sigc::signal< int, float *, int > | sigWriteSamples |
Signal that is emitted when the source write samples. | |
sigc::signal< void > | sigFlushSamples |
Signal emitted when the source are finished writing 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 |
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 114 of file AsyncSigCAudioSink.h.
|
inline |
Default constuctor.
Definition at line 120 of file AsyncSigCAudioSink.h.
|
inline |
Destructor.
Definition at line 125 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 179 of file AsyncSigCAudioSink.h.
References Async::AudioSink::sourceAllSamplesFlushed().
|
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 155 of file AsyncSigCAudioSink.h.
References sigFlushSamples.
|
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 166 of file AsyncSigCAudioSink.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. When called by the source, the sigWriteSamples function will be emitted.
Reimplemented from Async::AudioSink.
Definition at line 140 of file AsyncSigCAudioSink.h.
References sigWriteSamples.
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 203 of file AsyncSigCAudioSink.h.
Referenced by flushSamples().
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 194 of file AsyncSigCAudioSink.h.
Referenced by writeSamples().