|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
A sequential chain of timed events with precise temporal control. More...
#include <Chain.hpp>
Collaboration diagram for MayaFlux::Kriya::EventChain:Classes | |
| struct | TimedEvent |
| Structure representing a timed event in the chain. More... | |
Public Member Functions | |
| EventChain () | |
| Constructs an EventChain using the global scheduler. | |
| EventChain (Vruta::TaskScheduler &scheduler) | |
| Constructs an EventChain with an explicit scheduler. | |
| EventChain & | then (std::function< void()> action, double delay_seconds=0.F) |
| Adds an event to the chain with a specified delay. | |
| void | start () |
| Starts executing the event chain. | |
Private Attributes | |
| std::vector< TimedEvent > | m_events |
| Collection of events in this chain. | |
| Vruta::TaskScheduler & | m_Scheduler |
| Reference to the scheduler that manages timing. | |
| std::shared_ptr< Vruta::SoundRoutine > | m_routine |
| The underlying computational routine that implements the chain. | |
A sequential chain of timed events with precise temporal control.
The EventChain class provides a way to schedule a sequence of events to occur at specific time intervals. It's designed for creating temporal sequences of actions with sample-accurate timing, which is essential for deterministic computational flows.
This approach is inspired by reactive programming and temporal logic systems where precise sequencing of operations is critical. It allows for creating complex temporal behaviors with a simple, declarative API.
Example usage:
The EventChain is particularly useful for creating precisely timed computational sequences, state transitions, or any series of time-based events that need to occur in a specific order with deterministic timing.