Ring buffer for delays. More...
#include <Radiant/RingBuffer.hpp>
Public Member Functions | |
| void | advance () |
| Advance the counter by one. | |
| void | advanceN (unsigned nSteps) |
| Advance the counter by given number of steps. More... | |
| TElem & | getNewest (unsigned nDelay) |
| Get a sample from the buffer. More... | |
| const TElem & | getNewest (unsigned nDelay) const |
| Get a sample from the buffer. More... | |
| TElem & | getNewest () |
| Get the newest sample from the buffer. | |
| const TElem & | getNewestConst (unsigned nDelay) const |
| Get a sample from the buffer. More... | |
| const TElem & | getNewestConst () const |
| Get a sample from the buffer. More... | |
| unsigned | getSampleCount () const |
| Returns the number of samples processed. More... | |
| void | put (const TElem &v) |
| Advance the delay line and set the "newest" sample. More... | |
| void | reset () |
| Reset the buffer. | |
| RingBufferDelay () | |
| Construct an empty buffer. | |
| RingBufferDelay (unsigned size) | |
| Construct a new buffer and initializes it to the given size. More... | |
| void | setSampleCount (unsigned int nCount) |
| Sets the number of samples processed. More... | |
| unsigned | sizeOf () const |
| Get memory usage in bytes. More... | |
| virtual | ~RingBufferDelay () |
| Destructor. | |
Public Member Functions inherited from Radiant::RingBuffer< TElem > | |
| TElem * | data () |
| Get a raw pointer to data. More... | |
| const TElem * | data () const |
| Get a raw pointer to data. More... | |
| int | elemSize () const |
| Get the size of a sample in bytes. More... | |
| TElem & | getIndex (unsigned nIndex) |
| Get a sample from the buffer. More... | |
| const TElem & | getIndex (unsigned nIndex) const |
| Get a sample from the buffer. More... | |
| const TElem & | getIndexConst (unsigned nIndex) const |
| Get a sample from the buffer. More... | |
| unsigned | mask () const |
| Report mask used for address translation. More... | |
| RingBuffer< TElem > & | operator= (const RingBuffer &xrBuffer) |
| Deep copy operator. More... | |
| TElem & | operator[] (unsigned nIndex) |
| Get the sample with the given index. More... | |
| const TElem & | operator[] (unsigned nIndex) const |
| Get the sample with the given index. More... | |
| bool | resize (unsigned nBufSize) |
| Resize the buffer. More... | |
| RingBuffer () | |
| Create an empty ring buffer. | |
| RingBuffer (unsigned nSize) | |
| Create a ring-buffer with given minimum size. More... | |
| RingBuffer (const RingBuffer &xrBuffer) | |
| Create a deep copy. More... | |
| void | setAll (TElem xVal) |
| Set all buffer values. More... | |
| void | setIndex (unsigned nIndex, const TElem &xVal) |
| Set a sample of the buffer. More... | |
| unsigned | size () const |
| Get buffer size. More... | |
| unsigned | sizeOf () const |
| Get buffer size in bytes. More... | |
| virtual | ~RingBuffer () |
| Destroy the ring-buffer and free memory. | |
Protected Attributes | |
| unsigned | m_position |
| The current position in the buffer. | |
Protected Attributes inherited from Radiant::RingBuffer< TElem > | |
| TElem * | m_line |
| Data buffer. | |
| unsigned | m_mask |
| Mask for determining index. | |
| unsigned | m_size |
| Real size. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Radiant::RingBuffer< TElem > | |
| static unsigned | targetSize (unsigned nBufSize) |
| Calculate the real size of the buffer if the required number of samples is nBufSize. More... | |
Ring buffer for delays.
This sublass if RingBuffer introduces a sample counter that is used to calculate delays.
|
inline |
Construct a new buffer and initializes it to the given size.
| size | buffer size in samples |
|
inline |
Advance the counter by given number of steps.
| nSteps | number of steps to advance |
|
inline |
Get a sample from the buffer.
| nDelay | delay in samples |
|
inline |
Get a sample from the buffer.
| nDelay | delay in samples |
|
inline |
Get a sample from the buffer.
| nDelay | delay in samples |
|
inline |
Get a sample from the buffer.
| nDelay | delay in samples |
|
inline |
Returns the number of samples processed.
|
inline |
Advance the delay line and set the "newest" sample.
| v | newest sample to set |
|
inline |
Sets the number of samples processed.
| nCount | number of samples |
|
inline |
Get memory usage in bytes.