6 std::function<
bool(uint32_t)> condition,
9 uint64_t samples_per_operation)
11 auto branch_pipeline = std::make_shared<BufferPipeline>();
17 branch_builder(*branch_pipeline);
19 m_branches.push_back({ .condition = std::move(condition),
20 .pipeline = std::move(branch_pipeline),
21 .synchronous = synchronous,
22 .samples_per_operation = samples_per_operation });
36 auto task = std::make_shared<Vruta::SoundRoutine>(std::move(branch_routine));
51 auto task = std::make_shared<Vruta::GraphicsRoutine>(
63 if (branch.pipeline) {
64 branch.pipeline->m_active_self.reset();
69 return !task || !task->is_active();
std::vector< std::shared_ptr< Vruta::Routine > > m_branch_tasks
std::shared_ptr< IO::IOManager > m_io_manager
BufferPipeline & branch_if(std::function< bool(uint32_t)> condition, const std::function< void(BufferPipeline &)> &branch_builder, bool synchronous=false, uint64_t samples_per_operation=1)
Add conditional branch to the pipeline.
void cleanup_completed_branches()
std::vector< BranchInfo > m_branches
std::shared_ptr< Buffers::BufferManager > m_buffer_manager
std::shared_ptr< Vruta::GraphicsRoutine > dispatch_frame_branch(BranchInfo &branch)
Vruta::TaskScheduler * m_scheduler
std::shared_ptr< Vruta::SoundRoutine > dispatch_branch_async(BranchInfo &branch, uint64_t cycle)
Coroutine-based execution engine for composable, multi-strategy buffer processing.
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.
std::shared_ptr< BufferPipeline > pipeline
uint64_t samples_per_operation