-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspout.pde
130 lines (120 loc) · 3.92 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
void iniciarspout() {
spout = new Spout(this);
sendername = "Visualorgan";
//spout.initSender(sendername, width, height);
spout.createSender(sendername, width, height);
controlName = new String[20];
controlType = new int[20];
controlValue = new float[20];
controlText = new String[20];
//pepe.initSender(sendername, width, height);
spout.openSpoutControls(sendername);
}
void ControlesSpout() {
int nControls = spout.checkSpoutControls(controlName, controlType, controlValue, controlText);
//print("nControls = " + nControls + "n");
if (nControls > 0) {
for (int i = 0; i < nControls; i++) {
if (controlName[i].equals("BGrefresh")) {
BGrefresh = (boolean)(controlValue[i] == 1);
}
if (controlName[i].equals("Allkeys")) {
allKeys = (boolean)(controlValue[i] == 1);
}
if (controlName[i].equals("Posrandom")) {
PosRandom = (boolean)(controlValue[i] == 1);
}
if (controlName[i].equals("Size")) {
size = controlValue[i];
}
if (controlName[i].equals("Amount")) {
amount = parseInt(controlValue[i]);
}
if (controlName[i].equals("TopSpeed")) {
topSpeed = controlValue[i];
}
if (controlName[i].equals("Aceleration")) {
aceleracion = controlValue[i];
}
if (controlName[i].equals("Polygon Edges")) {
polygonedges = parseInt(controlValue[i]);
}
if (controlName[i].equals("Border")) {
border = controlValue[i];
}
if (controlName[i].equals("Saturation")) {
sat = controlValue[i];
}
if (controlName[i].equals("Brightness")) {
bri = controlValue[i];
}
if (controlName[i].equals("Life")) {
life = controlValue[i];
}
if (controlName[i].equals("Rdm")) {
rdm = controlValue[i];
}
//print("(" + i + ") : [" + controlName[i] + "] : Type [" + controlType[i] + "] : Value [" + controlValue[i] + "] : Text [" + controlText[i] + "]" + "n");
/* if (controlName[i].equals("Size")) {
size = controlValue[i];
}
if (controlName[i].equals("Size2")) {
size2 = controlValue[i];
}
if (controlName[i].equals("modulo")) {
modulo = controlValue[i];
}
if (controlName[i].equals("Rotation Speed")) {
inc = controlValue[i];
}
if (controlName[i].equals("hue")) {
hue = controlValue[i];
}
if (controlName[i].equals("sat")) {
sat = controlValue[i];
}
if (controlName[i].equals("bri")) {
bri = controlValue[i];
}
if (controlName[i].equals("trans")) {
trans = controlValue[i];
}
if (controlName[i].equals("Bhue")) {
Bhue = controlValue[i];
}
if (controlName[i].equals("Bsat")) {
Bsat = controlValue[i];
}
if (controlName[i].equals("Bbri")) {
Bbri = controlValue[i];
}
if (controlName[i].equals("Btrans")) {
Btrans = controlValue[i];
}
if (controlName[i].equals("X speed")) {
speedX = controlValue[i];
}
if (controlName[i].equals("Y speed")) {
speedY = controlValue[i];
}
if (controlName[i].equals("Bsize")) {
Bsize = controlValue[i];
}
if (controlName[i].equals("Sonido")) {
soundsensibility = controlValue[i];
}
if (controlName[i].equals("BGrefresh")){
isbackground = (boolean)(controlValue[i] == 1);
}
if (controlName[i].equals("RandomPoints")){
israndom = (boolean)(controlValue[i] == 1);
}
if (controlName[i].equals("Npoints")) {
npoints = parseInt(controlValue[i]);
}
if (controlName[i].equals("StarOrPolygon")){
starorpoly = (boolean)(controlValue[i] == 1);
}*/
}
}
}