Gin
Public Member Functions | List of all members
AudioFifo Class Reference

FIFO - stuff audio in one end and it pops out the other. More...

Public Member Functions

 AudioFifo (int channels=2, int numSamples=128)
 
void setSize (int numChannels, int numSamples)
 
int getNumChannels () const noexcept
 
int getFreeSpace () const noexcept
 
int getNumReady () const noexcept
 
void reset () noexcept
 
void ensureFreeSpace (int numSamples)
 
bool write (const juce::AudioSampleBuffer &src, int numSamples=-1)
 
bool write (const float *const *data, int numSamples)
 
bool writeMono (const float *data, int numSamples)
 
bool read (juce::AudioSampleBuffer &dest)
 
bool read (juce::AudioSampleBuffer &dest, int startSampleInDestBuffer, int numSamples)
 
bool readMono (float *data, int numSamples)
 
bool readAdding (juce::AudioSampleBuffer &dest)
 
bool readAdding (juce::AudioSampleBuffer &dest, int startSampleInDestBuffer, int numSamples)
 

Detailed Description

FIFO - stuff audio in one end and it pops out the other.

Lock free for single producer / consumer

Constructor & Destructor Documentation

◆ AudioFifo()

AudioFifo::AudioFifo ( int  channels = 2,
int  numSamples = 128 
)

Member Function Documentation

◆ setSize()

void AudioFifo::setSize ( int  numChannels,
int  numSamples 
)

◆ getNumChannels()

int AudioFifo::getNumChannels ( ) const
noexcept

◆ getFreeSpace()

int AudioFifo::getFreeSpace ( ) const
noexcept

Referenced by ensureFreeSpace(), write(), and writeMono().

◆ getNumReady()

int AudioFifo::getNumReady ( ) const
noexcept

◆ reset()

void AudioFifo::reset ( )
noexcept

◆ ensureFreeSpace()

void AudioFifo::ensureFreeSpace ( int  numSamples)

References getFreeSpace(), and getNumReady().

◆ write() [1/2]

bool AudioFifo::write ( const juce::AudioSampleBuffer &  src,
int  numSamples = -1 
)

◆ write() [2/2]

bool AudioFifo::write ( const float *const *  data,
int  numSamples 
)

References getFreeSpace().

◆ writeMono()

bool AudioFifo::writeMono ( const float *  data,
int  numSamples 
)

References getFreeSpace().

◆ read() [1/2]

bool AudioFifo::read ( juce::AudioSampleBuffer &  dest)

◆ read() [2/2]

bool AudioFifo::read ( juce::AudioSampleBuffer &  dest,
int  startSampleInDestBuffer,
int  numSamples 
)

References getNumReady().

◆ readMono()

bool AudioFifo::readMono ( float *  data,
int  numSamples 
)

References getNumReady().

◆ readAdding() [1/2]

bool AudioFifo::readAdding ( juce::AudioSampleBuffer &  dest)

◆ readAdding() [2/2]

bool AudioFifo::readAdding ( juce::AudioSampleBuffer &  dest,
int  startSampleInDestBuffer,
int  numSamples 
)

References getNumReady().


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