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

◆ schedule_sequence()

MAYAFLUX_API void MayaFlux::schedule_sequence ( std::vector< std::pair< double, std::function< void()> > >  sequence,
std::string  name = "" 
)

Creates a sequence task that calls functions at specified times and addes it to the default scheduler list for evaluation.

Parameters
sequenceVector of (time, function) pairs
nameName of the metronome task (optional but recommended). If not provided, a default name will be generated.

Uses the task scheduler from the default engine.

Definition at line 51 of file Chronie.cpp.

52{
53 auto scheduler = get_scheduler();
54 if (name.empty()) {
55 name = "seq_" + std::to_string(scheduler->get_next_task_id());
56 }
57 auto tseq = std::make_shared<Vruta::SoundRoutine>(create_sequence(std::move(seq)));
58 get_scheduler()->add_task(std::move(tseq), name, false);
59}
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:14

References create_sequence(), and get_scheduler().

+ Here is the call graph for this function: