MayaFlux 0.4.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 319 of file DynamicSoundStream.cpp.

320{
321 ensure_capacity(capacity);
322
323 Region circular_region {
324 { 0, 0 },
325 { capacity - 1, get_num_channels() - 1 }
326 };
327
328 set_loop_region(circular_region);
329 set_looping(true);
330
331 m_circular_capacity = capacity;
332 m_is_circular = true;
333}
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: