forked from respectTheCode/node-caspar-cg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (43 loc) · 1.07 KB
/
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
47
48
49
50
51
52
53
54
55
"use strict";
var events = require("events");
var util = require("util");
var _ = require("underscore");
var count = 0;
var ccg = module.exports = function (host, port) {
events.EventEmitter.call(this);
this.options = _.extend({}, this.options);
if (typeof(host) == "string") {
this.options.host = host;
} else if (typeof(host) == "object") {
_.extend(this.options, host);
}
if (port) {
this.options.port = port;
}
this.index = count++;
};
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" + this.index + ":");
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);
// mixer commands
require("./lib/mixer")(ccg);