|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API Vruta::SoundRoutine MayaFlux::Kriya::metro | ( | Vruta::TaskScheduler & | scheduler, |
| double | interval_seconds, | ||
| std::function< void()> | callback | ||
| ) |
Creates a periodic event generator that executes a callback at regular intervals.
| scheduler | The task scheduler that will manage this event generator |
| interval_seconds | Time between callback executions in seconds |
| callback | Function to execute on each interval |
The metro task provides a fundamental temporal mechanism for creating time-based structures in computational systems. It executes the provided callback function at precise, regular intervals with sample-accurate timing, enabling the creation of rhythmic patterns, event sequences, and temporal frameworks that can synchronize across different domains.
Unlike system timers which can drift due to processing load, this implementation maintains precise timing by synchronizing with the sample-rate clock, making it suitable for both audio and cross-domain applications where timing accuracy is critical.
Example usage:
The metro task continues indefinitely until explicitly cancelled, creating a persistent temporal structure within the computational system.
Definition at line 8 of file Tasks.cpp.
References MayaFlux::Vruta::TaskScheduler::seconds_to_samples().
Referenced by MayaFlux::create_metro().
Here is the call graph for this function:
Here is the caller graph for this function: