-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDriverController.pde
More file actions
51 lines (44 loc) · 1.18 KB
/
DriverController.pde
File metadata and controls
51 lines (44 loc) · 1.18 KB
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
/*
* Octorail
* Configure and video map modular systems of LED strips using OPC / FadeCandy
* https://github.com/tgreiser/octorail
*
* (c) Tim Greiser - 2015
* Released under the terms of MIT License
*/
class DriverController extends Controller {
CheckBox checkbox;
Textlabel tsec;
void setup(PApplet _app, LEDMap _map) {
super.setup(_app, _map);
tsec = new Textlabel(c5,"Toggle Drivers",map.w+285,55, 100,20);
checkbox = c5.addCheckBox("drivers")
.setPosition(map.w+250, 70);
customize(checkbox); //<>//
checkbox.activateAll();
}
void draw() {
tsec.draw(app);
}
void controlEvent(ControlEvent theEvent) {
if (theEvent.isFrom(checkbox)) {
print("got an event from "+checkbox.getName()+"\t\n");
map.checkboxValues(checkbox.getArrayValue());
map.updateConfig();
}
}
void customize(CheckBox cb) {
cb.setColorForeground(cg1)
.setColorActive(cg4)
.setColorLabel(color(255))
.setSize(20, 20)
.setItemsPerRow(5)
.setSpacingColumn(20)
.setSpacingRow(20)
.addItem("1", 1)
.addItem("2", 2)
.addItem("3", 3)
.addItem("4", 4)
.addItem("5", 5);
}
}