MayaFlux 0.4.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 265 of file Scheduler.cpp.

266{
267 auto clock_it = m_token_clocks.find(token);
268 if (clock_it != m_token_clocks.end()) {
269 return *clock_it->second;
270 }
271
272 auto audio_clock_it = m_token_clocks.find(ProcessingToken::SAMPLE_ACCURATE);
273 if (audio_clock_it != m_token_clocks.end()) {
274 return *audio_clock_it->second;
275 }
276
277 error<std::runtime_error>(Journal::Component::Vruta, Journal::Context::CoroutineScheduling, std::source_location::current(),
278 "No clock found for token {}, and no sample-accurate clock available as fallback", static_cast<int>(token));
279}
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.