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

◆ execute_scheduled()

void MayaFlux::Kriya::BufferPipeline::execute_scheduled ( uint64_t  max_cycles = 0,
uint64_t  samples_per_operation = 1 
)

Execute pipeline with sample-accurate timing between operations.

Parameters
max_cyclesMaximum number of cycles to execute (0 = infinite)
samples_per_operationNumber of samples to wait between operations (default: 1)

Schedules pipeline execution with precise timing control. After each operation within a cycle, the pipeline waits for the specified number of samples before proceeding. Useful for rate-limiting operations or creating timed sequences.

Exceptions
std::runtime_errorif pipeline has no scheduler
Note
Execution is asynchronous. The pipeline keeps itself alive until completion.

Definition at line 150 of file BufferPipeline.cpp.

153{
154 if (!m_scheduler) {
155 error<std::runtime_error>(Journal::Component::Kriya,
157 std::source_location::current(),
158 "Pipeline must have scheduler for scheduled execution");
159 }
160
161 auto self = shared_from_this();
162
163 if (max_cycles == 0) {
164 max_cycles = UINT64_MAX;
166 }
167
168 m_max_cycles = max_cycles;
169
170 auto routine = std::make_shared<Vruta::SoundRoutine>(
171 execute_internal(max_cycles, samples_per_operation));
172
173 m_scheduler->add_task(std::move(routine));
174
175 m_active_self = self;
176}
Vruta::SoundRoutine execute_internal(uint64_t max_cycles, uint64_t samples_per_operation)
std::shared_ptr< BufferPipeline > m_active_self
Vruta::TaskScheduler * m_scheduler
void add_task(const std::shared_ptr< Routine > &routine, const std::string &name="", bool initialize=false)
Add a routine to the scheduler based on its processing token.
Definition Scheduler.cpp:19
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.

References MayaFlux::Vruta::TaskScheduler::add_task(), MayaFlux::Journal::CoroutineScheduling, execute_internal(), MayaFlux::Journal::Kriya, m_active_self, m_continuous_execution, m_max_cycles, and m_scheduler.

Referenced by execute_scheduled_at_rate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: