43 volatile size_t m_read;
46 volatile size_t m_write;
49 RingBuffer(
const RingBuffer&) =
delete;
50 RingBuffer& operator=(
const RingBuffer&) =
delete;
74 size_t getReadSize()
const;
76 size_t getWriteSize()
const;
78 size_t read(
data_t* target,
size_t size);
80 size_t write(
data_t* source,
size_t size);
The main header file of the library defining the namespace and basic data types.
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
float sample_t
Sample type.(float samples).
Definition Audaspace.h:126
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
unsigned char data_t
Sample data type (format samples).
Definition Audaspace.h:129
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition Buffer.h:34
RingBuffer(int size=0)
Creates a new ring buffer.
void reset()
Resets the ring buffer to a state where nothing has been written or read.
const sample_t * getBuffer() const
Returns the pointer to the ring buffer in memory.
int getSize() const
Returns the size of the ring buffer in bytes.
void assureSize(int size)
Makes sure the ring buffer has a minimum size.
sample_t * getBuffer()
Returns the pointer to the ring buffer in memory.
void resize(int size)
Resizes the ring buffer.