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

◆ execute_for_cycles()

void MayaFlux::Kriya::BufferPipeline::execute_for_cycles ( uint64_t  cycles = 0)

Execute the pipeline for a specified number of cycles.

Parameters
cyclesNumber of processing cycles to execute

Schedules the pipeline to run for the given number of cycles. Each cycle processes all operations once. Execution is asynchronous via the scheduler. The pipeline remains alive until all cycles complete.

Exceptions
std::runtime_errorif pipeline has no scheduler
Note
Execution happens asynchronously - this function returns immediately.

Definition at line 115 of file BufferPipeline.cpp.

116{
117 if (!m_scheduler) {
118 error<std::runtime_error>(Journal::Component::Kriya,
120 std::source_location::current(),
121 "Pipeline requires scheduler for execution");
122 }
123
124 auto self = shared_from_this();
125
126 if (cycles == 0) {
127 cycles = UINT64_MAX;
129 }
130 m_max_cycles = cycles;
131 auto routine = std::make_shared<Vruta::SoundRoutine>(
132 execute_internal(cycles, 0));
133 m_scheduler->add_task(std::move(routine));
134 m_active_self = self;
135}
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_continuous().

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