SoundFontInfoLib
2.21.6
Library for parsing and rendering SF2 files
|
Circular buffer that acts as a delay for samples. More...
#include <DelayBuffer.hpp>
Public Member Functions | |
DelayBuffer (double sizeInSamples) | |
Construct new buffer. More... | |
void | clear () |
Clear the buffer by setting all entries to zero. More... | |
void | setSizeInSamples (double sizeInSamples) |
Resize the buffer. More... | |
void | write (T value) |
Place a sample in the buffer, overwriting the oldest. More... | |
size_t | size () const |
Obtain the size of the buffer. More... | |
T | readFromOffset (int offset) const |
Read the value at the given offset from the newest value. More... | |
T | read (double delay) const |
Read the value at the given offset from the newest value. More... | |
Circular buffer that acts as a delay for samples.
|
inline |
Construct new buffer.
sizeInSamples | number of samples to hold in the buffer |
References SF2::Render::DelayBuffer< T >::clear().
|
inline |
Clear the buffer by setting all entries to zero.
Referenced by SF2::Render::DelayBuffer< T >::DelayBuffer(), and SF2::Render::DelayBuffer< T >::setSizeInSamples().
|
inline |
Read the value at the given offset from the newest value.
delay | the offset from the most recently written sample |
References SF2::Render::DelayBuffer< T >::readFromOffset().
|
inline |
Read the value at the given offset from the newest value.
offset | the offset from the most recently written sample |
Referenced by SF2::Render::DelayBuffer< T >::read().
|
inline |
Resize the buffer.
sizeInSamples | new number of samples to hold |
References SF2::Render::DelayBuffer< T >::clear().
|
inline |
Obtain the size of the buffer.
|
inline |
Place a sample in the buffer, overwriting the oldest.
value | the value to write |