-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpout.pde
67 lines (61 loc) · 2.24 KB
/
Spout.pde
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
void iniciarspout(){
// CREATE A SPOUT SENDER
// Must use the same name as the sketch
spout = new Spout(this);
sendername = "Txtgenerator";
spout.createSender(sendername, width, height);
// CREATE CONTROL ARRAYS
controlName = new String[20];
controlType = new int[20];
controlValue = new float[20];
controlText = new String[20];
//spout.createSpoutControl("Texto", "text"); UserText = "";
// spout.createSpoutControl("Rotate", "bool", 1); bRotate = true;
// spout.createSpoutControl("Speed", "float", 0, 4, 1); Rotation = 0;
// OPEN THE CONTROLS FOR THE CONTROLLER
// Must use the same name as the sketch and sender
spout.openSpoutControls(sendername);
}
void ActualizarControlesResolume(){
int nControls = spout.checkSpoutControls(controlName, controlType, controlValue, controlText);
if(nControls > 0) {
// For all controls
for(int i = 0; i < nControls; i++) {
if(controlName[i].equals("Texto")) {
if(controlText[i] != null && !controlText[i].isEmpty())
UserText = controlText[i];
}
if(controlName[i].equals("Size")){
size = controlValue[i];
}
// "Speed"
if(controlName[i].equals("Speed X")){
speedX = controlValue[i];
}
if(controlName[i].equals("Speed Y")){
speedY = controlValue[i];
}
if(controlName[i].equals("Hue")){
hue = controlValue[i];
}
if(controlName[i].equals("Saturation")){
sat = controlValue[i];
}
if(controlName[i].equals("Brightness")){
bri = controlValue[i];
}
if(controlName[i].equals("Opacity")){
trans = controlValue[i];
}
if(controlName[i].equals("Rotate")){
Rotation = controlValue[i];
}
if(controlName[i].equals("RestObounce")){
restorbounce = (boolean)(controlValue[i] == 1);
}
if(controlName[i].equals("BGrefresh")){
BGrefresh = (boolean)(controlValue[i] == 1);
}
}
}
}