Lumiverse
2.5
A framework for creating lighting control applications
|
Events are special keyframes that call other functions when encountered. More...
#include <Keyframe.h>
Public Member Functions | |
Event (function< void()> cb, string id="") | |
Event (JSONNode node) | |
Loads an Event from a JSONNode. More... | |
virtual void | execute () |
Executes the event. More... | |
virtual void | reset () |
If there are any things that need to be reset when the Timeline starts, this function will do that. More... | |
virtual void | setCallback (function< void()> cb) |
Changes the callback function. More... | |
virtual string | getType () |
Returns the typename of this Event. | |
virtual JSONNode | toJSON () |
While this object may not be able to serialize itself, other Event types may be able to. | |
Public Attributes | |
string | _id |
Optional identifier to make it easier to delete and find Events. | |
Private Attributes | |
function< void()> | _callback |
Callback function to execute when the Event is encountered. | |
Events are special keyframes that call other functions when encountered.
Events can really be used anywhere to do anything within the limits of the program. There are a few pre-defied event classes to make certain common tasks easier (such as start playback on Layer, go to next timeline, etc.)
Note that these generic events are inherently unable to be serialized (std::function objects have no default serialization method) so if you are using these kinds of Events, it may be better to leave your show as a script instead of outputted to a JSON file.
Lumiverse::ShowControl::Event::Event | ( | JSONNode | node | ) |
Loads an Event from a JSONNode.
Loads as much of an event as it can, which really isn't that much.
|
virtual |
Executes the event.
Subclasses of Event can do additional things but the base class just calls _callback().
|
virtual |
If there are any things that need to be reset when the Timeline starts, this function will do that.
Use case for this function is designed for loops of a finite duration, for example.
|
virtual |
Changes the callback function.
cb | Callback function to execute. |