forked from bracci/Qlockthree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event.cpp
62 lines (56 loc) · 1.45 KB
/
Event.cpp
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
/*
Event.cpp
Klasse für ein jährliches Event
@mc Arduino/UNO
@autor Manuel Bracher / [email protected]
@version 1.0
@created 02.01.15
*/
#include "Event.h"
#include "Debug.h"
Event::Event(byte month,
byte date,
const char* txt,
Effects::eEffects effect,
eColors color) :
_month (month), _date (date),
_txt (txt), _effect (effect),
_color(color) {};
void Event::show() {
DEBUG_PRINT(F("Ticker String: "));
DEBUG_PRINTLN(_txt);
if (strlen(_txt) != 0)
Effects::showTickerString(_txt, TICKER_SPEED, settings.getColor());
if (_effect < Effects::BITMAP_MIN) {
switch (_effect)
{
case Effects::NO_EFFECT:
break;
case Effects::EFFECT_FIREWORK:
Effects::showFireWork(5, _color);
Effects::showFireWork(2, _color);
Effects::showFireWork(8, _color);
break;
case Effects::EFFECT_HEART:
Effects::showHeart(DURATION_ANI_BM, _color);
break;
case Effects::EFFECT_CANDLE:
Effects::showCandle(_color);
break;
default:
;
}
}
if ((_effect >= Effects::BITMAP_MIN) && (_effect < Effects::ANI_BITMAP_MIN)) {
Effects::showBitmap(_effect, DURATION_BM, _color);
}
if (_effect >= Effects::ANI_BITMAP_MIN) {
Effects::showAnimatedBitmap(_effect, DURATION_ANI_BM, _color);
}
}
byte Event::getMonth() {
return _month;
}
byte Event::getDate() {
return _date;
}