Go to the documentation of this file.
30 #ifndef ASYNC_AUDIO_FIFO_INCLUDED
31 #define ASYNC_AUDIO_FIFO_INCLUDED
119 class AudioFifo :
public AudioSink,
public AudioSource
142 void setSize(
unsigned new_size);
148 bool empty(
void)
const {
return !is_full && (tail == head); }
158 bool full(
void)
const {
return is_full; }
193 bool overwrite(
void)
const {
return do_overwrite; }
240 virtual int writeSamples(
const float *samples,
int count);
278 unsigned prebuf_samples;
282 bool buffering_enabled;
283 bool disable_buffering_when_flushed;
287 void writeSamplesFromFifo(
void);
void clear(void)
Clear all samples from the FIFO.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
void enableBuffering(bool enable)
Enable/disable the fifo buffer.
virtual void flushSamples(void)
Tell the FIFO to flush the previously written samples.
void setPrebufSamples(unsigned prebuf_samples)
Set the number of samples that must be in the fifo before any samples are written out from it.
bool full(void) const
Check if the FIFO is full.
virtual void resumeOutput(void)
Resume audio output to the connected sink.
bool overwrite(void) const
Check the overwrite mode.
virtual int writeSamples(const float *samples, int count)
Write samples into the FIFO.
unsigned samplesInFifo(bool ignore_prebuf=false) const
Find out how many samples there are in the FIFO.
bool empty(void) const
Check if the FIFO is empty.
virtual ~AudioFifo(void)
Destructor.
AudioFifo(unsigned fifo_size)
Constuctor.
void setOverwrite(bool overwrite)
Set the overwrite mode.
void setSize(unsigned new_size)
Set the size of the FIFO.
bool bufferingEnabled(void) const
Check if buffering is enabled or disabled.
Namespace for the asynchronous programming classes.
This file contains the base class for an audio sink.
This file contains the base class for an audio source.