-
Notifications
You must be signed in to change notification settings - Fork 0
/
effect.h
84 lines (65 loc) · 1.45 KB
/
effect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef EFFECT_H
#define EFFECT_H
#include "ledcolor.h"
class EffectPrivate;
class Effect : public LEDColor {
public:
// /**
// * @brief Effect constructor
// * @description Always call the Effect constructor when subclassing from it
// */
// Effect();
// /**
// * @brief Effect destructor
// */
// ~Effect();
/**
* @brief Specifies Effect Name
*/
virtual char* name() const;
/**
* @brief This method is called upon effect initialisation
*/
virtual void init();
/**
* @brief This method is called on each frame update
*/
virtual void update();
/**
* @brief Defines the duration o
*/
static void duration(unsigned int);
/**
* @brief Gets the duration of an effect
*/
static int duration();
/**
* @brief Represents the maximum delay between update() calls.
* @description Should be implemented by every effect.
* @see update()
*/
virtual unsigned int maxDelay();
/**
* @brief Gets the effect current state
*/
bool running();
/**
* @brief Starts the effect
*/
virtual void start();
/**
* @brief Stops the effect
*/
virtual void stop();
/**
* @brief Turns the LED strip off
*/
void reset();
protected:
static unsigned int m_duration;
static unsigned long renderTime;
private:
bool m_running;
friend class Controller;
};
#endif