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

◆ schedule_pattern() [4/4]

MAYAFLUX_API void MayaFlux::schedule_pattern ( std::function< std::any(uint64_t)>  pattern_func,
std::function< void(std::any)>  callback,
std::vector< double >  durations,
std::string  name = "",
Vruta::ProcessingToken  token = Vruta::ProcessingToken::SAMPLE_ACCURATE 
)

Schedules a pattern generator whose steps are spaced by a list of durations.

Parameters
pattern_funcFunction that generates pattern values based on step index
callbackFunction to call with each pattern value
durationsSeconds to wait after each step, stepped through in order and repeated
nameName of the pattern task (optional but recommended). If not provided, a default name will be generated.
tokenProcessing token to determine which scheduler rate to use (default: SAMPLE_ACCURATE)

A single interval is a list of one. Uses the task scheduler from the default engine.

Definition at line 74 of file Chronie.cpp.

75{
76 auto scheduler = get_scheduler();
77 if (name.empty()) {
78 name = "pattern_" + std::to_string(scheduler->get_next_task_id());
79 }
80
81 scheduler->add_task(Kriya::pattern(std::move(pattern_func), std::move(callback), std::move(durations), token), name, false);
82}
PickCallback callback
Definition Picker.cpp:22
std::string name
Definition VKDevice.cpp:123
std::shared_ptr< Vruta::TaskScheduler > get_scheduler()
Gets the task scheduler from the default engine.
Definition Chronie.cpp:22

References callback, get_scheduler(), name, and MayaFlux::Kriya::pattern().

Referenced by schedule_pattern().

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