-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathplayground.js
62 lines (47 loc) · 1.41 KB
/
playground.js
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
var Atem = require('./index');
var Colors = require('colors');
var d = new Atem('10.1.0.215');
console.log('state: ' + d.state);
d.on('connectionStateChange', function(state) {
console.log('state changed: ' + state);
});
//d.on('sourceConfiguration', function (source, conf, info) {
// if (d.state == 2) console.log(info, conf);
//});
d.on('connectionLost', function() {console.log("Connection Lost!".red)});
//d.on('rawCommand', function(cmd) {
// var data;
// if (cmd.data.length > 50) {
// data = '('.grey + String(cmd.data.length).grey + ')'.grey;
// } else {
// data = cmd.data;
// }
// console.log(cmd.name.grey, data);
//});
d.on('error', function(e) {console.log(e)});
d.on('AuxS', function(cmd) {
var data;
if (cmd.length > 50) {
data = '('.grey + String(cmd.length).grey + ')'.grey;
} else {
data = cmd;
}
console.log('AuxS'.grey, data);
});
d.changeSourceConfiguration(0, {name: 'Zwartje', abbreviation: 'ZWRT'})
d.on('error', function(e) {console.trace(e);});
setTimeout(d.connect, 4000);
//d.on('TrPs', function(d) {
// var s = '';
// for (var i = 0; i<d.length; i++){
// s += pad(d[i].toString(2), 8) + " ";
// }
// console.log(d,s);
//});
//var shortName = 'Cam';
//var dots = '';
//setInterval(function() {
// shortName = shortName=='Cam'?'CAM':'Cam';
// dots = dots=='' ? '.' : (dots=='.'? '..' : (dots=='..' ? '...' : ''));
// d.changeInputConfig(2, shortName+'2', 'Camera 2'+dots);
//}, 2000);