30 #ifndef ASYNC_AUDIO_FIFO_INCLUDED
31 #define ASYNC_AUDIO_FIFO_INCLUDED
142 void setSize(
unsigned new_size);
148 bool empty(
void)
const {
return !is_full && (tail == head); }
158 bool full(
void)
const {
return is_full; }
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);
bool overwrite(void) const
Check the overwrite mode.
virtual void flushSamples(void)
Tell the FIFO to flush the previously written samples.
virtual void resumeOutput(void)
Resume audio output to the connected sink.
void clear(void)
Clear all samples from the FIFO.
This file contains the base class for an audio source.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
A FIFO class for handling audio samples.
void enableBuffering(bool enable)
Enable/disable the fifo buffer.
unsigned samplesInFifo(bool ignore_prebuf=false) const
Find out how many samples there are in the FIFO.
virtual ~AudioFifo(void)
Destructor.
void setPrebufSamples(unsigned prebuf_samples)
Set the number of samples that must be in the fifo before any samples are written out from it...
This file contains the base class for an audio sink.
virtual int writeSamples(const float *samples, int count)
Write samples into the FIFO.
AudioFifo(unsigned fifo_size)
Constuctor.
void setOverwrite(bool overwrite)
Set the overwrite mode.
bool empty(void) const
Check if the FIFO is empty.
The base class for an audio sink.
bool bufferingEnabled(void) const
Check if buffering is enabled or disabled.
The base class for an audio source.
void setSize(unsigned new_size)
Set the size of the FIFO.
bool full(void) const
Check if the FIFO is full.