MayaFlux 0.5.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 290 of file DynamicSoundStream.cpp.

291{
292 ensure_capacity(capacity);
293
294 Region circular_region {
295 { 0, 0 },
296 { capacity - 1, get_num_channels() - 1 }
297 };
298
299 set_loop_region(circular_region);
300 set_looping(true);
301
302 m_circular_capacity = capacity;
303 m_is_circular = true;
304}
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: