MayaFlux 0.1.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 143 of file BufferPipeline.cpp.

146{
147 if (!m_scheduler) {
148 error<std::runtime_error>(Journal::Component::Kriya,
150 std::source_location::current(),
151 "Pipeline must have scheduler for scheduled execution");
152 }
153
154 auto self = shared_from_this();
155
156 if (max_cycles == 0) {
157 max_cycles = UINT64_MAX;
159 }
160
161 m_max_cycles = max_cycles;
162
163 auto routine = std::make_shared<Vruta::SoundRoutine>(
164 execute_internal(max_cycles, samples_per_operation));
165
166 m_scheduler->add_task(std::move(routine));
167
168 m_active_self = self;
169}
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(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:17
@ 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: