Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Buffer Class Reference

This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality. More...

#include <Buffer.h>

Inheritance diagram for Buffer:
Inheritance graph
[legend]

Public Member Functions

 Buffer (long long size=0)
 Creates a new buffer.
 
 ~Buffer ()
 Destroys the buffer.
 
sample_tgetBuffer () 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.
 

Detailed Description

This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.

Constructor & Destructor Documentation

◆ Buffer()

Buffer::Buffer ( long long size = 0)

Creates a new buffer.

Parameters
sizeThe size of the buffer in bytes.

Member Function Documentation

◆ assureSize()

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.

Parameters
sizeThe new minimum size of the buffer, measured in bytes.
keepWhether to keep the old data. If the new buffer is smaller, the data at the end will be lost.

◆ resize()

void Buffer::resize ( long long size,
bool keep = false )

Resizes the buffer.

Parameters
sizeThe new size of the buffer, measured in bytes.
keepWhether to keep the old data. If the new buffer is smaller, the data at the end will be lost.

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