-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx_share.js
More file actions
53 lines (40 loc) · 1.04 KB
/
x_share.js
File metadata and controls
53 lines (40 loc) · 1.04 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
52
53
inlets = 1;
outlets = 1;
var currentsystem;
var t = this.patcher;
var videoin = t.getnamed('finalout');
var glshare;
function checksystem() {
// ask the max object which system is running
currentsystem = max.os;
return currentsystem;
}
function init() {
// if we know the system we create a GL Share object depening on System
checksystem();
if (currentsystem == 'windows') {
destroy()
glshare = t.newdefault(400, 3060, "jit.gl.spoutsender","player");
t.connect(videoin,0,glshare,0);
glshare.setattr('sendername','spout_XPARTICLE');
post('spout created');
} else {
destroy();
//recenable.message('int', 0);
//recstate.message('int', 0);
glshare = t.newdefault(400, 3060, "jit.gl.syphonserver","player");
t.connect(videoin,0,glshare,0);
glshare.setattr('name','gl-share');
glshare.setattr('servername','syphon_XPARTICLE');
post('syphon created');
}
}
function destroy() {
if (glshare) {
t.remove(glshare);
}
}
function loadbang() {
destroy();
init();
}