|
arduino-audio-tools
|
A File backed buffer which uses the provided files for buffering with the indicated max size. A file is made available for reading as soon as it reached the size limit. You must provide the files opened in "Write" mode with the addFile() method! More...
#include <Buffers.h>
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 | |
| virtual bool | resize (int bytes) |
| Resizes the buffer if supported: returns false if not supported. | |
| 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< File > | empty_files |
| int | file_count = 0 |
| void(* | file_delete_callback )(const char *filename) |
| Queue< File > | filled_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 |
A File backed buffer which uses the provided files for buffering with the indicated max size. A file is made available for reading as soon as it reached the size limit. You must provide the files opened in "Write" mode with the addFile() method!
| File | file class |
| T | buffered data type |
Provide the file size in objects!
|
inline |
RAII close the files.
add a buffer file, opened in Write mode. If it already contains any content it will be overwritten
not supported
Implements BaseBuffer< T >.
provides the number of entries that are available to read
Implements BaseBuffer< T >.
provides the number of entries that are available to write
Implements BaseBuffer< T >.
|
inlineinherited |
same as reset
Removes the next len entries.
Reimplemented in SingleBuffer< T >.
|
inlineinherited |
checks if the buffer is full
Reimplemented in NBuffer< T >, BufferRP2040T< T >, BufferRTOS< T >, SynchronizedBuffer< T >, SingleBuffer< T >, RingBuffer< T >, RingBufferFile< File, T >, and DynamicMultiBuffer< T, BufferType >.
Determines the next unique file name (after calling addFile)
peeks the actual entry from the buffer
Implements BaseBuffer< T >.
reads a single value
Implements BaseBuffer< T >.
reads multiple values
Reimplemented from BaseBuffer< T >.
clears the buffer
Implements BaseBuffer< T >.
Resizes the buffer if supported: returns false if not supported.
Reimplemented in NBuffer< T >, RingBuffer< T >, DynamicMultiBuffer< T, BufferType >, SingleBuffer< T >, RingBufferFile< File, T >, and RedisBuffer< T >.
Define the file delete operation.
Implements BaseBuffer< T >.
write add an entry to the buffer
Implements BaseBuffer< T >.
Fills the buffer data.
Reimplemented from BaseBuffer< T >.
Fills the buffer data and overwrites the oldest data if the buffer is full.