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

◆ execute_buffer_rate()

void MayaFlux::Kriya::BufferPipeline::execute_buffer_rate ( uint64_t  max_cycles = 0)

Execute pipeline synchronized to audio hardware cycle boundaries.

This now respects the configured execution strategy and timing modes. Default strategy is PHASED with BUFFER_RATE timing.

Parameters
max_cyclesMaximum number of audio cycles to process (0 = infinite)

Definition at line 67 of file BufferPipeline.cpp.

68{
69 if (!m_scheduler) {
70 error<std::runtime_error>(Journal::Component::Kriya,
72 std::source_location::current(),
73 "Pipeline requires scheduler for execution");
74 }
75
76 auto self = shared_from_this();
77
78 if (max_cycles == 0) {
79 max_cycles = UINT64_MAX;
81 }
82 m_max_cycles = max_cycles;
83
84 auto routine = std::make_shared<Vruta::SoundRoutine>(
85 execute_internal(max_cycles, 0));
86
87 m_routine = routine;
88 m_scheduler->add_task(std::move(routine));
89
90 m_active_self = self;
91}
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.

+ Here is the call graph for this function: