-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx_share_out.js
More file actions
50 lines (35 loc) · 982 Bytes
/
x_share_out.js
File metadata and controls
50 lines (35 loc) · 982 Bytes
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
inlets = 1;
outlets = 1;
var currentsystem;
var t = this.patcher;
var glshare;
function checksystem() {
// ask the max object which system is running
currentsystem = max.os;
return currentsystem;
}
function create(x) {
// if we know the system we create a GL Share object depening on System
checksystem();
var videoin = t.getnamed('finalout');
var share_name = x;
if (currentsystem == 'windows') {
glshare = t.newdefault(400, 3060, "jit.gl.spoutsender","XPARTICLE");
glshare.setattr('name',share_name);
glshare.setattr('sendername',share_name);
post('spout created');
} else {
glshare = t.newdefault(400, 3060, "jit.gl.syphonserver","XPARTICLE");
glshare.setattr('name',share_name);
glshare.setattr('servername',share_name);
post('syphon server created');
}
t.connect(videoin,0,glshare,0);
}
function destroy() {
if (glshare) {
t.remove(glshare);
}
}
function loadbang() {
}