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
131
132
|
public class OSCGraphics {
static OscSend @osc_send;
1 => static int free_id;
fun static void
clear()
{
osc_send.startMsg("/layer/*/delete", "");
}
fun static OSCGraphicsImage @
getImage(string name)
{
OSCGraphicsImage img;
osc_send @=> img.osc_send;
name => img.name;
return img;
}
fun static OSCGraphicsImage @
newImage(int pos, int geo[], float opacity, string file)
{
OSCGraphicsImage img;
img.init(osc_send, "image", "s",
pos, "__image_"+free_id, geo, opacity);
file => osc_send.addString;
free_id++;
return img;
}
fun static OSCGraphicsImage @
newImage(int pos, int geo[], float opacity)
{
return newImage(pos, geo, opacity, "");
}
fun static OSCGraphicsImage @
newImage(int pos, int geo[])
{
return newImage(pos, geo, 1., "");
}
fun static OSCGraphicsImage @
newImage(int pos)
{
return newImage(pos, null, 1., "");
}
fun static OSCGraphicsImage @
newImage()
{
return newImage(-1, null, 1., "");
}
fun static OSCGraphicsVideo @
getVideo(string name)
{
OSCGraphicsVideo video;
osc_send @=> video.osc_send;
name => video.name;
return video;
}
fun static OSCGraphicsVideo @
newVideo(int pos, int geo[], float opacity, string url)
{
OSCGraphicsVideo video;
video.init(osc_send, "video", "s",
pos, "__video_"+free_id, geo, opacity);
url => osc_send.addString;
free_id++;
return video;
}
fun static OSCGraphicsVideo @
newVideo(int pos, int geo[], float opacity)
{
return newVideo(pos, geo, 1., "");
}
fun static OSCGraphicsVideo @
newVideo(int pos, int geo[])
{
return newVideo(pos, geo, 1., "");
}
fun static OSCGraphicsVideo @
newVideo(int pos)
{
return newVideo(pos, null, 1., "");
}
fun static OSCGraphicsVideo @
newVideo()
{
return newVideo(-1, null, 1., "");
}
fun static OSCGraphicsBox @
getBox(string name)
{
OSCGraphicsBox box;
osc_send @=> box.osc_send;
name => box.name;
return box;
}
fun static OSCGraphicsBox @
newBox(int pos, int geo[], float opacity, int color[])
{
OSCGraphicsBox box;
box.init(osc_send, "box", "iii",
pos, "__box_"+free_id, geo, opacity);
for (0 => int i; i < 3; i++)
color[i] => osc_send.addInt;
free_id++;
return box;
}
fun static OSCGraphicsBox @
newBox(int pos, int geo[], int color[])
{
return newBox(pos, geo, 1., color);
}
fun static OSCGraphicsBox @
newBox(int pos, int color[])
{
return newBox(pos, null, 1., color);
}
fun static OSCGraphicsBox @
newBox(int color[])
{
return newBox(-1, null, 1., color);
}
}
/* static initialization */
new OscSend @=> OSCGraphics.osc_send;
OSCGraphics.osc_send.setHost("localhost", 7770);
|