Class thl::dsp::audio::AudioDataStore#
-
class AudioDataStore#
RT-safe single-buffered audio data storage with CAS state machine.
Uses a three-state atomic (Idle, Reading, Loading) to coordinate between the RT thread and a loader thread with minimal memory overhead.
RT thread: CAS(Idle→READING) to read, store(Idle) when done. If CAS fails (loader active), output silence for that block. Loader: Spin CAS(Idle→Loading), move data in, store(Idle).
Public Functions
-
AudioDataStore() = default#
-
inline bool begin_read()#
-
inline void end_read()#
-
inline const std::vector<BufferF> &get_buffer() const#
-
inline bool is_loaded() const#
-
inline int get_root_note() const#
-
inline uint32_t get_load_generation() const#
-
inline std::vector<BufferF> &begin_load()#
-
inline void commit_load(int root_note)#
-
AudioDataStore() = default#