Go to the documentation of this file.
29 #ifndef ASYNC_AUDIO_STREAM_STATE_DETECTOR_INCLUDED
30 #define ASYNC_AUDIO_STREAM_STATE_DETECTOR_INCLUDED
39 #include <sigc++/sigc++.h>
111 class AudioStreamStateDetector :
public AudioPassthrough,
public sigc::trackable
135 virtual int writeSamples(
const float *samples,
int count)
137 if (stream_state != STREAM_ACTIVE)
139 stream_state = STREAM_ACTIVE;
155 if (stream_state != STREAM_FLUSHING)
157 stream_state = STREAM_FLUSHING;
172 if (stream_state != STREAM_IDLE)
174 stream_state = STREAM_IDLE;
184 bool isIdle(
void)
const {
return (stream_state == STREAM_IDLE); }
191 bool isActive(
void)
const {
return (stream_state == STREAM_ACTIVE); }
198 bool isFlushing(
void)
const {
return (stream_state == STREAM_FLUSHING); }
214 STREAM_IDLE, STREAM_ACTIVE, STREAM_FLUSHING
217 StreamState stream_state;
virtual int writeSamples(const float *samples, int count)
Write samples into this audio sink.
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.
bool isActive(void) const
Check if the steam is active or not.
virtual ~AudioStreamStateDetector(void)
Destructor.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
virtual void flushSamples(void)
Tell the sink to flush the previously written samples.
sigc::signal< void, bool, bool > sigStreamStateChanged
A signal that is emitted when the stream state changes.
bool isFlushing(void) const
Check if the steam is flushing or not.
AudioStreamStateDetector(void)
Default constuctor.
bool isIdle(void) const
Check if the steam is idle or not.
This file contains a class that just pass the audio through.
Namespace for the asynchronous programming classes.
A class that just passes the audio through and fires an event when the stream state changes.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.