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

◆ get_remaining_frames()

std::vector< uint64_t > MayaFlux::Kakshya::SoundStreamContainer::get_remaining_frames ( ) const
overridevirtual

Get the number of remaining frames from the current position, per channel.

Returns
Number of frames until end (accounting for looping)

Enables efficient buffer management and lookahead in streaming scenarios.

Implements MayaFlux::Kakshya::StreamContainer.

Definition at line 527 of file SoundStreamContainer.cpp.

528{
529 std::vector<uint64_t> frames(m_num_channels);
530 if (m_looping_enabled || m_read_position.empty()) {
531
532 for (auto& frame : frames) {
533 frame = std::numeric_limits<uint64_t>::max();
534 }
535 return frames;
536 }
537
538 for (size_t i = 0; i < frames.size(); i++) {
539 uint64_t current_frame = m_read_position[i].load();
540 frames[i] = (current_frame < m_num_frames) ? (m_num_frames - current_frame) : 0;
541 }
542 return frames;
543}
std::vector< std::atomic< uint64_t > > m_read_position

References m_looping_enabled, m_num_channels, m_num_frames, and m_read_position.