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

◆ is_at_end()

bool MayaFlux::Kakshya::SoundStreamContainer::is_at_end ( ) const
overridevirtual

Check if read position has reached the end of the stream.

Returns
true if at or past the end of data

Useful for detecting end-of-stream in playback or streaming contexts.

Implements MayaFlux::Kakshya::StreamContainer.

Definition at line 443 of file SoundStreamContainer.cpp.

444{
445 if (m_looping_enabled) {
446 return false;
447 }
448
449 if (m_read_position.empty()) {
450 return true;
451 }
452
453 uint64_t current_frame = m_read_position[0].load();
454 return current_frame >= m_num_frames;
455}
std::vector< std::atomic< uint64_t > > m_read_position

References m_looping_enabled, m_num_frames, and m_read_position.