MayaFlux 0.1.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 135 of file Scheduler.cpp.

136{
137 auto clock_it = m_token_clocks.find(token);
138 if (clock_it != m_token_clocks.end()) {
139 return *clock_it->second;
140 }
141
142 auto audio_clock_it = m_token_clocks.find(ProcessingToken::SAMPLE_ACCURATE);
143 if (audio_clock_it != m_token_clocks.end()) {
144 return *audio_clock_it->second;
145 }
146
147 throw std::runtime_error("No clocks available in scheduler");
148}
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.