MayaFlux 0.5.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 390 of file SoundStreamContainer.cpp.

391{
392 if (m_looping_enabled) {
393 return false;
394 }
395
396 if (m_read_position.empty()) {
397 return true;
398 }
399
400 uint64_t current_frame = m_read_position[0].load();
401 return current_frame >= m_num_frames;
402}
std::vector< std::atomic< uint64_t > > m_read_position

References m_looping_enabled, m_num_frames, and m_read_position.