-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofx_blinky.h
56 lines (49 loc) · 1.52 KB
/
ofx_blinky.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
//
// ofx_blinky.h
// EOGcalibration
//
// Created by Felix Dollack on 10.10.18.
//
#ifndef ofx_blinky_h
#define ofx_blinky_h
#include "ofMain.h"
enum BeepMode {
BEEP_OFF = 0,
BEEP_ON_START,
BEEP_ON_END
};
class Blinky {
public:
Blinky(float radius);
Blinky(float radius, ofColor mainColor);
Blinky(float radius, ofColor mainColor, ofColor secondaryColor);
Blinky(float radius, ofColor mainColor, BeepMode beepMode, bool useHighBeep, float blinkingSpeedHz);
Blinky(float radius, ofColor mainColor, ofColor secondaryColor, BeepMode beepMode, bool useHighBeep, float blinkingSpeedHz);
void update(void);
void draw(void);
void draw(int x, int y);
void setPosition(ofVec2f position);
ofVec2f getPosition(void);
void setSize(float radius);
void setColor(ofColor color);
void setColors(ofColor foreground_color, ofColor background_color);
void setBlinking(bool state);
bool isBlinking();
void setBlinkyOn(bool state);
bool isBlinkyOn(void);
void setBeepMode(BeepMode state);
BeepMode getBeepMode(void);
void setBeepHigh(bool state);
private:
ofSoundPlayer *_beep;
string _beep_filename;
BeepMode _beep_mode;
void reloadBeep();
bool _blinking_state, _blinky_on_state, _use_high_beep;
float _radius, _blinking_interval_seconds;
ofVec2f _position;
ofColor _blinky_highlight_color, _blinky_base_color;
float _last_blinky_update, _blinking_start_time;
static ofColor getDarkerColor(ofColor color);
};
#endif /* ofx_blinky_h */