forked from respectTheCode/node-caspar-cg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (37 loc) · 931 Bytes
/
index.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
var events = require("events");
var util = require("util");
var _ = require("underscore");
var ccg = module.exports = function (host, port) {
events.EventEmitter.call(this);
if (typeof(host) == "string") {
this.options.host = host;
} else if (typeof(host) == "object") {
_.extend(this.options, host);
}
if (port) {
this.options.port = port;
}
};
util.inherits(ccg, events.EventEmitter);
ccg.prototype.options = {
reconnect: true,
host: "localhost",
port: 5250,
debug: false
};
ccg.prototype.log = function () {
if (!this.options.debug) return;
var args = _.values(arguments);
args.unshift("CCG:");
console.log.apply(console, args);
};
// connection management and command queing
require("./lib/connection")(ccg);
// query commands
require("./lib/query")(ccg);
// query commands
require("./lib/playout")(ccg);
// query data
require("./lib/data")(ccg);
// query templates
require("./lib/template")(ccg);