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

◆ initialize_state()

bool MayaFlux::Vruta::SoundRoutine::initialize_state ( uint64_t  current_context = 0U)
overridevirtual

Initializes the coroutine's state for execution.

Parameters
current_sampleCurrent sample position in the timeline
Returns
True if initialization succeeded, false otherwise

Prepares the coroutine for execution by setting its initial sample position and other state. This should be called before the first attempt to resume the coroutine.

Implements MayaFlux::Vruta::Routine.

Definition at line 87 of file Routine.cpp.

88{
89 if (!m_handle || !m_handle.address() || m_handle.done()) {
90 return false;
91 }
92
93 m_handle.promise().next_sample = current_sample;
94 m_handle.promise().next_buffer_cycle = current_sample;
95 m_handle.resume();
96 return true;
97}
std::coroutine_handle< promise_type > m_handle
Handle to the underlying coroutine.
Definition Routine.hpp:460

References m_handle.

Referenced by try_resume_with_context().

+ Here is the caller graph for this function: