Lumiverse  2.5
A framework for creating lighting control applications
Public Member Functions | Public Attributes | Private Attributes | List of all members
Lumiverse::ShowControl::Event Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void Lumiverse::ShowControl::Event::execute ( )
virtual

Executes the event.

Subclasses of Event can do additional things but the base class just calls _callback().

void Lumiverse::ShowControl::Event::reset ( )
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.

void Lumiverse::ShowControl::Event::setCallback ( function< void()>  cb)
virtual

Changes the callback function.

Parameters
cbCallback function to execute.

The documentation for this class was generated from the following files: