MayaFlux 0.4.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 122 of file BufferPipeline.cpp.

123{
124 if (!m_scheduler) {
125 error<std::runtime_error>(Journal::Component::Kriya,
127 std::source_location::current(),
128 "Pipeline requires scheduler for execution");
129 }
130
131 auto self = shared_from_this();
132
133 if (cycles == 0) {
134 cycles = UINT64_MAX;
136 }
137 m_max_cycles = cycles;
138 auto routine = std::make_shared<Vruta::SoundRoutine>(
139 execute_internal(cycles, 0));
140 m_scheduler->add_task(std::move(routine));
141 m_active_self = self;
142}
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_continuous().

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