MayaFlux 1.0.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 166 of file BufferPipeline.cpp.

169{
170 if (!m_scheduler) {
171 error<std::runtime_error>(Journal::Component::Kriya,
173 std::source_location::current(),
174 "Pipeline must have scheduler for scheduled execution");
175 }
176
177 auto self = shared_from_this();
178
179 if (max_cycles == 0) {
180 max_cycles = UINT64_MAX;
182 }
183
184 m_max_cycles = max_cycles;
185
186 auto routine = std::make_shared<Vruta::SoundRoutine>(
187 execute_internal(max_cycles, samples_per_operation));
188
189 m_routine = routine;
190 m_scheduler->add_task(std::move(routine));
191
192 m_active_self = self;
193}
Vruta::SoundRoutine execute_internal(uint64_t max_cycles, uint64_t samples_per_operation)
std::shared_ptr< BufferPipeline > m_active_self
std::shared_ptr< Vruta::Routine > m_routine
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:94
@ 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, m_routine, 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: