30#ifndef ASYNC_AUDIO_FIFO_INCLUDED
31#define ASYNC_AUDIO_FIFO_INCLUDED
148 bool empty(
void)
const {
return !is_full && (tail == head); }
158 bool full(
void)
const {
return is_full; }
278 unsigned prebuf_samples;
282 bool buffering_enabled;
283 bool disable_buffering_when_flushed;
287 void writeSamplesFromFifo(
void);
This file contains the base class for an audio sink.
This file contains the base class for an audio source.
A FIFO class for handling audio samples.
void clear(void)
Clear all samples from the FIFO.
AudioFifo(unsigned fifo_size)
Constuctor.
bool full(void) const
Check if the FIFO is full.
void setSize(unsigned new_size)
Set the size of the FIFO.
bool empty(void) const
Check if the FIFO is empty.
void setOverwrite(bool overwrite)
Set the overwrite mode.
virtual int writeSamples(const float *samples, int count)
Write samples into the FIFO.
virtual void resumeOutput(void)
Resume audio output to the connected sink.
bool overwrite(void) const
Check the overwrite mode.
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.
virtual void allSamplesFlushed(void)
The registered sink has flushed all samples.
bool bufferingEnabled(void) const
Check if buffering is enabled or disabled.
virtual ~AudioFifo(void)
Destructor.
unsigned samplesInFifo(bool ignore_prebuf=false) const
Find out how many samples there are in the FIFO.
The base class for an audio sink.
The base class for an audio source.
Namespace for the asynchronous programming classes.