Audaspace 1.5.0
A high level audio library.
|
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality. More...
#include <Buffer.h>
Public Member Functions | |
Buffer (long long size=0) | |
Creates a new buffer. | |
~Buffer () | |
Destroys the buffer. | |
sample_t * | getBuffer () const |
Returns the pointer to the buffer in memory. | |
long long | getSize () const |
Returns the size of the buffer in bytes. | |
void | resize (long long size, bool keep=false) |
Resizes the buffer. | |
void | assureSize (long long size, bool keep=false) |
Makes sure the buffer has a minimum size. | |
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Buffer::Buffer | ( | long long | size = 0 | ) |
Creates a new buffer.
size | The size of the buffer in bytes. |
void Buffer::assureSize | ( | long long | size, |
bool | keep = false ) |
Makes sure the buffer has a minimum size.
If size is >= current size, nothing will happen. Otherwise the buffer is resized with keep as parameter.
size | The new minimum size of the buffer, measured in bytes. |
keep | Whether to keep the old data. If the new buffer is smaller, the data at the end will be lost. |
void Buffer::resize | ( | long long | size, |
bool | keep = false ) |
Resizes the buffer.
size | The new size of the buffer, measured in bytes. |
keep | Whether to keep the old data. If the new buffer is smaller, the data at the end will be lost. |