Class providing ring buffer functionality specialized for audio (most importantly multichannel functionality). More...
#include <AudioRingBuffer.hpp>
Public Member Functions | |
AudioRingBuffer (const uint numberOfFrames, const uint numberOfChannels, bool isInterleaved) | |
Creates an AudioRingBuffer instance. | |
void | clear () |
Clears all data in the audio ring buffer. | |
const uint | getAvailableFramesToProduce () const |
Returns the maximum number of frames that can be added to the audio ring buffer. | |
void | produce (const AudioBuffer< T > &sourceBuffer, const uint numberOfFrames) |
Adds frames to the audio ring buffer. | |
const uint | getAvailableFramesToConsume () const |
Returns the maximum number of items that can be read from the ring buffer. | |
void | consume (AudioBuffer< T > &destinationBuffer, const uint numberOfFrames) |
Reads items from the ring buffer. | |
Class providing ring buffer functionality specialized for audio (most importantly multichannel functionality).
AudioRingBuffer class.
switchboard::AudioRingBuffer< T >::AudioRingBuffer | ( | const uint | numberOfFrames, |
const uint | numberOfChannels, | ||
bool | isInterleaved | ||
) |
Creates an AudioRingBuffer instance.
numberOfFrames | The number of frames that the audio ring buffer can hold. |
numberOfChannels | The number of channels that the audio ring buffer can hold. |
isInterleaved | Indicates whether the audio ring buffer should hold interleaved data. |
void switchboard::AudioRingBuffer< T >::consume | ( | AudioBuffer< T > & | destinationBuffer, |
const uint | numberOfFrames | ||
) |
Reads items from the ring buffer.
destinationBuffer | [inout] The buffer where the read frames will be copied to. |
numberOfFrames | The number of frames that should be consumed. |
const uint switchboard::AudioRingBuffer< T >::getAvailableFramesToConsume |
Returns the maximum number of items that can be read from the ring buffer.
const uint switchboard::AudioRingBuffer< T >::getAvailableFramesToProduce |
Returns the maximum number of frames that can be added to the audio ring buffer.
void switchboard::AudioRingBuffer< T >::produce | ( | const AudioBuffer< T > & | sourceBuffer, |
const uint | numberOfFrames | ||
) |
Adds frames to the audio ring buffer.
sourceBuffer | The buffer where the frames are copied from. |
numberOfFrames | The number of frames that should be added to the audio ring buffer. |