Lumiverse  2.5
A framework for creating lighting control applications
SineWave.h
1 #pragma once
2 #include "Timeline.h"
3 
4 namespace Lumiverse {
5 namespace ShowControl {
6 
21  class SineWave : public Timeline
22  {
23  public:
30  enum Mode {
31  ABS,
32  REL
33  };
34 
46  SineWave(float period = 1, float magnitude = 0.5, float phase = 0, float offset = 0.5, Mode mode = ABS);
47 
53  SineWave(JSONNode node);
54 
55  ~SineWave();
56 
60  virtual shared_ptr<LumiverseType> getValueAtTime(string id, string paramName, LumiverseType* currentVal, size_t time, map<string, shared_ptr<Timeline> >& tls) override;
61 
65  virtual size_t getLoopLength() override;
66 
70  virtual string getTimelineTypeName() override { return "sinewave"; }
71 
75  virtual JSONNode toJSON() override;
76 
77  private:
79  float _period;
80 
82  float _magnitude;
83 
85  float _phase;
86 
88  float _offset;
89 
92  };
93 
94 }
95 }
virtual string getTimelineTypeName() override
Returns the name of this type of timeline.
Definition: SineWave.h:70
Mode _mode
Sine wave mode.
Definition: SineWave.h:91
This class is a wapper around a variety of different possible data types that might be needed by a De...
Definition: LumiverseType.h:33
A Timeline is a list of device parameter values at arbitrary times.
Definition: Timeline.h:34
Mode
Encodes the behavior for this effect.
Definition: SineWave.h:30
float _period
Period of the sine wave.
Definition: SineWave.h:79
float _offset
Vertical offset of the sine wave.
Definition: SineWave.h:88
float _magnitude
Magnitude of the sine wave.
Definition: SineWave.h:82
This class implements a sine-wave effect.
Definition: SineWave.h:21
SineWave(float period=1, float magnitude=0.5, float phase=0, float offset=0.5, Mode mode=ABS)
Creates a new SineWave effect.
Definition: SineWave.cpp:5
float _phase
Phase of the sine wave.
Definition: SineWave.h:85
virtual size_t getLoopLength() override
Returns the amount of time it takes to cycle through the sine wave once in milliseconds.
Definition: SineWave.cpp:103
virtual shared_ptr< LumiverseType > getValueAtTime(string id, string paramName, LumiverseType *currentVal, size_t time, map< string, shared_ptr< Timeline > > &tls) override
Returns the value of the requested parameter according to the sine wave parameters.
Definition: SineWave.cpp:57
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
virtual JSONNode toJSON() override
Converts this timeline to a JSON node.
Definition: SineWave.cpp:107