Lumiverse  2.5
A framework for creating lighting control applications
Cue.h
1 #ifndef _CUE_H_
2 #define _CUE_H_
3 
4 #pragma once
5 
6 #include <LumiverseCore.h>
7 #include <memory>
8 #include "Timeline.h"
9 
10 using namespace std;
11 
12 namespace Lumiverse {
13 namespace ShowControl {
31 class Cue : public Timeline {
32 public:
36  Cue() : _upfade(3.0f), _downfade(3.0f) { }
37 
45  Cue(Rig* rig);
46 
51  Cue(Rig* rig, float time);
52 
60  Cue(DeviceSet devices, float up, float down, float delay);
61 
62  // Creates a cue with different up and down fades.
63  Cue(Rig* rig, float up, float down);
64 
65  // Creates a cue with different up and down fades, and a different delay
66  Cue(Rig* rig, float up, float down, float delay);
67 
68  Cue(map<string, Device*> devices, float up, float down, float delay);
69 
71  Cue(JSONNode node);
72 
76  Cue(const Cue& other);
77 
78  // Destructor
79  ~Cue();
80 
84  void operator=(const Cue& other);
85 
86  string getTimelineTypeName() override { return "cue"; }
87 
96  void update(Rig* rig);
97 
98  // Slightly different arguments, acts the same as update(Rig*)
99  void update(DeviceSet devices);
100 
104  void update(map<string, LumiverseType*> params);
105 
109  void update(string id, string param, LumiverseType* data);
110 
117  void setDelay(float delay);
118 
123  void setTime(float time);
124 
130  void setTime(float up, float down);
131 
138  void setTime(float up, float down, float delay);
139 
140  // Gets the upfade
141  float getUpfade() { return _upfade; }
142 
143  // Gets the downfade
144  float getDownfade() { return _downfade; }
145 
147  float getDelay() { return _delay; }
148 
150  JSONNode toJSON() override;
151 
157  float getTransitionTime() { return max(_upfade, _downfade) + _delay; }
158 
162  void setCurrentState(map<string, map<string, LumiverseType*> >& state, shared_ptr<Timeline> active, size_t time) override;
163 
167  shared_ptr<LumiverseType> getLastCueValue(string id, string paramName);
168 
169 private:
170  // Upfade time
171  float _upfade;
172 
173  // Downfade time
174  float _downfade;
175 
176  // Delay before doing any fades, default timing.
177  float _delay;
178 
179  // Reserved for future use.
180  // m_follow - cue follow time (time to wait before automatically taking the next cue)
181 };
182 
183 }
184 }
185 #endif
Include file for all of LumiverseCore in one conveninent location.
This class is a wapper around a variety of different possible data types that might be needed by a De...
Definition: LumiverseType.h:33
float getTransitionTime()
Returns the total transition time of the cue.
Definition: Cue.h:157
Definition: Layer.h:437
A Timeline is a list of device parameter values at arbitrary times.
Definition: Timeline.h:34
float getDelay()
Gets the delay from a cue.
Definition: Cue.h:147
A DeviceSet is a set of devices.
Definition: DeviceSet.h:41
Cue()
Makes a blank cue.
Definition: Cue.h:36
string getTimelineTypeName() override
Used for identifying different kinds of timelines.
Definition: Cue.h:86
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
The Rig contains information about the state of the lighting system.
Definition: Rig.h:58
A cue stores data for a particular look (called a cue)
Definition: Cue.h:31