14 #include <unordered_map>
17 namespace ShowControl {
23 chrono::time_point<chrono::high_resolution_clock> start;
24 map<string, set<string> > activeParams;
27 chrono::time_point<chrono::high_resolution_clock> elapsed;
212 void update(chrono::time_point<chrono::high_resolution_clock> updateStart);
225 void blend(map<string, Device*> currentState);
236 void setCueList(shared_ptr<CueList> list,
bool resetCurrentCue =
true);
271 void goToCue(
float num,
float up = 3,
float down = 3,
float delay = 0);
331 shared_ptr<CueList> m_cueList;
363 static unordered_map<Layer::BlendMode, string, std::hash<unsigned int>> BlendModeToString {
371 static unordered_map<string, Layer::BlendMode> StringToBlendMode {
393 return Layer::BLEND_OPAQUE;
412 inline bool operator!=(ShowControl::Layer& lhs, ShowControl::Layer& rhs) {
413 return !(lhs == rhs);
424 inline bool operator>(ShowControl::Layer& lhs, ShowControl::Layer& rhs) {
428 inline bool operator<=(ShowControl::Layer& lhs, ShowControl::Layer& rhs) {
432 inline bool operator>=(ShowControl::Layer& lhs, ShowControl::Layer& rhs) {
444 std::hash<unsigned int> hasher;
445 return hasher( static_cast<unsigned int>( arg ) );
float getCurrentCue()
Gets the most recently played cue on the Layer.
Definition: Layer.cpp:526
BlendMode m_mode
Layer blend mode.
Definition: Layer.h:300
Include file for all of LumiverseCore in one conveninent location.
bool isActive()
Retrieves the visibility of the layer.
Definition: Layer.h:130
void setOpacity(float val)
Set the layer's opactiy.
Definition: Layer.cpp:122
bool addDevicesWithParams(DeviceSet d, set< string > params)
Adds the selected devices and selected parameters to the Layer state.
Definition: Layer.cpp:161
Layer(Rig *rig, Playback *pb, string name, int priority, BlendMode mode=ALPHA)
Constructs a Layer.
Definition: Layer.cpp:6
This class is a wapper around a variety of different possible data types that might be needed by a De...
Definition: LumiverseType.h:33
const shared_ptr< CueList > & getCueList()
Retrieves the CueList assigned to the layer.
Definition: Layer.cpp:521
float m_opacity
If using alpha blending, the opacity of the layer.
Definition: Layer.h:303
map< string, map< string, LumiverseType * > > m_layerState
Holds the information on the current state of the layer.
Definition: Layer.h:281
BlendMode getMode()
Gets the layer's blend mode.
Definition: Layer.h:118
map< string, map< string, LumiverseType * > > & getLayerState()
Gets the layer state.
Definition: Layer.h:205
string getName()
Get the layer name.
Definition: Layer.h:142
Playback * m_pb
Playback object associated with the Layer.
Definition: Layer.h:288
A DeviceSet is a set of devices.
Definition: DeviceSet.h:41
A playback object manages layers, timelines, and coordinates their actions and updates.
Definition: Playback.h:32
float getOpacity()
Get the layer's opacity.
Definition: Layer.h:124
void reset()
Restores the layer state to defaults and gets out of the current cue.
Definition: Layer.cpp:492
string m_name
Layer Name.
Definition: Layer.h:291
void init(Rig *rig)
Copies the devices and does other Layer initialization.
Definition: Layer.cpp:95
bool deleteParametersFromDevices(DeviceSet d, set< string > params)
Deletes the selected parameter values from the layer.
Definition: Layer.cpp:238
A Layer stores a state of the Rig.
Definition: Layer.h:41
void setName(string name)
Set the layer name.
Definition: Layer.h:139
bool m_pause
Indicates if playback is paused on this layer.
Definition: Layer.h:306
bool deleteDevices(DeviceSet d)
Deletes the selected devices from the layer along with all of their parameters.
Definition: Layer.cpp:218
bool deleteParametersFromAllDevices(set< string > params)
Deletes all parameters from all devices in the layer.
Definition: Layer.cpp:255
void goToCue(float num, float up=3, float down=3, float delay=0)
Goes to the selected cue in the selected time.
Definition: Layer.cpp:562
int getPriority()
Gets the priority.
Definition: Layer.h:148
void blend(map< string, Device * > currentState)
Blends this layer with the given state.
Definition: Layer.cpp:407
void setMode(BlendMode mode)
Sets the Layer's blend mode.
Definition: Layer.h:121
~Layer()
Destroys a layer.
Definition: Layer.cpp:113
bool addDevice(Device *d, string param)
Adds a single device and parameter to the layer.
Definition: Layer.cpp:143
bool m_stop
Indicates that the Layer is stopping playback.
Definition: Layer.h:312
void activate()
Set m_active to true.
Definition: Layer.h:133
JSONNode toJSON()
Returns the JSON representation of a Layer.
Definition: Layer.cpp:452
bool m_playing
Indicates if the layer is currently playing back a timeline.
Definition: Layer.h:317
void pause()
Pauses playback of the current Timeline(s).
Definition: Layer.cpp:313
bool hasCueList()
Indicates whether or not the Layer has a CueList assigned to it.
Definition: Layer.cpp:516
void update(chrono::time_point< chrono::high_resolution_clock > updateStart)
Updates the Layer. If cues a running, the cues get updated.
Definition: Layer.cpp:333
string m_lastPlayedTimeline
Stores the ID of the most recently played back Timeline.
Definition: Layer.h:329
void back()
Goes to the previous cue in the list.
Definition: Layer.cpp:549
void deactivate()
Set m_active to false.
Definition: Layer.h:136
void stop()
Stops and clears all current playback information from the Layer.
Definition: Layer.cpp:324
void removeCueList()
Remvoes a CueList from the Layer.
Definition: Layer.cpp:511
bool addDevices(DeviceSet d)
Adds the selected devices and all parameters to the Layer state.
Definition: Layer.cpp:126
string getRecentTimeline()
Returns the ID of the Timeline most being played on the Layer.
Definition: Layer.cpp:329
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
void play(string id)
Plays a Timeline on the layer.
Definition: Layer.cpp:271
BlendMode
Definition: Layer.h:44
PlaybackData * m_playbackData
Returns the set of parameters to animate.
Definition: Layer.h:353
void setPriority(int priority)
Sets the priority.
Definition: Layer.h:145
bool deleteParameter(string id, string param)
Deletes a single parameter from a single device in the layer.
Definition: Layer.cpp:203
The Rig contains information about the state of the lighting system.
Definition: Rig.h:58
bool addParamToAllDevices(string param, LumiverseType *type)
Adds the specified parameter with the specified type to the existing devices in the Layer...
Definition: Layer.cpp:184
A Device in Lumiverse maintains information about a lighting device.
Definition: Device.h:55
chrono::time_point< chrono::high_resolution_clock > m_previousLoopStart
Stores the previous loop start time in milliseconds.
Definition: Layer.h:324
bool m_active
Layer visibility flag.
Definition: Layer.h:297
void setCueList(shared_ptr< CueList > list, bool resetCurrentCue=true)
Assigns a CueList to the Layer.
Definition: Layer.cpp:503
void resume()
Resumes playback of the current Timeline(s).
Definition: Layer.cpp:318
Data that tracks the progress of a Timeline.
Definition: Layer.h:22
void go()
Goes to the next cue in the list.
Definition: Layer.cpp:531
PlaybackData * m_queuedPlayback
Next timeline to run.
Definition: Layer.h:356
int m_priority
Layer priority. High priority layers are on top of low priority ones.
Definition: Layer.h:294