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

138{
139 if (!m_scheduler) {
140 error<std::runtime_error>(Journal::Component::Kriya,
142 std::source_location::current(),
143 "Pipeline requires scheduler for execution");
144 }
145
146 auto self = shared_from_this();
147
148 if (cycles == 0) {
149 cycles = UINT64_MAX;
151 }
152 m_max_cycles = cycles;
153 auto routine = std::make_shared<Vruta::SoundRoutine>(
154 execute_internal(cycles, 0));
155 m_routine = routine;
156 m_scheduler->add_task(std::move(routine));
157 m_active_self = self;
158}
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_continuous().

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