arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NBufferFile< File, T > Class Template Reference
Inheritance diagram for NBufferFile< File, T >:
BaseBuffer< T >

Public Member Functions

 NBufferFile (int fileSize)
 Provide the file size in objects!
 
 ~NBufferFile ()
 RAII close the files.
 
bool addFile (File &file)
 
T * address ()
 not supported
 
int available () override
 provides the number of entries that are available to read
 
int availableForWrite () override
 provides the number of entries that are available to write
 
void clear ()
 same as reset
 
virtual int clearArray (int len)
 Removes the next len entries.
 
void end ()
 clean up files
 
bool isEmpty ()
 
virtual bool isFull ()
 checks if the buffer is full
 
virtual float levelPercent ()
 Returns the level of the buffer in %.
 
const char * nextFileName ()
 Determines the next unique file name (after calling addFile)
 
bool peek (T &data) override
 peeks the actual entry from the buffer
 
bool read (T &result) override
 reads a single value
 
int readArray (T data[], int len) override
 reads multiple values
 
void reset ()
 clears the buffer
 
void setFileDeleteCallback (void(*cb)(const char *filename))
 Define the file delete operation.
 
size_t size () override
 
bool write (T sample) override
 write add an entry to the buffer
 
int writeArray (const T data[], int len) override
 Fills the buffer data.
 
virtual int writeArrayOverwrite (const T data[], int len)
 Fills the buffer data and overwrites the oldest data if the buffer is full.
 

Protected Member Functions

void cleanupFile (File &file)
 

Protected Attributes

File empty
 
Queue< Fileempty_files
 
int file_count = 0
 
void(* file_delete_callback )(const char *filename)
 
Queue< Filefilled_files
 
const uint16_t max_file_name = 256
 
Str next_file_name
 
int number_of_objects_per_file = 0
 
File read_file
 
File write_file
 

Member Function Documentation

◆ addFile()

template<class File , typename T >
bool addFile ( File file)
inline

add a buffer file, opened in Write mode. If it already contains any content it will be overwritten

◆ address()

template<class File , typename T >
T * address ( )
inlinevirtual

not supported

Implements BaseBuffer< T >.

◆ available()

template<class File , typename T >
int available ( )
inlineoverridevirtual

provides the number of entries that are available to read

Implements BaseBuffer< T >.

◆ availableForWrite()

template<class File , typename T >
int availableForWrite ( )
inlineoverridevirtual

provides the number of entries that are available to write

Implements BaseBuffer< T >.

◆ clearArray()

template<typename T >
virtual int clearArray ( int  len)
inlinevirtualinherited

Removes the next len entries.

Reimplemented in SingleBuffer< T >, SingleBuffer< int16_t >, and SingleBuffer< uint8_t >.

◆ isFull()

template<typename T >
virtual bool isFull ( )
inlinevirtualinherited

◆ peek()

template<class File , typename T >
bool peek ( T &  result)
inlineoverridevirtual

peeks the actual entry from the buffer

Implements BaseBuffer< T >.

◆ read()

template<class File , typename T >
bool read ( T &  result)
inlineoverridevirtual

reads a single value

Implements BaseBuffer< T >.

◆ readArray()

template<class File , typename T >
int readArray ( data[],
int  len 
)
inlineoverridevirtual

reads multiple values

Reimplemented from BaseBuffer< T >.

◆ reset()

template<class File , typename T >
void reset ( )
inlinevirtual

clears the buffer

Implements BaseBuffer< T >.

◆ size()

template<class File , typename T >
size_t size ( )
inlineoverridevirtual

Implements BaseBuffer< T >.

◆ write()

template<class File , typename T >
bool write ( data)
inlineoverridevirtual

write add an entry to the buffer

Implements BaseBuffer< T >.

◆ writeArray()

template<class File , typename T >
int writeArray ( const T  data[],
int  len 
)
inlineoverridevirtual

Fills the buffer data.

Reimplemented from BaseBuffer< T >.


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