Async 1.8.0
Async::SigCAudioSink Class Reference

An adapter class to connect to an AudioSource class using SigC. More...

#include <AsyncSigCAudioSink.h>

Inheritance diagram for Async::SigCAudioSink:
Async::AudioSink

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.
 
- Public Member Functions inherited from Async::AudioSink
 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.
 
AudioSourcesource (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

- Protected Member Functions inherited from Async::AudioSink
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.
 
AudioSinkhandler (void) const
 

Detailed Description

An adapter class to connect to an AudioSource class using SigC.

Author
Tobias Blomberg
Date
2005-04-17

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.

Constructor & Destructor Documentation

◆ SigCAudioSink()

Async::SigCAudioSink::SigCAudioSink ( void )
inline

Default constuctor.

Definition at line 120 of file AsyncSigCAudioSink.h.

◆ ~SigCAudioSink()

Async::SigCAudioSink::~SigCAudioSink ( void )
inline

Destructor.

Definition at line 125 of file AsyncSigCAudioSink.h.

Member Function Documentation

◆ allSamplesFlushed()

void Async::SigCAudioSink::allSamplesFlushed ( void )
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().

◆ flushSamples()

virtual void Async::SigCAudioSink::flushSamples ( void )
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.

◆ resumeOutput()

void Async::SigCAudioSink::resumeOutput ( void )
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().

◆ writeSamples()

virtual int Async::SigCAudioSink::writeSamples ( const float * samples,
int count )
inlinevirtual

Write samples into this audio sink.

Parameters
samplesThe buffer containing the samples
countThe number of samples in the buffer
Returns
Returns the number of samples that has been taken care of

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.

Member Data Documentation

◆ sigFlushSamples

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().

◆ sigWriteSamples

sigc::signal<int, float *, int> Async::SigCAudioSink::sigWriteSamples

Signal that is emitted when the source write samples.

Parameters
samplesThe buffer containing the samples
countThe number of samples in the buffer
Returns
Returns the number of samples that has been taken care of

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().


The documentation for this class was generated from the following file: