forked from bitfocus/companion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtablet.js
51 lines (38 loc) · 1.19 KB
/
tablet.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
/*
* This file is part of the Companion project
* Copyright (c) 2018 Bitfocus AS
* Authors: William Viker <[email protected]>, Håkon Nessjøen <[email protected]>
*
* This program is free software.
* You should have received a copy of the MIT licence as well as the Bitfocus
* Individual Contributor License Agreement for companion along with
* this program.
*
* You can be released from the requirements of the license by purchasing
* a commercial license. Buying such a license is mandatory as soon as you
* develop commercial activities involving the Companion software without
* disclosing the source code of your own applications.
*
*/
var debug = require('debug')('lib/tablet');
var system;
function tablet(system) {
var self = this;
self.tablet = {};
system.on('get_tablet', function(cb) {
cb(self.tablet);
});
system.emit('io_get', function (io) {
system.on('io_connect', function (socket) {
debug('socket ' + socket.id + ' connected');
socket.on('tablet_startup', function() {
});
socket.on('disconnect', function () {
debug('socket ' + socket.id + ' disconnected');
});
});
});
}
module.exports = function (system) {
return new tablet(system);
};