|
arduino-audio-tools
|
RAM-backed like RamSampleTableStore, but grows by allocating additional fixed-size chunks instead of reallocating and copying one single growing array. More...
#include <SampleTableStore.h>


Public Member Functions | |
| ~ChunkedSampleTableStore () | |
| void | append (T value) override |
| Appends one entry - call in file order, once per table entry. | |
| void | clear () override |
| Resets to empty - call once per begin()/track. | |
| T | get (size_t index) override |
| Reads back entry 'index' - index must be < size(). | |
| virtual void | setNextEntryOffset (uint64_t fileOffset) |
| virtual void | setOnDiskEntrySize (size_t bytes) |
| size_t | size () override |
| Number of entries appended so far. | |
Protected Attributes | |
| Vector< T * > | chunks |
| size_t | count = 0 |
RAM-backed like RamSampleTableStore, but grows by allocating additional fixed-size chunks instead of reallocating and copying one single growing array.
This project's Vector<T>::push_back() (AudioBasic/Collections/Vector.h) allocates exactly the new size on every growth, with no spare capacity
This store sidesteps that by keeping a Vector of chunk pointers rather than a Vector of T directly: growing by one chunk means appending one more pointer (cheap - the pointer vector itself stays tiny, e.g. ~70 pointers for 288K entries at the default chunk size) and allocating a fresh fixed-size block, without ever touching or copying any previously-appended data. Same total memory as RamSampleTableStore, but O(1) amortized append instead of O(N) - the same idea behind this project's DynamicMultiBuffer (AudioTools/Sandbox/DynamicMultiBuffer.h), reimplemented directly here rather than wrapped: that class's public API is a sequential read()/write() cursor, not the indexed get() ChunkedSampleTableStore needs, and as Sandbox-status code it's not something to take a hard dependency on from a container decoder.
|
inline |
|
inlineoverridevirtual |
Appends one entry - call in file order, once per table entry.
Implements SampleTableStore< T >.
|
inlineoverridevirtual |
Resets to empty - call once per begin()/track.
Implements SampleTableStore< T >.
Reads back entry 'index' - index must be < size().
Implements SampleTableStore< T >.
|
inlinevirtualinherited |
Only meaningful for SourceSeekSampleTableStore: the absolute byte offset (from the start of the original MP4 file) of the entry about to be appended next. Default no-op - other implementations ignore it, so callers can always call this unconditionally before append() without needing to know which implementation is active.
Reimplemented in SourceSeekSampleTableStore< T >.
|
inlinevirtualinherited |
Only meaningful for SourceSeekSampleTableStore, and only for tables whose on-disk width isn't a fixed sizeof(T) - see its comment. Default no-op.
Reimplemented in SourceSeekSampleTableStore< T >.
Number of entries appended so far.
Implements SampleTableStore< T >.