-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
59 lines (49 loc) · 1.75 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
56
57
58
59
"use strict";
const config = require('config'),
webmixer = require("./webmixer");
if(config.has('ignore_channels'))
{
console.log("default.json needs to be updated. \"ignore_channels\" has been changed to be channels. Instead of a list of \"channels\" to ignore please add the channels that you would like to include.");
return;
}
if(!config.has('channels'))
{
console.log("default.json file does not contain channels key. Please add it to continue. If you don't know the channels to use please add a blank array (\"channels\": []).");
return;
}
if(!config.has('desk.receive_port'))
{
console.log("default.json must include the desk.receive_port");
return;
}
let auxChannels = [];
for(let aux of config.aux)
{
if(auxChannels[aux.channel] !== undefined)
{
console.log("Duplicate aux channel detected in default.json. Channel " + aux.channel + " for " + aux.label + " cannot be the same as " + auxChannels[aux.channel].label + ". Please fix default.json and try again.");
return;
}
auxChannels[aux.channel] = aux;
}
if(config.has('desk.channel_count'))
{
console.log("desk.channel_count is no longer necessary. This config entry has been ignored.");
}
let type = "SD";
if(config.has('desk.type'))
{
type = config.get('desk.type');
}
console.log("Loading DiGiCo " + type + " configuration");
import("./mapping/" + type.toUpperCase() + "-mapping.mjs").then(mappingModule => {
webmixer.init(
config.get('desk.send_port'),
config.get('desk.receive_port'),
config.get('desk.ip'), //remoteAddress
config.get('aux'), //The AUX channels for the session file you will be connecting to
config.get('channels'), // A list of channels that are available to mix with.
config.get('server.port'), // The port for the web server
new mappingModule.default(config)
);
})