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

◆ advance_read_position()

void MayaFlux::Kakshya::SoundStreamContainer::advance_read_position ( const std::vector< uint64_t > &  frames)
overridevirtual

Advance the read position by a specified amount.

Parameters
framesNumber of frames to advance
Note
Should handle looping if enabled

Supports efficient sequential access and playback scenarios.

Implements MayaFlux::Kakshya::StreamContainer.

Definition at line 424 of file SoundStreamContainer.cpp.

425{
426 if (frames.empty())
427 return;
428
429 std::vector<uint64_t> current_pos(m_read_position.size());
430 for (size_t i = 0; i < m_read_position.size(); ++i) {
431 current_pos[i] = m_read_position[i].load();
432 }
433
434 auto new_pos = advance_position(current_pos, frames, m_structure, m_looping_enabled, m_loop_region);
435
436 for (size_t i = 0; i < new_pos.size() && i < m_read_position.size(); ++i) {
437 m_read_position[i].store(new_pos[i]);
438 }
439}
std::vector< std::atomic< uint64_t > > m_read_position
std::vector< uint64_t > advance_position(const std::vector< uint64_t > &current_positions, uint64_t frames_to_advance, const ContainerDataStructure &structure, bool looping_enabled, const Region &loop_region)
Advance current positions by a number of frames, with optional looping.

References MayaFlux::Kakshya::advance_position(), m_loop_region, m_looping_enabled, m_read_position, and m_structure.

Referenced by read_sequential().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: