MayaFlux 0.2.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 137 of file Scheduler.cpp.

138{
139 auto clock_it = m_token_clocks.find(token);
140 if (clock_it != m_token_clocks.end()) {
141 return *clock_it->second;
142 }
143
144 auto audio_clock_it = m_token_clocks.find(ProcessingToken::SAMPLE_ACCURATE);
145 if (audio_clock_it != m_token_clocks.end()) {
146 return *audio_clock_it->second;
147 }
148
149 throw std::runtime_error("No clocks available in scheduler");
150}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
std::unordered_map< ProcessingToken, std::unique_ptr< IClock > > m_token_clocks
Clock instances for each processing domain.
@ SAMPLE_ACCURATE
Coroutine is sample-accurate.

References m_token_clocks, MayaFlux::Vruta::SAMPLE_ACCURATE, and token.