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

◆ get_clock() [2/2]

const IClock & MayaFlux::Vruta::TaskScheduler::get_clock ( ProcessingToken  token = ProcessingToken::SAMPLE_ACCURATE) const

Get the clock for a specific processing domain.

Parameters
tokenProcessing domain
Returns
Reference to the domain's clock, or audio clock if token not found

Definition at line 363 of file Scheduler.cpp.

364{
365 auto clock_it = m_token_clocks.find(token);
366 if (clock_it != m_token_clocks.end()) {
367 return *clock_it->second;
368 }
369
370 auto audio_clock_it = m_token_clocks.find(ProcessingToken::SAMPLE_ACCURATE);
371 if (audio_clock_it != m_token_clocks.end()) {
372 return *audio_clock_it->second;
373 }
374
375 error<std::runtime_error>(Journal::Component::Vruta, Journal::Context::CoroutineScheduling, std::source_location::current(),
376 "No clock found for token {}, and no sample-accurate clock available as fallback", static_cast<int>(token));
377}
std::unordered_map< ProcessingToken, std::shared_ptr< IClock > > m_token_clocks
Clock instances for each processing domain.
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
@ Vruta
Coroutines, schedulers, clocks, task management.
@ SAMPLE_ACCURATE
Coroutine is sample-accurate.

References MayaFlux::Journal::CoroutineScheduling, m_token_clocks, MayaFlux::Vruta::SAMPLE_ACCURATE, and MayaFlux::Journal::Vruta.