-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvalue_handler.js
More file actions
50 lines (40 loc) · 733 Bytes
/
Copy pathvalue_handler.js
File metadata and controls
50 lines (40 loc) · 733 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
var myval=0;
outlets = 2;
if (jsarguments.length>1)
myval = jsarguments[1];
function bang()
{
outlet(0, myval);
}
function msg_int(v)
{
// post("received int " + v + "\n");
myval = v;
bang();
}
function msg_float(v)
{
// post("received float " + v + "\n");
myval = v;
bang();
}
function list()
{
var a = arrayfromargs(arguments);
// post("received list " + a.length + "\n");
myval = a;
bang();
}
function dictionary(data)
{
// set incoming data as dict
var newDict = new Dict(data);
// if chat, parse for id and chat message
if(newDict.contains("chat")){
outlet(0, 'id', newDict.get('id'));
outlet(0, 'chat', newDict.get('chat'));
}
}
function noHeader(){
outlet(1, '-err, no control header, yet');
}