MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ enable_circular_buffer()

void MayaFlux::Kakshya::DynamicSoundStream::enable_circular_buffer ( uint64_t  capacity)

Enable circular buffer mode with fixed capacity.

Writes wrap around at capacity boundary, potentially overwriting older data.

Parameters
capacityFixed number of frames the circular buffer can hold

Definition at line 316 of file DynamicSoundStream.cpp.

317{
318 ensure_capacity(capacity);
319
320 Region circular_region {
321 { 0, 0 },
322 { capacity - 1, get_num_channels() - 1 }
323 };
324
325 set_loop_region(circular_region);
326 set_looping(true);
327
328 m_circular_capacity = capacity;
329 m_is_circular = true;
330}
bool m_is_circular
True when operating in circular buffer mode.
void ensure_capacity(uint64_t required_frames)
Pre-allocate capacity for the specified number of frames.
uint64_t m_circular_capacity
Fixed capacity for circular mode.
void set_looping(bool enable) override
Enable or disable looping behavior for the stream.
void set_loop_region(const Region &region) override
Set the loop region using a Region.

References ensure_capacity(), MayaFlux::Kakshya::SoundStreamContainer::get_num_channels(), m_circular_capacity, m_is_circular, MayaFlux::Kakshya::SoundStreamContainer::set_loop_region(), and MayaFlux::Kakshya::SoundStreamContainer::set_looping().

+ Here is the call graph for this function: