arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::SingleBuffer< T > Class Template Reference

A simple Buffer implementation which just uses a (dynamically sized) array. More...

#include <Buffers.h>

Inheritance diagram for audio_tools::SingleBuffer< T >:
audio_tools::BaseBuffer< T >

Public Member Functions

 SingleBuffer ()
 Construct a new Single Buffer w/o allocating any memory. More...
 
 SingleBuffer (int size)
 Construct a new Single Buffer object. More...
 
T * address ()
 
int available ()
 
int availableToWrite ()
 
bool isFull ()
 
void onExternalBufferRefilled (void *data, int len)
 notifies that the external buffer has been refilled
 
peek ()
 
read ()
 
void reset ()
 
void setAvailable (size_t available_size)
 If we load values directly into the address we need to set the avialeble size.
 
size_t size ()
 
bool write (T sample)
 
- Public Member Functions inherited from audio_tools::BaseBuffer< T >
bool isEmpty ()
 
int readArray (T data[], int len)
 
int readFrames (T data[][2], int len)
 
template<int rows, int channels>
int readFrames (T(&data)[rows][channels])
 
int writeArray (const T data[], int len)
 

Protected Member Functions

void setWritePos (int pos)
 
- Protected Member Functions inherited from audio_tools::BaseBuffer< T >
void setWritePos (int pos)
 

Protected Attributes

T * buffer = nullptr
 
int current_read_pos =0
 
int current_write_pos =0
 
int max_size =0
 
bool owns_buffer = true
 
- Protected Attributes inherited from audio_tools::BaseBuffer< T >
friend NBuffer< T >
 

Detailed Description

template<typename T>
class audio_tools::SingleBuffer< T >

A simple Buffer implementation which just uses a (dynamically sized) array.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ SingleBuffer() [1/2]

template<typename T >
audio_tools::SingleBuffer< T >::SingleBuffer ( int  size)
inline

Construct a new Single Buffer object.

Parameters
size

◆ SingleBuffer() [2/2]

template<typename T >
audio_tools::SingleBuffer< T >::SingleBuffer ( )
inline

Construct a new Single Buffer w/o allocating any memory.

Parameters
data
size
len

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