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

◆ execute_scheduled_at_rate()

void MayaFlux::Kriya::BufferPipeline::execute_scheduled_at_rate ( uint32_t  max_cycles = 0,
double  seconds_per_operation = 1 
)

Execute pipeline with real-time rate control.

Parameters
max_cyclesMaximum number of cycles to execute
seconds_per_operationDuration between operations in seconds

Convenience wrapper around execute_scheduled() that converts time intervals to sample counts based on the scheduler's sample rate. Enables natural specification of timing in seconds rather than samples.

Exceptions
std::runtime_errorif pipeline has no scheduler

Example:

// Execute 10 cycles with 0.5 seconds between operations
pipeline->execute_scheduled_at_rate(10, 0.5);

Definition at line 171 of file BufferPipeline.cpp.

174{
175 if (!m_scheduler) {
176 error<std::runtime_error>(Journal::Component::Kriya,
178 std::source_location::current(),
179 "Pipeline must have scheduler for scheduled execution");
180 }
181
182 uint64_t samples = m_scheduler->seconds_to_samples(seconds_per_operation);
183 execute_scheduled(max_cycles, samples);
184}
void execute_scheduled(uint64_t max_cycles=0, uint64_t samples_per_operation=1)
Execute pipeline with sample-accurate timing between operations.
Vruta::TaskScheduler * m_scheduler
uint64_t seconds_to_samples(double seconds) const
Converts a time in seconds to a number of samples.
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.

References MayaFlux::Journal::CoroutineScheduling, execute_scheduled(), MayaFlux::Journal::Kriya, m_scheduler, and MayaFlux::Vruta::TaskScheduler::seconds_to_samples().

+ Here is the call graph for this function: