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

◆ execute_once()

void MayaFlux::Kriya::BufferPipeline::execute_once ( )

Execute the pipeline for a single cycle.

Schedules the pipeline to run once through all operations. The execution happens asynchronously via the scheduler's coroutine system. The pipeline must have a scheduler and will be kept alive via shared_ptr until execution completes.

Exceptions
std::runtime_errorif pipeline has no scheduler
Note
This is asynchronous - the function returns immediately and execution happens when the scheduler processes the coroutine.

Definition at line 105 of file BufferPipeline.cpp.

106{
107 if (!m_scheduler) {
108 error<std::runtime_error>(Journal::Component::Kriya,
110 std::source_location::current(),
111 "Pipeline requires scheduler for execution");
112 }
113 auto self = shared_from_this();
114
115 m_max_cycles = 1;
116 auto routine = std::make_shared<Vruta::SoundRoutine>(
117 execute_internal(1, 0));
118 m_scheduler->add_task(std::move(routine));
119 m_active_self = self;
120}
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_max_cycles, and m_scheduler.

+ Here is the call graph for this function: