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

◆ set_read_position()

void MayaFlux::Kakshya::SoundStreamContainer::set_read_position ( const std::vector< uint64_t > &  position)
overridevirtual

Set the current read position in the primary temporal dimension per channel.

Parameters
positionPosition in the first (temporal) dimension (e.g., frame/sample index)

Enables random access and programmatic navigation within the stream.

Implements MayaFlux::Kakshya::StreamContainer.

Definition at line 392 of file SoundStreamContainer.cpp.

393{
394 if (m_read_position.size() != position.size()) {
395 m_read_position = std::vector<std::atomic<uint64_t>>(position.size());
396 }
397
398 auto wrapped_pos = wrap_position_with_loop(position, m_loop_region, m_looping_enabled);
399
400 for (size_t i = 0; i < wrapped_pos.size(); ++i) {
401 m_read_position[i].store(wrapped_pos[i]);
402 }
403}
std::vector< std::atomic< uint64_t > > m_read_position
std::vector< uint64_t > wrap_position_with_loop(const std::vector< uint64_t > &positions, const Region &loop_region, bool looping_enabled)
Wrap a position within loop boundaries if looping is enabled.

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

Referenced by set_loop_region().

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