ASPiK SDK
Loading...
Searching...
No Matches
CircularBuffer< T > Class Template Reference

The CircularBuffer object implements a simple circular buffer. It uses a wrap mask to wrap the read or write index quickly. More...

#include <fxobjects.h>

Public Member Functions

void flushBuffer ()
 
void createCircularBuffer (unsigned int _bufferLength)
 
void createCircularBufferPowerOfTwo (unsigned int _bufferLengthPowerOfTwo)
 
void writeBuffer (T input)
 
readBuffer (int delayInSamples)
 
readBuffer (double delayInFractionalSamples)
 
void setInterpolate (bool b)
 

Detailed Description

template<typename T>
class CircularBuffer< T >

The CircularBuffer object implements a simple circular buffer. It uses a wrap mask to wrap the read or write index quickly.

A simple cyclic buffer: NOTE - this is NOT an IAudioSignalProcessor or IAudioSignalGenerator S must be a power of 2.

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Member Function Documentation

◆ createCircularBuffer()

template<typename T >
void CircularBuffer< T >::createCircularBuffer ( unsigned int  _bufferLength)
inline

Create a buffer based on a target maximum in SAMPLES do NOT call from realtime audio thread; do this prior to any processing

◆ createCircularBufferPowerOfTwo()

template<typename T >
void CircularBuffer< T >::createCircularBufferPowerOfTwo ( unsigned int  _bufferLengthPowerOfTwo)
inline

Create a buffer based on a target maximum in SAMPLESwhere the size is pre-calculated as a power of two

◆ flushBuffer()

template<typename T >
void CircularBuffer< T >::flushBuffer ( )
inline

flush buffer by resetting all values to 0.0

◆ readBuffer() [1/2]

template<typename T >
T CircularBuffer< T >::readBuffer ( double  delayInFractionalSamples)
inline

read an arbitrary location that includes a fractional sample

◆ readBuffer() [2/2]

template<typename T >
T CircularBuffer< T >::readBuffer ( int  delayInSamples)
inline

read an arbitrary location that is delayInSamples old

◆ setInterpolate()

template<typename T >
void CircularBuffer< T >::setInterpolate ( bool  b)
inline

enable or disable interpolation; usually used for diagnostics or in algorithms that require strict integer samples times

◆ writeBuffer()

template<typename T >
void CircularBuffer< T >::writeBuffer ( input)
inline

write a value into the buffer; this overwrites the previous oldest value in the buffer


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