MayaFlux 0.2.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 394 of file SoundStreamContainer.cpp.

395{
396 if (m_read_position.size() != position.size()) {
397 m_read_position = std::vector<std::atomic<uint64_t>>(position.size());
398 }
399
400 auto wrapped_pos = wrap_position_with_loop(position, m_loop_region, m_looping_enabled);
401
402 for (size_t i = 0; i < wrapped_pos.size(); ++i) {
403 m_read_position[i].store(wrapped_pos[i]);
404 }
405}
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: