mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-13 17:53:39 +00:00
Initial prettify
This commit is contained in:
+53
-54
@@ -1,69 +1,68 @@
|
||||
table{
|
||||
background-color: #141414;
|
||||
border: #404040 1px solid;
|
||||
border-radius: 4px;
|
||||
color: #a59baa;
|
||||
table {
|
||||
background-color: #141414;
|
||||
border: #404040 1px solid;
|
||||
border-radius: 4px;
|
||||
color: #a59baa;
|
||||
}
|
||||
th{
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 5px;
|
||||
th {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
padding: 5px;
|
||||
}
|
||||
td{
|
||||
text-align: center;
|
||||
padding: 6px;
|
||||
td {
|
||||
text-align: center;
|
||||
padding: 6px;
|
||||
}
|
||||
td:first-child{
|
||||
text-align: left;
|
||||
td:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
td.black{
|
||||
background-color: black;
|
||||
border-right: #212021 1px solid;
|
||||
td.black {
|
||||
background-color: black;
|
||||
border-right: #212021 1px solid;
|
||||
}
|
||||
td.num{
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
td.num {
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
.scene{
|
||||
background-color: black;
|
||||
border-top: #141414 2px solid;
|
||||
border-bottom: #141414 2px solid;
|
||||
.scene {
|
||||
background-color: black;
|
||||
border-top: #141414 2px solid;
|
||||
border-bottom: #141414 2px solid;
|
||||
}
|
||||
.scene hr{
|
||||
border: #001f10 4px solid;
|
||||
.scene hr {
|
||||
border: #001f10 4px solid;
|
||||
}
|
||||
.scene span{
|
||||
display: table;
|
||||
margin: 0px auto;
|
||||
margin-top: -25px;
|
||||
padding: 4px;
|
||||
background-color: black;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
.scene span {
|
||||
display: table;
|
||||
margin: 0px auto;
|
||||
margin-top: -25px;
|
||||
padding: 4px;
|
||||
background-color: black;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
.time{
|
||||
border: #2f2b35 2px solid;
|
||||
border-radius: 5px;
|
||||
.time {
|
||||
border: #2f2b35 2px solid;
|
||||
border-radius: 5px;
|
||||
}
|
||||
tr.active-cue{
|
||||
color: #d49800;
|
||||
tr.active-cue {
|
||||
color: #d49800;
|
||||
}
|
||||
tr.active-cue td.num {
|
||||
color: #d49800;
|
||||
}
|
||||
tr.active-cue .time {
|
||||
border-color: #d49800;
|
||||
}
|
||||
tr.active-cue td.num{
|
||||
color: #d49800;
|
||||
}
|
||||
tr.active-cue .time{
|
||||
border-color: #d49800;
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width: 0px) and (max-width: 750px) {
|
||||
.hide-medium{
|
||||
display: none;
|
||||
}
|
||||
.hide-medium {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 0px) and (max-width: 550px) {
|
||||
.hide-small{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.hide-small {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
+133
-104
@@ -1,115 +1,144 @@
|
||||
exports.defaultName = "ETC Eos";
|
||||
exports.connectionType = "osc";
|
||||
exports.defaultName = 'ETC Eos';
|
||||
exports.connectionType = 'osc';
|
||||
exports.searchOptions = {
|
||||
type: "TCPport",
|
||||
searchBuffer: Buffer.from("\xc0/eos/ping\x00\x00\x2c\x00\x00\x00\xc0", 'ascii'),
|
||||
testPort: 3032,
|
||||
validateResponse: function(msg, info){
|
||||
return (msg.toString().indexOf("/eos/out"));
|
||||
}
|
||||
}
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from(
|
||||
'\xc0/eos/ping\x00\x00\x2c\x00\x00\x00\xc0',
|
||||
'ascii'
|
||||
),
|
||||
testPort: 3032,
|
||||
validateResponse: function (msg, info) {
|
||||
return msg.toString().indexOf('/eos/out');
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 3032;
|
||||
|
||||
//"\xc0/eos/ping\x00\x00\x2c\x00\x00\x00\xc0"
|
||||
|
||||
exports.ready = function (device) {
|
||||
device.send('/eos/get/cuelist/count');
|
||||
device.send('/eos/get/version');
|
||||
device.send('/eos/subscribe', [{ type: 'i', value: 1 }]);
|
||||
};
|
||||
|
||||
exports.ready = function(device){
|
||||
device.send("/eos/get/cuelist/count");
|
||||
device.send("/eos/get/version");
|
||||
device.send("/eos/subscribe", [{type: "i", value: 1}]);
|
||||
}
|
||||
exports.data = function (device, osc) {
|
||||
var address = osc.address;
|
||||
var p = osc.address.split('/');
|
||||
p.shift();
|
||||
|
||||
exports.data = function(device, osc){
|
||||
var address = osc.address;
|
||||
var p = osc.address.split("/");
|
||||
p.shift();
|
||||
if (p[1] == 'out' && p[2] == 'show' && p[3] == 'name') {
|
||||
device.data.showName = osc.args[0];
|
||||
device.data.cuelists = {};
|
||||
this.deviceInfoUpdate(device, 'defaultName', osc.args[0]);
|
||||
} else if (osc.address == '/eos/out/get/cuelist/count') {
|
||||
for (var i = 0; i < osc.args[0]; i++) {
|
||||
device.send('/eos/get/cuelist/index/' + i);
|
||||
}
|
||||
} else if (
|
||||
p[1] == 'out' &&
|
||||
p[2] == 'get' &&
|
||||
p[3] == 'cuelist' &&
|
||||
p[5] == 'list'
|
||||
) {
|
||||
device.data.cuelists[p[4]] = {};
|
||||
device.send('/eos/get/cue/' + p[4] + '/count');
|
||||
} else if (
|
||||
p[1] == 'out' &&
|
||||
p[2] == 'get' &&
|
||||
p[3] == 'cue' &&
|
||||
p[5] == 'count'
|
||||
) {
|
||||
for (var i = 0; i < osc.args[0]; i++) {
|
||||
device.send('/eos/get/cue/' + p[4] + '/index/' + i);
|
||||
}
|
||||
} else if (
|
||||
p[1] == 'out' &&
|
||||
p[2] == 'get' &&
|
||||
p[3] == 'cue' &&
|
||||
p[7] == 'list'
|
||||
) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
if (device.data.cuelists[p[4]][p[5]] == undefined) {
|
||||
device.data.cuelists[p[4]][p[5]] = {};
|
||||
}
|
||||
device.data.cuelists[p[4]][p[5]][p[6]] = {
|
||||
uid: osc.args[1],
|
||||
label: osc.args[2],
|
||||
uptimeduration: osc.args[3],
|
||||
uptimedelay: osc.args[4],
|
||||
downtimeduration: osc.args[5],
|
||||
downtimedelay: osc.args[6],
|
||||
focustimeduration: osc.args[7],
|
||||
focustimedelay: osc.args[8],
|
||||
colortimeduration: osc.args[9],
|
||||
colortimedelay: osc.args[10],
|
||||
beamtimeduration: osc.args[11],
|
||||
beamtimedelay: osc.args[12],
|
||||
mark: osc.args[16],
|
||||
block: osc.args[17],
|
||||
assert: osc.args[18],
|
||||
follow: osc.args[20],
|
||||
hang: osc.args[21],
|
||||
partcount: osc.args[26],
|
||||
scene: osc.args[28],
|
||||
duration: Math.max(
|
||||
osc.args[3],
|
||||
osc.args[5],
|
||||
osc.args[7],
|
||||
osc.args[9],
|
||||
osc.args[11]
|
||||
),
|
||||
};
|
||||
|
||||
if(p[1]=="out" && p[2]=="show" && p[3]=="name"){
|
||||
device.data.showName = osc.args[0];
|
||||
device.data.cuelists = {};
|
||||
this.deviceInfoUpdate(device, "defaultName", osc.args[0]);
|
||||
}else if(osc.address=="/eos/out/get/cuelist/count"){
|
||||
for(var i=0; i<osc.args[0]; i++){
|
||||
device.send("/eos/get/cuelist/index/"+i);
|
||||
}
|
||||
}else if(p[1]=="out" && p[2]=="get" && p[3]=="cuelist" && p[5]=="list"){
|
||||
device.data.cuelists[p[4]] = {};
|
||||
device.send("/eos/get/cue/"+p[4]+"/count");
|
||||
}else if(p[1]=="out" && p[2]=="get" && p[3]=="cue" && p[5]=="count"){
|
||||
for(var i=0; i<osc.args[0]; i++){
|
||||
device.send("/eos/get/cue/"+p[4]+"/index/"+i);
|
||||
}
|
||||
}else if(p[1]=="out" && p[2]=="get" && p[3]=="cue" && p[7]=="list"){
|
||||
this.deviceInfoUpdate(device, "status", "ok");
|
||||
if(device.data.cuelists[p[4]][p[5]]==undefined){
|
||||
device.data.cuelists[p[4]][p[5]] = {};
|
||||
}
|
||||
device.data.cuelists[p[4]][p[5]][p[6]] = {
|
||||
uid: osc.args[1],
|
||||
label: osc.args[2],
|
||||
uptimeduration: osc.args[3],
|
||||
uptimedelay: osc.args[4],
|
||||
downtimeduration: osc.args[5],
|
||||
downtimedelay: osc.args[6],
|
||||
focustimeduration: osc.args[7],
|
||||
focustimedelay: osc.args[8],
|
||||
colortimeduration: osc.args[9],
|
||||
colortimedelay: osc.args[10],
|
||||
beamtimeduration: osc.args[11],
|
||||
beamtimedelay: osc.args[12],
|
||||
mark: osc.args[16],
|
||||
block: osc.args[17],
|
||||
assert: osc.args[18],
|
||||
follow: osc.args[20],
|
||||
hang: osc.args[21],
|
||||
partcount: osc.args[26],
|
||||
scene: osc.args[28],
|
||||
duration: Math.max(osc.args[3], osc.args[5], osc.args[7], osc.args[9], osc.args[11])
|
||||
};
|
||||
//console.log(p[4]+" "+p[5]+" "+p[6]+" updated")
|
||||
device.draw();
|
||||
} else if (p[1] == 'out' && p[2] == 'get' && p[3] == 'cue' && p.length == 6) {
|
||||
//console.log("cue "+p[4]+" "+p[5]+" deleted")
|
||||
|
||||
//console.log(p[4]+" "+p[5]+" "+p[6]+" updated")
|
||||
device.draw();
|
||||
// There's no OSC notification of the deletion of a part. It just tells you to update the parent cue and remaining children.
|
||||
// So: we should fetch all the parts of a cue somehow every time there's an update to a cue.
|
||||
|
||||
}else if(p[1]=="out" && p[2]=="get" && p[3]=="cue" && p.length==6){
|
||||
|
||||
//console.log("cue "+p[4]+" "+p[5]+" deleted")
|
||||
|
||||
|
||||
// There's no OSC notification of the deletion of a part. It just tells you to update the parent cue and remaining children.
|
||||
// So: we should fetch all the parts of a cue somehow every time there's an update to a cue.
|
||||
|
||||
|
||||
|
||||
delete device.data.cuelists[p[4]][p[5]];
|
||||
device.draw();
|
||||
|
||||
}else if(p[1]=="out" && p[2]=="get" && p[3]=="cue" && p[7]=="actions"){
|
||||
if(osc.args.length==3){
|
||||
device.data.cuelists[p[4]][p[5]][0].extlinks = osc.args[2];
|
||||
}
|
||||
}else if(p[1]=="out" && p[2]=="event" && p[3]=="cue" && p[6]=="fire"){
|
||||
// explore replacing this with /eos/out/active/cue
|
||||
device.data.activeCue = p[5];
|
||||
device.draw();
|
||||
}else if(p[1]=="out" && p[2]=="notify" && p[3]=="cue"){
|
||||
var cueList = p[4];
|
||||
var listIndex = p[6];
|
||||
var listCount = p[7];
|
||||
var cueNumber = osc.args[1];
|
||||
|
||||
device.send("/eos/get/cue/"+cueList+"/"+cueNumber);
|
||||
//console.log("SENT /eos/get/cue/"+cueList+"/"+cueNumber);
|
||||
}else if(p[2]=="cmd" || p[2]=="ping" || p[2]=="user" || p[2]=="softkey"){
|
||||
|
||||
}else if(p[3]=="version"){
|
||||
device.data.version = osc.args[0];
|
||||
|
||||
}else{
|
||||
//console.log(osc);
|
||||
}
|
||||
//console.log(p)
|
||||
}
|
||||
exports.heartbeat = function(device){
|
||||
device.send("/eos/ping");
|
||||
}
|
||||
delete device.data.cuelists[p[4]][p[5]];
|
||||
device.draw();
|
||||
} else if (
|
||||
p[1] == 'out' &&
|
||||
p[2] == 'get' &&
|
||||
p[3] == 'cue' &&
|
||||
p[7] == 'actions'
|
||||
) {
|
||||
if (osc.args.length == 3) {
|
||||
device.data.cuelists[p[4]][p[5]][0].extlinks = osc.args[2];
|
||||
}
|
||||
} else if (
|
||||
p[1] == 'out' &&
|
||||
p[2] == 'event' &&
|
||||
p[3] == 'cue' &&
|
||||
p[6] == 'fire'
|
||||
) {
|
||||
// explore replacing this with /eos/out/active/cue
|
||||
device.data.activeCue = p[5];
|
||||
device.draw();
|
||||
} else if (p[1] == 'out' && p[2] == 'notify' && p[3] == 'cue') {
|
||||
var cueList = p[4];
|
||||
var listIndex = p[6];
|
||||
var listCount = p[7];
|
||||
var cueNumber = osc.args[1];
|
||||
|
||||
device.send('/eos/get/cue/' + cueList + '/' + cueNumber);
|
||||
//console.log("SENT /eos/get/cue/"+cueList+"/"+cueNumber);
|
||||
} else if (
|
||||
p[2] == 'cmd' ||
|
||||
p[2] == 'ping' ||
|
||||
p[2] == 'user' ||
|
||||
p[2] == 'softkey'
|
||||
) {
|
||||
} else if (p[3] == 'version') {
|
||||
device.data.version = osc.args[0];
|
||||
} else {
|
||||
//console.log(osc);
|
||||
}
|
||||
//console.log(p)
|
||||
};
|
||||
exports.heartbeat = function (device) {
|
||||
device.send('/eos/ping');
|
||||
};
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
.warning{
|
||||
color: #e9873a;
|
||||
.warning {
|
||||
color: #e9873a;
|
||||
}
|
||||
.error{
|
||||
color: #ed5f5d;
|
||||
.error {
|
||||
color: #ed5f5d;
|
||||
}
|
||||
.ok{
|
||||
color: #79b757;
|
||||
.ok {
|
||||
color: #79b757;
|
||||
}
|
||||
|
||||
+112
-106
@@ -1,116 +1,122 @@
|
||||
exports.defaultName = "PJLink Projector";
|
||||
exports.connectionType = "TCPsocket";
|
||||
exports.defaultName = 'PJLink Projector';
|
||||
exports.connectionType = 'TCPsocket';
|
||||
exports.heartbeatInterval = 5000;
|
||||
exports.searchOptions = {
|
||||
type: "UDPsocket",
|
||||
searchBuffer: Buffer.from([0x25, 0x32, 0x53, 0x52, 0x43, 0x48, 0x0d]),
|
||||
devicePort: 4352,
|
||||
listenPort: 4352,
|
||||
validateResponse: function(msg, info){
|
||||
return (msg.toString().indexOf("%2ACKN=")>=0);
|
||||
}
|
||||
}
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x25, 0x32, 0x53, 0x52, 0x43, 0x48, 0x0d]),
|
||||
devicePort: 4352,
|
||||
listenPort: 4352,
|
||||
validateResponse: function (msg, info) {
|
||||
return msg.toString().indexOf('%2ACKN=') >= 0;
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 4352;
|
||||
|
||||
exports.ready = function(device){
|
||||
//Power status query
|
||||
//device.send("%1POWR ?\r");
|
||||
}
|
||||
exports.ready = function (device) {
|
||||
//Power status query
|
||||
//device.send("%1POWR ?\r");
|
||||
};
|
||||
var password = false;
|
||||
|
||||
exports.data = function(device, message){
|
||||
this.deviceInfoUpdate(device, "status", "ok");
|
||||
var msg = message.toString();
|
||||
exports.data = function (device, message) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
var msg = message.toString();
|
||||
|
||||
const md5 = require("md5");
|
||||
const md5 = require('md5');
|
||||
|
||||
if(msg.substring(0, 8)=="PJLINK 1"){
|
||||
password = md5(msg.substring(9, 17)+"JBMIAProjectorLink")
|
||||
device.send(password+"%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r");
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1POWR="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1INPT="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1AVMT="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1ERST="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1LAMP="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1NAME="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1INF1="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%1INF2="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%2SNUM="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if(msg.substring(0, 7)=="%2SVER="){
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 8) == 'PJLINK 1') {
|
||||
password = md5(msg.substring(9, 17) + 'JBMIAProjectorLink');
|
||||
device.send(
|
||||
password +
|
||||
'%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r'
|
||||
);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1POWR=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1INPT=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1AVMT=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1ERST=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1LAMP=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1NAME=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1INF1=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%1INF2=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%2SNUM=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
if (msg.substring(0, 7) == '%2SVER=') {
|
||||
processPJLink(device, msg, this);
|
||||
}
|
||||
};
|
||||
|
||||
function processPJLink(device, str, that) {
|
||||
var arr = str.split('%');
|
||||
for (var key in arr) {
|
||||
var split = arr[key].split('=');
|
||||
var key = split[0];
|
||||
var value = split[1];
|
||||
|
||||
switch (key) {
|
||||
case '1POWR':
|
||||
device.data.power = value;
|
||||
break;
|
||||
case '1INPT':
|
||||
device.data.input = value;
|
||||
break;
|
||||
case '1AVMT':
|
||||
device.data.avmute = value;
|
||||
break;
|
||||
case '1ERST':
|
||||
device.data.fanError = value[0];
|
||||
device.data.lampError = value[1];
|
||||
device.data.tempError = value[2];
|
||||
device.data.coverError = value[3];
|
||||
device.data.filterError = value[4];
|
||||
device.data.otherError = value[5];
|
||||
break;
|
||||
case '1LAMP':
|
||||
device.data.lamp = value.split(' ');
|
||||
break;
|
||||
case '1NAME':
|
||||
device.data.name = value;
|
||||
that.deviceInfoUpdate(device, 'defaultName', device.data.name);
|
||||
break;
|
||||
case '1INF1':
|
||||
device.data.info1 = value;
|
||||
break;
|
||||
case '1INF2':
|
||||
device.data.info2 = value;
|
||||
break;
|
||||
case '2SNUM':
|
||||
device.data.serial = value;
|
||||
break;
|
||||
case '2SVER':
|
||||
device.data.version = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
device.draw();
|
||||
}
|
||||
|
||||
function processPJLink(device, str, that){
|
||||
var arr = str.split("%");
|
||||
for(var key in arr){
|
||||
var split = arr[key].split("=");
|
||||
var key = split[0];
|
||||
var value = split[1];
|
||||
|
||||
switch(key){
|
||||
case "1POWR":
|
||||
device.data.power = value;
|
||||
break;
|
||||
case "1INPT":
|
||||
device.data.input = value;
|
||||
break;
|
||||
case "1AVMT":
|
||||
device.data.avmute = value;
|
||||
break;
|
||||
case "1ERST":
|
||||
device.data.fanError = value[0];
|
||||
device.data.lampError = value[1];
|
||||
device.data.tempError = value[2];
|
||||
device.data.coverError = value[3];
|
||||
device.data.filterError = value[4];
|
||||
device.data.otherError = value[5];
|
||||
break;
|
||||
case "1LAMP":
|
||||
device.data.lamp = value.split(" ");
|
||||
break;
|
||||
case "1NAME":
|
||||
device.data.name = value;
|
||||
that.deviceInfoUpdate(device, "defaultName", device.data.name);
|
||||
break;
|
||||
case "1INF1":
|
||||
device.data.info1 = value;
|
||||
break;
|
||||
case "1INF2":
|
||||
device.data.info2 = value;
|
||||
break;
|
||||
case "2SNUM":
|
||||
device.data.serial = value;
|
||||
break;
|
||||
case "2SVER":
|
||||
device.data.version = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
device.draw();
|
||||
}
|
||||
|
||||
exports.heartbeat = function(device){
|
||||
if(password){
|
||||
device.send(password+"%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r");
|
||||
}
|
||||
}
|
||||
exports.heartbeat = function (device) {
|
||||
if (password) {
|
||||
device.send(
|
||||
password +
|
||||
'%1POWR ?\r%1INPT ?\r%1AVMT ?\r%1ERST ?\r%1LAMP ?\r%1NAME ?\r%1INF1 ?\r%1INF2 ?\r%2SNUM ?\r%2SVER ?\r'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
+147
-154
@@ -1,189 +1,182 @@
|
||||
table{
|
||||
background-color: #323232;
|
||||
border: 0px;
|
||||
color: #b8b8b8;
|
||||
font-family: sans-serif;
|
||||
width: 100%;
|
||||
table-layout:fixed;
|
||||
margin-bottom: 30px;
|
||||
table {
|
||||
background-color: #323232;
|
||||
border: 0px;
|
||||
color: #b8b8b8;
|
||||
font-family: sans-serif;
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
th{
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
padding: 0px 4px;
|
||||
background-color: #2d2c2d;
|
||||
border: #545454 1px solid;
|
||||
border-right: none;
|
||||
th {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
padding: 0px 4px;
|
||||
background-color: #2d2c2d;
|
||||
border: #545454 1px solid;
|
||||
border-right: none;
|
||||
}
|
||||
th.no-border{
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
td{
|
||||
padding: 0px;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
th.no-border {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
padding: 0px;
|
||||
}
|
||||
td img{
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
|
||||
td {
|
||||
padding: 0px;
|
||||
height: 25px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
td img {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background: #2c2c2c;
|
||||
background: #2c2c2c;
|
||||
}
|
||||
tr:nth-child(odd) {
|
||||
background: #323232;
|
||||
background: #323232;
|
||||
}
|
||||
|
||||
|
||||
tr:nth-child(even).q-red{
|
||||
background: linear-gradient(to top, #2c2c2c, #4c3130 1px);
|
||||
tr:nth-child(even).q-red {
|
||||
background: linear-gradient(to top, #2c2c2c, #4c3130 1px);
|
||||
}
|
||||
tr:nth-child(odd).q-red{
|
||||
background: linear-gradient(to top, #323232, #513635 1px);
|
||||
tr:nth-child(odd).q-red {
|
||||
background: linear-gradient(to top, #323232, #513635 1px);
|
||||
}
|
||||
.q-red td:first-of-type{
|
||||
padding-left: 5px;
|
||||
border-left: 5px #ff4242 solid;
|
||||
}
|
||||
tr:nth-child(even).q-orange{
|
||||
background: linear-gradient(to top, #2c2c2c, #4b3e2a 1px);
|
||||
.q-red td:first-of-type {
|
||||
padding-left: 5px;
|
||||
border-left: 5px #ff4242 solid;
|
||||
}
|
||||
tr:nth-child(odd).q-orange{
|
||||
background: linear-gradient(to top, #323232, #514330 1px);
|
||||
tr:nth-child(even).q-orange {
|
||||
background: linear-gradient(to top, #2c2c2c, #4b3e2a 1px);
|
||||
}
|
||||
.q-orange td:first-of-type{
|
||||
padding-left: 5px;
|
||||
border-left: 5px #ffa500 solid;
|
||||
}
|
||||
tr:nth-child(even).q-green{
|
||||
background: linear-gradient(to top, #2c2c2c, #2d452d 1px);
|
||||
tr:nth-child(odd).q-orange {
|
||||
background: linear-gradient(to top, #323232, #514330 1px);
|
||||
}
|
||||
tr:nth-child(odd).q-green{
|
||||
background: linear-gradient(to top, #323232, #324b33 1px);
|
||||
.q-orange td:first-of-type {
|
||||
padding-left: 5px;
|
||||
border-left: 5px #ffa500 solid;
|
||||
}
|
||||
.q-green td:first-of-type{
|
||||
padding-left: 5px;
|
||||
border-left: 5px #01d52f solid;
|
||||
}
|
||||
tr:nth-child(even).q-blue{
|
||||
background: linear-gradient(to top, #2c2c2c, #323647 1px);
|
||||
tr:nth-child(even).q-green {
|
||||
background: linear-gradient(to top, #2c2c2c, #2d452d 1px);
|
||||
}
|
||||
tr:nth-child(odd).q-blue{
|
||||
background: linear-gradient(to top, #323232, #363b4b 1px);
|
||||
tr:nth-child(odd).q-green {
|
||||
background: linear-gradient(to top, #323232, #324b33 1px);
|
||||
}
|
||||
.q-blue td:first-of-type{
|
||||
padding-left: 5px;
|
||||
border-left: 5px #536de0 solid;
|
||||
}
|
||||
tr:nth-child(even).q-purple{
|
||||
background: linear-gradient(to top, #2c2c2c, #39273d 1px);
|
||||
.q-green td:first-of-type {
|
||||
padding-left: 5px;
|
||||
border-left: 5px #01d52f solid;
|
||||
}
|
||||
tr:nth-child(odd).q-purple{
|
||||
background: linear-gradient(to top, #323232, #433147 1px);
|
||||
tr:nth-child(even).q-blue {
|
||||
background: linear-gradient(to top, #2c2c2c, #323647 1px);
|
||||
}
|
||||
.q-purple td:first-of-type{
|
||||
padding-left: 5px;
|
||||
border-left: 5px #a601c0 solid;
|
||||
}
|
||||
|
||||
tr.q-armed-false td{
|
||||
background: url("img/disarmed-pattern-light.png");
|
||||
background-attachment: fixed;
|
||||
tr:nth-child(odd).q-blue {
|
||||
background: linear-gradient(to top, #323232, #363b4b 1px);
|
||||
}
|
||||
.q-blue td:first-of-type {
|
||||
padding-left: 5px;
|
||||
border-left: 5px #536de0 solid;
|
||||
}
|
||||
tr:nth-child(even).q-purple {
|
||||
background: linear-gradient(to top, #2c2c2c, #39273d 1px);
|
||||
}
|
||||
tr:nth-child(odd).q-purple {
|
||||
background: linear-gradient(to top, #323232, #433147 1px);
|
||||
}
|
||||
.q-purple td:first-of-type {
|
||||
padding-left: 5px;
|
||||
border-left: 5px #a601c0 solid;
|
||||
}
|
||||
|
||||
|
||||
tr.playback-position{
|
||||
background-image: none !important;
|
||||
background: #1557da !important;
|
||||
color: white !important;
|
||||
}
|
||||
tr.playback-position .q-gray-text{
|
||||
color: white !important;
|
||||
tr.q-armed-false td {
|
||||
background: url('img/disarmed-pattern-light.png');
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
|
||||
.gLeft{
|
||||
height: 24px;
|
||||
width: 12px;
|
||||
border-left: 2px solid;
|
||||
tr.playback-position {
|
||||
background-image: none !important;
|
||||
background: #1557da !important;
|
||||
color: white !important;
|
||||
}
|
||||
.gTop{
|
||||
border-top: 2px solid;
|
||||
}
|
||||
.gBot{
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
.gRight{
|
||||
border-right: 2px solid;
|
||||
}
|
||||
.gMode-1.gLeft.gTop{
|
||||
border-radius: 6px 0px 0px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gBot{
|
||||
border-radius: 0px 0px 0px 6px;
|
||||
}
|
||||
.gMode-1.gRight.gBot{
|
||||
border-radius: 0px 0px 6px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gBot{
|
||||
border-radius: 6px 0px 0px 6px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gRight{
|
||||
border-radius: 6px 6px 0px 0px;
|
||||
}
|
||||
.gMode-1.gTop.gRight.gBot{
|
||||
border-radius: 0px 6px 6px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gRight.gBot{
|
||||
border-radius: 6px;
|
||||
}
|
||||
.gMode-1{
|
||||
border-color: #5a5a87;
|
||||
}
|
||||
.gMode-2{
|
||||
border-color: #5a5a87;
|
||||
}
|
||||
.gMode-3{
|
||||
border-color: #429242;
|
||||
}
|
||||
.gMode-4{
|
||||
border-color: #925fc0;
|
||||
}
|
||||
.gMode-, .gMode-0{
|
||||
border-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
.group-arrow{
|
||||
width: 13px;
|
||||
background-image: url("img/arrow-down.png");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
tr.playback-position .q-gray-text {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.q-time{
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
.gLeft {
|
||||
height: 24px;
|
||||
width: 12px;
|
||||
border-left: 2px solid;
|
||||
}
|
||||
.q-gray-text{
|
||||
color: #424242;
|
||||
.gTop {
|
||||
border-top: 2px solid;
|
||||
}
|
||||
.gBot {
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
.gRight {
|
||||
border-right: 2px solid;
|
||||
}
|
||||
.gMode-1.gLeft.gTop {
|
||||
border-radius: 6px 0px 0px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gBot {
|
||||
border-radius: 0px 0px 0px 6px;
|
||||
}
|
||||
.gMode-1.gRight.gBot {
|
||||
border-radius: 0px 0px 6px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gBot {
|
||||
border-radius: 6px 0px 0px 6px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gRight {
|
||||
border-radius: 6px 6px 0px 0px;
|
||||
}
|
||||
.gMode-1.gTop.gRight.gBot {
|
||||
border-radius: 0px 6px 6px 0px;
|
||||
}
|
||||
.gMode-1.gLeft.gTop.gRight.gBot {
|
||||
border-radius: 6px;
|
||||
}
|
||||
.gMode-1 {
|
||||
border-color: #5a5a87;
|
||||
}
|
||||
.gMode-2 {
|
||||
border-color: #5a5a87;
|
||||
}
|
||||
.gMode-3 {
|
||||
border-color: #429242;
|
||||
}
|
||||
.gMode-4 {
|
||||
border-color: #925fc0;
|
||||
}
|
||||
.gMode-,
|
||||
.gMode-0 {
|
||||
border-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
.group-arrow {
|
||||
width: 13px;
|
||||
background-image: url('img/arrow-down.png');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
.q-time {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
.q-gray-text {
|
||||
color: #424242;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 0px) and (max-width: 750px) {
|
||||
.hide-medium{
|
||||
display: none;
|
||||
}
|
||||
.hide-medium {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 0px) and (max-width: 550px) {
|
||||
.hide-small{
|
||||
display: none;
|
||||
}
|
||||
.hide-small {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+130
-113
@@ -1,133 +1,150 @@
|
||||
exports.defaultName = "QLab 4";
|
||||
exports.connectionType = "osc";
|
||||
exports.defaultName = 'QLab 4';
|
||||
exports.connectionType = 'osc';
|
||||
exports.searchOptions = {
|
||||
type: "Bonjour",
|
||||
bonjourName: "qlab"
|
||||
}
|
||||
type: 'Bonjour',
|
||||
bonjourName: 'qlab',
|
||||
};
|
||||
|
||||
exports.ready = function (device) {
|
||||
device.send('/workspaces');
|
||||
};
|
||||
|
||||
exports.data = function (device, osc) {
|
||||
var address = osc.address;
|
||||
var p = osc.address.split('/');
|
||||
p.shift();
|
||||
|
||||
exports.ready = function(device){
|
||||
device.send("/workspaces");
|
||||
}
|
||||
//console.log(address)
|
||||
|
||||
exports.data = function(device, osc){
|
||||
var address = osc.address;
|
||||
var p = osc.address.split("/");
|
||||
p.shift();
|
||||
if (osc.address == '/reply/workspaces') {
|
||||
const d = JSON.parse(osc.args[0]).data;
|
||||
device.data.workspaces = {};
|
||||
for (var i = 0; i < d.length; i++) {
|
||||
device.data.workspaces[d[i].uniqueID] = {
|
||||
displayName: d[i].displayName,
|
||||
selectionIsPlayhead: true,
|
||||
};
|
||||
device.data.version = d[i].version;
|
||||
device.send('/workspace/' + d[i].uniqueID + '/cueLists');
|
||||
device.send('/workspace/' + d[i].uniqueID + '/updates', [
|
||||
{ type: 'i', value: 1 },
|
||||
]);
|
||||
device.send('/cue/playbackPosition/uniqueID');
|
||||
device.send('/workspace/' + d[i].uniqueID + '/selectionIsPlayhead');
|
||||
}
|
||||
} else if (p[1] == 'workspace' && p[3] == 'cueLists') {
|
||||
var workspace = p[2];
|
||||
var d = JSON.parse(osc.args[0]).data;
|
||||
device.data.workspaces[workspace].cueLists = {};
|
||||
device.data.workspaces[workspace].allCues = {};
|
||||
device.data.workspaces[workspace].allCuesOrdered = [];
|
||||
device.data.lastCueInGroup = {};
|
||||
|
||||
//console.log(address)
|
||||
for (var i in d) {
|
||||
device.data.workspaces[workspace].cueLists[d[i].uniqueID] = d[i];
|
||||
device.data.workspaces[workspace].cueLists[d[i].uniqueID].cues =
|
||||
d[i].cues;
|
||||
|
||||
if(osc.address=="/reply/workspaces"){
|
||||
const d = JSON.parse(osc.args[0]).data;
|
||||
device.data.workspaces = {};
|
||||
for(var i=0; i<d.length; i++){
|
||||
device.data.workspaces[d[i].uniqueID] = {
|
||||
"displayName": d[i].displayName,
|
||||
"selectionIsPlayhead": true,
|
||||
}
|
||||
device.data.version = d[i].version;
|
||||
device.send("/workspace/"+d[i].uniqueID+"/cueLists");
|
||||
device.send("/workspace/"+d[i].uniqueID+"/updates", [{type: "i", value: 1}]);
|
||||
device.send("/cue/playbackPosition/uniqueID");
|
||||
device.send("/workspace/"+d[i].uniqueID+"/selectionIsPlayhead");
|
||||
}
|
||||
getMoreCueInfo(d[i], []);
|
||||
|
||||
}else if(p[1]=="workspace" && p[3]=="cueLists"){
|
||||
var workspace = p[2];
|
||||
var d = JSON.parse(osc.args[0]).data;
|
||||
device.data.workspaces[workspace].cueLists = {};
|
||||
device.data.workspaces[workspace].allCues = {};
|
||||
device.data.workspaces[workspace].allCuesOrdered = [];
|
||||
device.data.lastCueInGroup = {};
|
||||
function getMoreCueInfo(group, groups_arg) {
|
||||
var groups = JSON.parse(JSON.stringify(groups_arg));
|
||||
groups.push(group.uniqueID);
|
||||
|
||||
for(var i in d){
|
||||
for (var cueIndex in group.cues) {
|
||||
var cue = group.cues[cueIndex];
|
||||
//console.log(cue)
|
||||
|
||||
device.data.workspaces[workspace].cueLists[d[i].uniqueID]=d[i];
|
||||
device.data.workspaces[workspace].cueLists[d[i].uniqueID].cues = d[i].cues;
|
||||
device.data.lastCueInGroup[group.uniqueID] = cue;
|
||||
|
||||
getMoreCueInfo(d[i], []);
|
||||
cue.groups = groups;
|
||||
device.send(
|
||||
'/workspace/' +
|
||||
workspace +
|
||||
'/cue_id/' +
|
||||
cue.uniqueID +
|
||||
'/valuesForKeys',
|
||||
[
|
||||
{
|
||||
type: 's',
|
||||
value:
|
||||
'["mode", "parent", "isBroken", "preWait", "duration", "postWait", "continueMode", "cueTargetNumber", "isLoaded", "isRunning"]',
|
||||
},
|
||||
]
|
||||
);
|
||||
cue.index =
|
||||
device.data.workspaces[workspace].allCuesOrdered.push(cue) - 1;
|
||||
|
||||
function getMoreCueInfo(group, groups_arg){
|
||||
var groups = JSON.parse(JSON.stringify(groups_arg))
|
||||
groups.push(group.uniqueID);
|
||||
if (cue.cues) {
|
||||
cue.mode = 0;
|
||||
getMoreCueInfo(cue, groups);
|
||||
}
|
||||
|
||||
for(var cueIndex in group.cues){
|
||||
var cue = group.cues[cueIndex];
|
||||
//console.log(cue)
|
||||
device.data.workspaces[workspace].allCues[cue.uniqueID] = cue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
device.data.lastCueInGroup[group.uniqueID] = cue;
|
||||
//console.log(device.data.lastCueInGroup)
|
||||
|
||||
cue.groups = groups;
|
||||
device.send("/workspace/"+workspace+"/cue_id/"+cue.uniqueID+"/valuesForKeys", [{type: "s", value: "[\"mode\", \"parent\", \"isBroken\", \"preWait\", \"duration\", \"postWait\", \"continueMode\", \"cueTargetNumber\", \"isLoaded\", \"isRunning\"]"}]);
|
||||
cue.index = device.data.workspaces[workspace].allCuesOrdered.push(cue)-1;
|
||||
device.draw();
|
||||
} else if (p[0] == 'update' && p[1] == 'workspace' && p[3] == 'cue_id') {
|
||||
device.send('/workspace/' + p[2] + '/cueLists');
|
||||
} else if (
|
||||
p[0] == 'update' &&
|
||||
p[1] == 'workspace' &&
|
||||
p[5] == 'playbackPosition'
|
||||
) {
|
||||
console.log('pb move');
|
||||
device.data.playbackPosition = osc.args[0];
|
||||
device.draw();
|
||||
} else if (p[0] == 'reply' && p[1] == 'cue_id') {
|
||||
if (p[3] == 'uniqueID') {
|
||||
// response to /cue/playbackPosition/uniqueID
|
||||
device.data.playbackPosition = JSON.parse(osc.args[0]).data;
|
||||
} else if (p[3] == 'mode') {
|
||||
var cueID = p[2];
|
||||
var mode = JSON.parse(osc.args[0]).data;
|
||||
var workspaceID = JSON.parse(osc.args[0]).workspace_id;
|
||||
|
||||
if(cue.cues){
|
||||
cue.mode = 0;
|
||||
getMoreCueInfo(cue, groups);
|
||||
}
|
||||
device.data.workspaces[workspaceID].allCues[cueID].mode = mode;
|
||||
} else if (p[3] == 'valuesForKeys') {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
|
||||
device.data.workspaces[workspace].allCues[cue.uniqueID] = cue;
|
||||
var d = JSON.parse(osc.args[0]);
|
||||
|
||||
}
|
||||
}
|
||||
var cueID = p[2];
|
||||
var workspace = d.workspace_id;
|
||||
var cueList = d.data.parent;
|
||||
|
||||
}
|
||||
device.data.workspaces[workspace].allCues[cueID].mode = d.data.mode;
|
||||
device.data.workspaces[workspace].allCues[cueID].preWait = d.data.preWait;
|
||||
device.data.workspaces[workspace].allCues[cueID].duration =
|
||||
d.data.duration;
|
||||
device.data.workspaces[workspace].allCues[cueID].postWait =
|
||||
d.data.postWait;
|
||||
device.data.workspaces[workspace].allCues[cueID].continueMode =
|
||||
d.data.continueMode;
|
||||
device.data.workspaces[workspace].allCues[cueID].target =
|
||||
d.data.cueTargetNumber;
|
||||
device.data.workspaces[workspace].allCues[cueID].loaded = d.data.isLoaded;
|
||||
device.data.workspaces[workspace].allCues[cueID].broken = d.data.isBroken;
|
||||
device.data.workspaces[workspace].allCues[cueID].running =
|
||||
d.data.isRunning;
|
||||
}
|
||||
device.draw();
|
||||
} else if (p[1] == 'workspace' && p[3] == 'selectionIsPlayhead') {
|
||||
device.data.workspaces[p[2]].selectionIsPlayhead = JSON.parse(
|
||||
osc.args[0]
|
||||
).data;
|
||||
} else {
|
||||
}
|
||||
};
|
||||
|
||||
//console.log(device.data.lastCueInGroup)
|
||||
|
||||
|
||||
device.draw();
|
||||
}else if(p[0]=="update" && p[1]=="workspace" && p[3]=="cue_id"){
|
||||
device.send("/workspace/"+p[2]+"/cueLists");
|
||||
}else if(p[0]=="update" && p[1]=="workspace" && p[5]=="playbackPosition"){
|
||||
console.log('pb move')
|
||||
device.data.playbackPosition = osc.args[0];
|
||||
device.draw();
|
||||
}else if(p[0]=="reply" && p[1]=="cue_id"){
|
||||
|
||||
if(p[3] == "uniqueID"){
|
||||
// response to /cue/playbackPosition/uniqueID
|
||||
device.data.playbackPosition = JSON.parse(osc.args[0]).data;
|
||||
}else if(p[3]=="mode"){
|
||||
var cueID = p[2];
|
||||
var mode = JSON.parse(osc.args[0]).data;
|
||||
var workspaceID = JSON.parse(osc.args[0]).workspace_id;
|
||||
|
||||
device.data.workspaces[workspaceID].allCues[cueID].mode = mode;
|
||||
|
||||
}else if(p[3]=="valuesForKeys"){
|
||||
this.deviceInfoUpdate(device, "status", "ok");
|
||||
|
||||
var d = JSON.parse(osc.args[0]);
|
||||
|
||||
var cueID = p[2];
|
||||
var workspace = d.workspace_id;
|
||||
var cueList = d.data.parent;
|
||||
|
||||
device.data.workspaces[workspace].allCues[cueID].mode = d.data.mode;
|
||||
device.data.workspaces[workspace].allCues[cueID].preWait = d.data.preWait;
|
||||
device.data.workspaces[workspace].allCues[cueID].duration = d.data.duration;
|
||||
device.data.workspaces[workspace].allCues[cueID].postWait = d.data.postWait;
|
||||
device.data.workspaces[workspace].allCues[cueID].continueMode = d.data.continueMode;
|
||||
device.data.workspaces[workspace].allCues[cueID].target = d.data.cueTargetNumber;
|
||||
device.data.workspaces[workspace].allCues[cueID].loaded = d.data.isLoaded;
|
||||
device.data.workspaces[workspace].allCues[cueID].broken = d.data.isBroken;
|
||||
device.data.workspaces[workspace].allCues[cueID].running = d.data.isRunning;
|
||||
}
|
||||
device.draw();
|
||||
|
||||
}else if(p[1]=="workspace" && p[3]=="selectionIsPlayhead"){
|
||||
|
||||
device.data.workspaces[p[2]].selectionIsPlayhead = JSON.parse(osc.args[0]).data;
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
exports.heartbeat = function(device){
|
||||
try{
|
||||
device.send("/workspace/"+(Object.keys(device.data.workspaces)[0])+"/thump");
|
||||
}catch(err){}
|
||||
}
|
||||
exports.heartbeat = function (device) {
|
||||
try {
|
||||
device.send(
|
||||
'/workspace/' + Object.keys(device.data.workspaces)[0] + '/thump'
|
||||
);
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
table{
|
||||
font-family: PlexMono !important;
|
||||
table {
|
||||
font-family: PlexMono !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.warning{
|
||||
color: #e9873a;
|
||||
.warning {
|
||||
color: #e9873a;
|
||||
}
|
||||
.error{
|
||||
color: #ed5f5d;
|
||||
.error {
|
||||
color: #ed5f5d;
|
||||
}
|
||||
.ok{
|
||||
color: #79b757;
|
||||
.ok {
|
||||
color: #79b757;
|
||||
}
|
||||
|
||||
@@ -1,56 +1,58 @@
|
||||
exports.defaultName = "Dataton Watchout";
|
||||
exports.connectionType = "TCPsocket";
|
||||
exports.defaultName = 'Dataton Watchout';
|
||||
exports.connectionType = 'TCPsocket';
|
||||
exports.heartbeatInterval = 500;
|
||||
exports.searchOptions = {
|
||||
type: "TCPport",
|
||||
searchBuffer: Buffer.from("authenticate 1\n", 'ascii'),
|
||||
testPort: 3040,
|
||||
validateResponse: function(msg, info){
|
||||
return (msg.toString().substring(0, 5)=="Ready");
|
||||
}
|
||||
}
|
||||
type: 'TCPport',
|
||||
searchBuffer: Buffer.from('authenticate 1\n', 'ascii'),
|
||||
testPort: 3040,
|
||||
validateResponse: function (msg, info) {
|
||||
return msg.toString().substring(0, 5) == 'Ready';
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 3040;
|
||||
|
||||
exports.ready = function(device){
|
||||
device.send("authenticate 1\n");
|
||||
}
|
||||
exports.ready = function (device) {
|
||||
device.send('authenticate 1\n');
|
||||
};
|
||||
|
||||
exports.data = function(device, message){
|
||||
var msg = message.toString();
|
||||
if(msg.substring(0, 5)=="Ready"){
|
||||
device.send("getStatus\n");
|
||||
}
|
||||
if(msg.substring(0, 5)=="Reply"){
|
||||
var arr = msg.split(" ");
|
||||
exports.data = function (device, message) {
|
||||
var msg = message.toString();
|
||||
if (msg.substring(0, 5) == 'Ready') {
|
||||
device.send('getStatus\n');
|
||||
}
|
||||
if (msg.substring(0, 5) == 'Reply') {
|
||||
var arr = msg.split(' ');
|
||||
|
||||
device.data.showName = '';
|
||||
var i = 0;
|
||||
while (arr[i][arr[i].length - 1] != '"') {
|
||||
i++;
|
||||
device.data.showName += arr[i] + ' ';
|
||||
}
|
||||
device.data.showName = device.data.showName.substring(
|
||||
1,
|
||||
device.data.showName.length - 2
|
||||
);
|
||||
|
||||
device.data.showName = "";
|
||||
var i = 0;
|
||||
while(arr[i][arr[i].length-1]!='"'){
|
||||
i++;
|
||||
device.data.showName+=arr[i]+" ";
|
||||
}
|
||||
device.data.showName = device.data.showName.substring(1, device.data.showName.length-2);
|
||||
i--;
|
||||
device.data.busy = arr[i + 2];
|
||||
device.data.health = arr[i + 3];
|
||||
device.data.displayOpen = arr[i + 4];
|
||||
device.data.showActive = arr[i + 5];
|
||||
device.data.programmerOnline = arr[i + 6];
|
||||
device.data.position = Number(arr[i + 7]).toFixed(2);
|
||||
device.data.rate = arr[i + 8];
|
||||
device.data.standby = arr[i + 9];
|
||||
|
||||
i--;
|
||||
device.data.busy = arr[i+2];
|
||||
device.data.health = arr[i+3];
|
||||
device.data.displayOpen = arr[i+4];
|
||||
device.data.showActive = arr[i+5];
|
||||
device.data.programmerOnline = arr[i+6];
|
||||
device.data.position = Number(arr[i+7]).toFixed(2);
|
||||
device.data.rate = arr[i+8];
|
||||
device.data.standby = arr[i+9];
|
||||
this.deviceInfoUpdate(device, 'defaultName', device.data.showName);
|
||||
device.draw();
|
||||
}
|
||||
// if(msg.substring(0, 5)=="Error"){
|
||||
// device.data.error = msg.substring(6, 7);
|
||||
// }
|
||||
//console.log(msg)
|
||||
};
|
||||
|
||||
this.deviceInfoUpdate(device, "defaultName", device.data.showName);
|
||||
device.draw();
|
||||
}
|
||||
// if(msg.substring(0, 5)=="Error"){
|
||||
// device.data.error = msg.substring(6, 7);
|
||||
// }
|
||||
//console.log(msg)
|
||||
}
|
||||
|
||||
exports.heartbeat = function(device){
|
||||
device.send("getStatus\n");
|
||||
}
|
||||
exports.heartbeat = function (device) {
|
||||
device.send('getStatus\n');
|
||||
};
|
||||
|
||||
+89
-72
@@ -1,103 +1,120 @@
|
||||
td{
|
||||
padding: 3px 16px !important;
|
||||
td {
|
||||
padding: 3px 16px !important;
|
||||
}
|
||||
tr td:first-child{
|
||||
text-align: center;
|
||||
tr td:first-child {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mute-0, .mute-1{
|
||||
width: 30px;
|
||||
padding: 4px;
|
||||
font-size: 14px;
|
||||
border: black 2px solid;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
.mute-0,
|
||||
.mute-1 {
|
||||
width: 30px;
|
||||
padding: 4px;
|
||||
font-size: 14px;
|
||||
border: black 2px solid;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.mute-1{
|
||||
border-color: gray;
|
||||
color: gray;
|
||||
.mute-1 {
|
||||
border-color: gray;
|
||||
color: gray;
|
||||
}
|
||||
.mute-0{
|
||||
border-color: #fc3344;
|
||||
color: #fc3344;
|
||||
.mute-0 {
|
||||
border-color: #fc3344;
|
||||
color: #fc3344;
|
||||
}
|
||||
.white{
|
||||
color: white;
|
||||
.white {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.color{
|
||||
padding: 1px 6px;
|
||||
border-radius: 10px;
|
||||
color: black;
|
||||
font-family: PlexMono !important;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
.color {
|
||||
padding: 1px 6px;
|
||||
border-radius: 10px;
|
||||
color: black;
|
||||
font-family: PlexMono !important;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.color-0{ /*Black*/
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
.color-0 {
|
||||
/*Black*/
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
}
|
||||
.color-1{ /*Red*/
|
||||
background-color: #fc545b;
|
||||
.color-1 {
|
||||
/*Red*/
|
||||
background-color: #fc545b;
|
||||
}
|
||||
.color-2{ /*Green*/
|
||||
background-color: #65b84d;
|
||||
.color-2 {
|
||||
/*Green*/
|
||||
background-color: #65b84d;
|
||||
}
|
||||
.color-3{ /*Yellow*/
|
||||
background-color: #fec52e;
|
||||
.color-3 {
|
||||
/*Yellow*/
|
||||
background-color: #fec52e;
|
||||
}
|
||||
.color-4{ /*Blue*/
|
||||
background-color: #157efb;
|
||||
.color-4 {
|
||||
/*Blue*/
|
||||
background-color: #157efb;
|
||||
}
|
||||
.color-5{ /*Purple*/
|
||||
background-color: #a453a5;
|
||||
.color-5 {
|
||||
/*Purple*/
|
||||
background-color: #a453a5;
|
||||
}
|
||||
.color-6{ /*Teal*/
|
||||
background-color: #00dae3;
|
||||
.color-6 {
|
||||
/*Teal*/
|
||||
background-color: #00dae3;
|
||||
}
|
||||
.color-7{ /*White*/
|
||||
background-color: #e0e0e0;
|
||||
.color-7 {
|
||||
/*White*/
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
.color-8{ /*Gray*/
|
||||
background-color: #8c8c8c;
|
||||
.color-8 {
|
||||
/*Gray*/
|
||||
background-color: #8c8c8c;
|
||||
}
|
||||
.color-9{ /*Red*/
|
||||
color: #fc545b;
|
||||
border: #fc545b 1px solid;
|
||||
.color-9 {
|
||||
/*Red*/
|
||||
color: #fc545b;
|
||||
border: #fc545b 1px solid;
|
||||
}
|
||||
.color-10{ /*Green*/
|
||||
color: #65b84d;
|
||||
border: #65b84d 1px solid;
|
||||
.color-10 {
|
||||
/*Green*/
|
||||
color: #65b84d;
|
||||
border: #65b84d 1px solid;
|
||||
}
|
||||
.color-11{ /*Yellow*/
|
||||
color: #fec52e;
|
||||
border: #fec52e 1px solid;
|
||||
.color-11 {
|
||||
/*Yellow*/
|
||||
color: #fec52e;
|
||||
border: #fec52e 1px solid;
|
||||
}
|
||||
.color-12{ /*Blue*/
|
||||
color: #157efb;
|
||||
border: #157efb 1px solid;
|
||||
.color-12 {
|
||||
/*Blue*/
|
||||
color: #157efb;
|
||||
border: #157efb 1px solid;
|
||||
}
|
||||
.color-13{ /*Purple*/
|
||||
color: #a453a5;
|
||||
border: #a453a5 1px solid;
|
||||
.color-13 {
|
||||
/*Purple*/
|
||||
color: #a453a5;
|
||||
border: #a453a5 1px solid;
|
||||
}
|
||||
.color-14{ /*Teal*/
|
||||
color: #00dae3;
|
||||
border: #00dae3 1px solid;
|
||||
.color-14 {
|
||||
/*Teal*/
|
||||
color: #00dae3;
|
||||
border: #00dae3 1px solid;
|
||||
}
|
||||
.color-15{ /*White*/
|
||||
color: #e0e0e0;
|
||||
border: #e0e0e0 1px solid;
|
||||
.color-15 {
|
||||
/*White*/
|
||||
color: #e0e0e0;
|
||||
border: #e0e0e0 1px solid;
|
||||
}
|
||||
|
||||
input[type=range] {
|
||||
input[type='range'] {
|
||||
-webkit-appearance: none;
|
||||
margin: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
input[type=range]::-webkit-slider-thumb {
|
||||
input[type='range']::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
margin-top: -9px;
|
||||
height: 26px;
|
||||
@@ -105,9 +122,9 @@ input[type=range]::-webkit-slider-thumb {
|
||||
border-radius: 4px;
|
||||
background: #929292;
|
||||
}
|
||||
input[type=range]::-webkit-slider-runnable-track {
|
||||
input[type='range']::-webkit-slider-runnable-track {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #3b3b3b;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
+45
-41
@@ -1,47 +1,51 @@
|
||||
<header>
|
||||
<h1><%= listName %></h1>
|
||||
<h2><%= data.model %></h2>
|
||||
<h1><%= listName %></h1>
|
||||
<h2><%= data.model %></h2>
|
||||
</header>
|
||||
|
||||
<table class="cv-table">
|
||||
<tr>
|
||||
<th width="40px"></th>
|
||||
<th width="100px">Channel</th>
|
||||
<th width="55px">Mute</th>
|
||||
<th width="45px">dB</th>
|
||||
<th width="160px">Fader</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40px">LR</td>
|
||||
<td width="100px"><div class="color color-8">MAIN OUT</div></td>
|
||||
<td><div class="fader-mute mute-<%=data.stereoMute%>">M</div></td>
|
||||
<td><%- formatAsDB(data.stereoFaderDB) %></td>
|
||||
<td><input type="range" min="0" max="100" value="<%= data.stereoFader*100 %>" disabled></td>
|
||||
</tr>
|
||||
<% for(var i=0; i<32; i++){ %>
|
||||
<% if(data.channelNames[i]=="end"){break;} %>
|
||||
<tr>
|
||||
<td><%= i+1 %></td>
|
||||
<td><div class="color color-<%= data.channelColors[i] %>"><%- data.channelNames[i] || i+1 %></div></td>
|
||||
<td><div class="fader-mute mute-<%=data.channelMutes[i]%>">M</div></td>
|
||||
<td><%- formatAsDB(data.channelFadersDB[i]) %></td>
|
||||
<td><input type="range" min="0" max="100" value="<%= data.channelFaders[i]*100 %>" disabled></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
<tr>
|
||||
<th width="40px"></th>
|
||||
<th width="100px">Channel</th>
|
||||
<th width="55px">Mute</th>
|
||||
<th width="45px">dB</th>
|
||||
<th width="160px">Fader</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40px">LR</td>
|
||||
<td width="100px"><div class="color color-8">MAIN OUT</div></td>
|
||||
<td><div class="fader-mute mute-<%=data.stereoMute%>">M</div></td>
|
||||
<td><%- formatAsDB(data.stereoFaderDB) %></td>
|
||||
<td>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="<%= data.stereoFader*100 %>"
|
||||
disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<% for(var i=0; i<32; i++){ %> <% if(data.channelNames[i]=="end"){break;} %>
|
||||
<tr>
|
||||
<td><%= i+1 %></td>
|
||||
<td>
|
||||
<div class="color color-<%= data.channelColors[i] %>">
|
||||
<%- data.channelNames[i] || i+1 %>
|
||||
</div>
|
||||
</td>
|
||||
<td><div class="fader-mute mute-<%=data.channelMutes[i]%>">M</div></td>
|
||||
<td><%- formatAsDB(data.channelFadersDB[i]) %></td>
|
||||
<td>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="<%= data.channelFaders[i]*100 %>"
|
||||
disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<%
|
||||
function formatAsDB(val){
|
||||
if(val==-90){
|
||||
return "-∞";
|
||||
}
|
||||
if(val>0){
|
||||
return "+"+val.toFixed(1);
|
||||
}
|
||||
return val.toFixed(1);
|
||||
}
|
||||
|
||||
%>
|
||||
<% function formatAsDB(val){ if(val==-90){ return "-∞"; } if(val>0){
|
||||
return "+"+val.toFixed(1); } return val.toFixed(1); } %>
|
||||
|
||||
+118
-115
@@ -1,129 +1,132 @@
|
||||
exports.defaultName = "X32 Mixer";
|
||||
exports.connectionType = "UDPsocket";
|
||||
exports.defaultName = 'X32 Mixer';
|
||||
exports.connectionType = 'UDPsocket';
|
||||
exports.heartbeatInterval = 10000;
|
||||
exports.searchOptions = {
|
||||
type: "UDPsocket",
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10023,
|
||||
listenPort: 0,
|
||||
validateResponse: function(msg, info){
|
||||
return (msg.toString().indexOf("/xinfo")==0);
|
||||
}
|
||||
}
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10023,
|
||||
listenPort: 0,
|
||||
validateResponse: function (msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') == 0;
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 10023;
|
||||
|
||||
exports.ready = function(device){
|
||||
exports.ready = function (device) {
|
||||
device.data.channelFaders = new Array(32).fill(0);
|
||||
device.data.channelFadersDB = new Array(32).fill(0);
|
||||
device.data.channelMutes = new Array(32).fill(0);
|
||||
device.data.channelNames = new Array(32).fill('end');
|
||||
device.data.channelColors = new Array(32);
|
||||
|
||||
device.data.channelFaders = new Array(32).fill(0);
|
||||
device.data.channelFadersDB = new Array(32).fill(0);
|
||||
device.data.channelMutes = new Array(32).fill(0);
|
||||
device.data.channelNames = new Array(32).fill("end");
|
||||
device.data.channelColors = new Array(32);
|
||||
device.data.stereoFader = 0;
|
||||
device.data.stereoFaderDB = 0;
|
||||
device.data.stereoMute = 0;
|
||||
|
||||
device.data.stereoFader = 0;
|
||||
device.data.stereoFaderDB = 0;
|
||||
device.data.stereoMute = 0;
|
||||
device.send(Buffer.from('/xinfo'));
|
||||
|
||||
device.send(Buffer.from("/xinfo"));
|
||||
//device.send(Buffer.from("\x2f\x62\x61\x74\x63\x68\x73\x75\x62\x73\x63\x72\x69\x62\x65\x00\x2c\x73\x73\x69\x69\x69\x00\x00\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x2f\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
//device.send(Buffer.from("/batchsubscribe\x00,ssiii\x00\x00meters/0\x00\x00\x00\x00/meters/0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
|
||||
//device.send(Buffer.from("/subscribe\x00,si\x00/-stat/solosw/01\x001"));
|
||||
};
|
||||
|
||||
//device.send(Buffer.from("\x2f\x62\x61\x74\x63\x68\x73\x75\x62\x73\x63\x72\x69\x62\x65\x00\x2c\x73\x73\x69\x69\x69\x00\x00\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x2f\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
//device.send(Buffer.from("/batchsubscribe\x00,ssiii\x00\x00meters/0\x00\x00\x00\x00/meters/0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
exports.data = function (device, buf) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
var msg = buf.toString().split('\u0000\u0000');
|
||||
|
||||
//device.send(Buffer.from("/subscribe\x00,si\x00/-stat/solosw/01\x001"));
|
||||
if (msg[0] == '/xinfo') {
|
||||
this.deviceInfoUpdate(device, 'defaultName', msg[4]);
|
||||
device.data.name = msg[4];
|
||||
device.data.ip = msg[2];
|
||||
device.data.firmware = msg[7];
|
||||
device.data.model = msg[5];
|
||||
|
||||
device.send(Buffer.from('/lr/mix/fader\u0000\u0000\u0000\u0000'));
|
||||
device.send(Buffer.from('/lr/mix/on\u0000\u0000\u0000\u0000'));
|
||||
|
||||
for (var i = 0; i <= 32; i++) {
|
||||
device.send(
|
||||
Buffer.from(
|
||||
'/ch/' +
|
||||
i.toString().padStart(2, '0') +
|
||||
'/config/name\u0000\u0000\u0000\u0000'
|
||||
)
|
||||
);
|
||||
}
|
||||
device.draw();
|
||||
} else if (msg[0] == '/meters/0') {
|
||||
//console.log(msg)
|
||||
} else if (msg[0].indexOf('/mix/fader') >= 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if (addr[0] == 'ch') {
|
||||
device.data.channelFaders[channel - 1] = buf.readFloatBE(24);
|
||||
device.data.channelFadersDB[channel - 1] = convertToDBTheBehringerWay(
|
||||
buf.readFloatBE(24)
|
||||
);
|
||||
} else if (addr[0] == 'lr') {
|
||||
device.data.stereoFader = buf.readFloatBE(20);
|
||||
device.data.stereoFaderDB = convertToDBTheBehringerWay(
|
||||
buf.readFloatBE(20)
|
||||
);
|
||||
}
|
||||
|
||||
device.draw();
|
||||
} else if (msg[0].indexOf('/mix/on') >= 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if (addr[0] == 'ch') {
|
||||
device.data.channelMutes[channel - 1] = buf[23];
|
||||
} else if (addr[0] == 'lr') {
|
||||
device.data.stereoMute = buf[19];
|
||||
}
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/mix/fader\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else if (msg[0].indexOf('/config/name') > 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelNames[channel - 1] = msg[2];
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/config/color\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else if (msg[0].indexOf('/config/color') > 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelColors[channel - 1] = buf.readInt8(27);
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/mix/on\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else {
|
||||
//console.log(msg)
|
||||
}
|
||||
//console.log(msg)
|
||||
};
|
||||
|
||||
exports.heartbeat = function (device) {
|
||||
device.send(Buffer.from('/xremote'));
|
||||
};
|
||||
|
||||
function parseAddress(msg) {
|
||||
var addr = msg.split('/');
|
||||
addr.shift();
|
||||
return addr;
|
||||
}
|
||||
|
||||
exports.data = function(device, buf){
|
||||
this.deviceInfoUpdate(device, "status", "ok");
|
||||
var msg = buf.toString().split('\u0000\u0000')
|
||||
|
||||
if(msg[0]=="/xinfo"){
|
||||
this.deviceInfoUpdate(device, "defaultName", msg[4]);
|
||||
device.data.name = msg[4];
|
||||
device.data.ip = msg[2];
|
||||
device.data.firmware = msg[7];
|
||||
device.data.model = msg[5];
|
||||
|
||||
|
||||
device.send(Buffer.from("/lr/mix/fader\u0000\u0000\u0000\u0000"));
|
||||
device.send(Buffer.from("/lr/mix/on\u0000\u0000\u0000\u0000"));
|
||||
|
||||
for(var i=0; i<=32; i++){
|
||||
device.send(Buffer.from("/ch/"+i.toString().padStart(2, "0")+"/config/name\u0000\u0000\u0000\u0000"));
|
||||
}
|
||||
device.draw();
|
||||
|
||||
|
||||
}else if(msg[0]=="/meters/0"){
|
||||
//console.log(msg)
|
||||
}else if(msg[0].indexOf("/mix/fader")>=0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if(addr[0]=="ch"){
|
||||
device.data.channelFaders[channel-1] = buf.readFloatBE(24);
|
||||
device.data.channelFadersDB[channel-1] = convertToDBTheBehringerWay(buf.readFloatBE(24));
|
||||
}else if(addr[0]=="lr"){
|
||||
device.data.stereoFader = buf.readFloatBE(20);
|
||||
device.data.stereoFaderDB = convertToDBTheBehringerWay(buf.readFloatBE(20));
|
||||
}
|
||||
|
||||
device.draw();
|
||||
|
||||
}else if(msg[0].indexOf("/mix/on")>=0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if(addr[0]=="ch"){
|
||||
device.data.channelMutes[channel-1] = buf[23];
|
||||
}else if(addr[0]=="lr"){
|
||||
device.data.stereoMute = buf[19];
|
||||
}
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/mix/fader\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else if(msg[0].indexOf("/config/name")>0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelNames[channel-1] = msg[2];
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/config/color\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else if(msg[0].indexOf("/config/color")>0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelColors[channel-1] = buf.readInt8(27);
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/mix/on\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else{
|
||||
//console.log(msg)
|
||||
}
|
||||
//console.log(msg)
|
||||
|
||||
function convertToDBTheBehringerWay(f) {
|
||||
if (f >= 0.5) {
|
||||
return f * 40 - 30;
|
||||
} else if (f >= 0.25) {
|
||||
return f * 80 - 50;
|
||||
} else if (f >= 0.0625) {
|
||||
return f * 160 - 70;
|
||||
} else {
|
||||
return f * 480 - 90;
|
||||
}
|
||||
}
|
||||
|
||||
exports.heartbeat = function(device){
|
||||
device.send(Buffer.from("/xremote"));
|
||||
}
|
||||
|
||||
|
||||
function parseAddress(msg){
|
||||
var addr = msg.split("/");
|
||||
addr.shift();
|
||||
return addr;
|
||||
}
|
||||
|
||||
function convertToDBTheBehringerWay(f){
|
||||
if(f>=0.5){
|
||||
return f*40-30;
|
||||
}else if(f>=0.25){
|
||||
return f*80-50;
|
||||
}else if(f>=0.0625){
|
||||
return f*160-70;
|
||||
}else{
|
||||
return f*480-90;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+88
-71
@@ -1,102 +1,119 @@
|
||||
td{
|
||||
padding: 3px 16px !important;
|
||||
td {
|
||||
padding: 3px 16px !important;
|
||||
}
|
||||
tr td:first-child{
|
||||
text-align: center;
|
||||
tr td:first-child {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mute-0, .mute-1{
|
||||
width: 30px;
|
||||
padding: 4px;
|
||||
font-size: 14px;
|
||||
border: black 2px solid;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
.mute-0,
|
||||
.mute-1 {
|
||||
width: 30px;
|
||||
padding: 4px;
|
||||
font-size: 14px;
|
||||
border: black 2px solid;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.mute-1{
|
||||
border-color: gray;
|
||||
color: gray;
|
||||
.mute-1 {
|
||||
border-color: gray;
|
||||
color: gray;
|
||||
}
|
||||
.mute-0{
|
||||
border-color: #fc3344;
|
||||
color: #fc3344;
|
||||
.mute-0 {
|
||||
border-color: #fc3344;
|
||||
color: #fc3344;
|
||||
}
|
||||
.white{
|
||||
color: white;
|
||||
.white {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.color{
|
||||
padding: 1px 6px;
|
||||
border-radius: 10px;
|
||||
color: black;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
.color {
|
||||
padding: 1px 6px;
|
||||
border-radius: 10px;
|
||||
color: black;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
.color-0{ /*Black*/
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
.color-0 {
|
||||
/*Black*/
|
||||
background-color: #212121;
|
||||
color: white;
|
||||
}
|
||||
.color-1{ /*Red*/
|
||||
background-color: #fc545b;
|
||||
.color-1 {
|
||||
/*Red*/
|
||||
background-color: #fc545b;
|
||||
}
|
||||
.color-2{ /*Green*/
|
||||
background-color: #65b84d;
|
||||
.color-2 {
|
||||
/*Green*/
|
||||
background-color: #65b84d;
|
||||
}
|
||||
.color-3{ /*Yellow*/
|
||||
background-color: #fec52e;
|
||||
.color-3 {
|
||||
/*Yellow*/
|
||||
background-color: #fec52e;
|
||||
}
|
||||
.color-4{ /*Blue*/
|
||||
background-color: #157efb;
|
||||
.color-4 {
|
||||
/*Blue*/
|
||||
background-color: #157efb;
|
||||
}
|
||||
.color-5{ /*Purple*/
|
||||
background-color: #a453a5;
|
||||
.color-5 {
|
||||
/*Purple*/
|
||||
background-color: #a453a5;
|
||||
}
|
||||
.color-6{ /*Teal*/
|
||||
background-color: #00dae3;
|
||||
.color-6 {
|
||||
/*Teal*/
|
||||
background-color: #00dae3;
|
||||
}
|
||||
.color-7{ /*White*/
|
||||
background-color: #e0e0e0;
|
||||
.color-7 {
|
||||
/*White*/
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
.color-8{ /*Gray*/
|
||||
background-color: #8c8c8c;
|
||||
.color-8 {
|
||||
/*Gray*/
|
||||
background-color: #8c8c8c;
|
||||
}
|
||||
.color-9{ /*Red*/
|
||||
color: #fc545b;
|
||||
border: #fc545b 1px solid;
|
||||
.color-9 {
|
||||
/*Red*/
|
||||
color: #fc545b;
|
||||
border: #fc545b 1px solid;
|
||||
}
|
||||
.color-10{ /*Green*/
|
||||
color: #65b84d;
|
||||
border: #65b84d 1px solid;
|
||||
.color-10 {
|
||||
/*Green*/
|
||||
color: #65b84d;
|
||||
border: #65b84d 1px solid;
|
||||
}
|
||||
.color-11{ /*Yellow*/
|
||||
color: #fec52e;
|
||||
border: #fec52e 1px solid;
|
||||
.color-11 {
|
||||
/*Yellow*/
|
||||
color: #fec52e;
|
||||
border: #fec52e 1px solid;
|
||||
}
|
||||
.color-12{ /*Blue*/
|
||||
color: #157efb;
|
||||
border: #157efb 1px solid;
|
||||
.color-12 {
|
||||
/*Blue*/
|
||||
color: #157efb;
|
||||
border: #157efb 1px solid;
|
||||
}
|
||||
.color-13{ /*Purple*/
|
||||
color: #a453a5;
|
||||
border: #a453a5 1px solid;
|
||||
.color-13 {
|
||||
/*Purple*/
|
||||
color: #a453a5;
|
||||
border: #a453a5 1px solid;
|
||||
}
|
||||
.color-14{ /*Teal*/
|
||||
color: #00dae3;
|
||||
border: #00dae3 1px solid;
|
||||
.color-14 {
|
||||
/*Teal*/
|
||||
color: #00dae3;
|
||||
border: #00dae3 1px solid;
|
||||
}
|
||||
.color-15{ /*White*/
|
||||
color: #e0e0e0;
|
||||
border: #e0e0e0 1px solid;
|
||||
.color-15 {
|
||||
/*White*/
|
||||
color: #e0e0e0;
|
||||
border: #e0e0e0 1px solid;
|
||||
}
|
||||
|
||||
input[type=range] {
|
||||
input[type='range'] {
|
||||
-webkit-appearance: none;
|
||||
margin: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
input[type=range]::-webkit-slider-thumb {
|
||||
input[type='range']::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
margin-top: -9px;
|
||||
height: 26px;
|
||||
@@ -104,9 +121,9 @@ input[type=range]::-webkit-slider-thumb {
|
||||
border-radius: 4px;
|
||||
background: #929292;
|
||||
}
|
||||
input[type=range]::-webkit-slider-runnable-track {
|
||||
input[type='range']::-webkit-slider-runnable-track {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #3b3b3b;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
+45
-41
@@ -1,47 +1,51 @@
|
||||
<header>
|
||||
<h1><%= listName %></h1>
|
||||
<h2><%= data.model %></h2>
|
||||
<h1><%= listName %></h1>
|
||||
<h2><%= data.model %></h2>
|
||||
</header>
|
||||
|
||||
<table class="cv-table">
|
||||
<tr>
|
||||
<th width="40px"></th>
|
||||
<th width="100px">Channel</th>
|
||||
<th width="55px">Mute</th>
|
||||
<th width="45px">dB</th>
|
||||
<th width="160px">Fader</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40px">LR</td>
|
||||
<td width="100px"><div class="color color-8">MAIN OUT</div></td>
|
||||
<td><div class="fader-mute mute-<%=data.stereoMute%>">M</div></td>
|
||||
<td><%- formatAsDB(data.stereoFaderDB) %></td>
|
||||
<td><input type="range" min="0" max="100" value="<%= data.stereoFader*100 %>" disabled></td>
|
||||
</tr>
|
||||
<% for(var i=0; i<32; i++){ %>
|
||||
<% if(data.channelNames[i]=="end"){break;} %>
|
||||
<tr>
|
||||
<td><%= i+1 %></td>
|
||||
<td><div class="color color-<%= data.channelColors[i] %>"><%- data.channelNames[i] || i+1 %></div></td>
|
||||
<td><div class="fader-mute mute-<%=data.channelMutes[i]%>">M</div></td>
|
||||
<td><%- formatAsDB(data.channelFadersDB[i]) %></td>
|
||||
<td><input type="range" min="0" max="100" value="<%= data.channelFaders[i]*100 %>" disabled></td>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
||||
<tr>
|
||||
<th width="40px"></th>
|
||||
<th width="100px">Channel</th>
|
||||
<th width="55px">Mute</th>
|
||||
<th width="45px">dB</th>
|
||||
<th width="160px">Fader</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40px">LR</td>
|
||||
<td width="100px"><div class="color color-8">MAIN OUT</div></td>
|
||||
<td><div class="fader-mute mute-<%=data.stereoMute%>">M</div></td>
|
||||
<td><%- formatAsDB(data.stereoFaderDB) %></td>
|
||||
<td>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="<%= data.stereoFader*100 %>"
|
||||
disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<% for(var i=0; i<32; i++){ %> <% if(data.channelNames[i]=="end"){break;} %>
|
||||
<tr>
|
||||
<td><%= i+1 %></td>
|
||||
<td>
|
||||
<div class="color color-<%= data.channelColors[i] %>">
|
||||
<%- data.channelNames[i] || i+1 %>
|
||||
</div>
|
||||
</td>
|
||||
<td><div class="fader-mute mute-<%=data.channelMutes[i]%>">M</div></td>
|
||||
<td><%- formatAsDB(data.channelFadersDB[i]) %></td>
|
||||
<td>
|
||||
<input
|
||||
type="range"
|
||||
min="0"
|
||||
max="100"
|
||||
value="<%= data.channelFaders[i]*100 %>"
|
||||
disabled />
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<%
|
||||
function formatAsDB(val){
|
||||
if(val==-90){
|
||||
return "-∞";
|
||||
}
|
||||
if(val>0){
|
||||
return "+"+val.toFixed(1);
|
||||
}
|
||||
return val.toFixed(1);
|
||||
}
|
||||
|
||||
%>
|
||||
<% function formatAsDB(val){ if(val==-90){ return "-∞"; } if(val>0){
|
||||
return "+"+val.toFixed(1); } return val.toFixed(1); } %>
|
||||
|
||||
+123
-121
@@ -1,135 +1,137 @@
|
||||
exports.defaultName = "X Air Mixer";
|
||||
exports.connectionType = "UDPsocket";
|
||||
exports.defaultName = 'X Air Mixer';
|
||||
exports.connectionType = 'UDPsocket';
|
||||
exports.heartbeatInterval = 10000;
|
||||
exports.searchOptions = {
|
||||
type: "UDPsocket",
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10024,
|
||||
listenPort: 0,
|
||||
validateResponse: function(msg, info){
|
||||
return (msg.toString().indexOf("/xinfo")==0);
|
||||
}
|
||||
}
|
||||
type: 'UDPsocket',
|
||||
searchBuffer: Buffer.from([0x2f, 0x78, 0x69, 0x6e, 0x66, 0x6f]),
|
||||
devicePort: 10024,
|
||||
listenPort: 0,
|
||||
validateResponse: function (msg, info) {
|
||||
return msg.toString().indexOf('/xinfo') == 0;
|
||||
},
|
||||
};
|
||||
exports.defaultPort = 10024;
|
||||
|
||||
exports.ready = function(device){
|
||||
exports.ready = function (device) {
|
||||
device.data.channelFaders = new Array(32).fill(0);
|
||||
device.data.channelFadersDB = new Array(32).fill(0);
|
||||
device.data.channelMutes = new Array(32).fill(0);
|
||||
device.data.channelNames = new Array(32).fill('end');
|
||||
device.data.channelColors = new Array(32);
|
||||
|
||||
device.data.channelFaders = new Array(32).fill(0);
|
||||
device.data.channelFadersDB = new Array(32).fill(0);
|
||||
device.data.channelMutes = new Array(32).fill(0);
|
||||
device.data.channelNames = new Array(32).fill("end");
|
||||
device.data.channelColors = new Array(32);
|
||||
device.data.stereoFader = 0;
|
||||
device.data.stereoFaderDB = 0;
|
||||
device.data.stereoMute = 0;
|
||||
|
||||
device.data.stereoFader = 0;
|
||||
device.data.stereoFaderDB = 0;
|
||||
device.data.stereoMute = 0;
|
||||
device.send(Buffer.from('/xinfo'));
|
||||
|
||||
device.send(Buffer.from("/xinfo"));
|
||||
//device.send(Buffer.from("\x2f\x62\x61\x74\x63\x68\x73\x75\x62\x73\x63\x72\x69\x62\x65\x00\x2c\x73\x73\x69\x69\x69\x00\x00\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x2f\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
//device.send(Buffer.from("/batchsubscribe\x00,ssiii\x00\x00meters/0\x00\x00\x00\x00/meters/0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
|
||||
//device.send(Buffer.from("/subscribe\x00,si\x00/-stat/solosw/01\x001"));
|
||||
};
|
||||
|
||||
//device.send(Buffer.from("\x2f\x62\x61\x74\x63\x68\x73\x75\x62\x73\x63\x72\x69\x62\x65\x00\x2c\x73\x73\x69\x69\x69\x00\x00\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x2f\x6d\x65\x74\x65\x72\x73\x2f\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
//device.send(Buffer.from("/batchsubscribe\x00,ssiii\x00\x00meters/0\x00\x00\x00\x00/meters/0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01"));
|
||||
exports.data = function (device, buf) {
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
var msg = buf.toString().split('\u0000');
|
||||
|
||||
//device.send(Buffer.from("/subscribe\x00,si\x00/-stat/solosw/01\x001"));
|
||||
if (msg[0] == '/xinfo') {
|
||||
if (msg[7].length > 0) {
|
||||
device.data.name = msg[7];
|
||||
} else {
|
||||
device.data.name = msg[6];
|
||||
}
|
||||
|
||||
device.data.ip = msg[5];
|
||||
device.data.firmware = msg[13];
|
||||
device.data.model = msg[9];
|
||||
this.deviceInfoUpdate(device, 'defaultName', device.data.name);
|
||||
|
||||
device.send(Buffer.from('/lr/mix/fader\u0000\u0000\u0000\u0000'));
|
||||
device.send(Buffer.from('/lr/mix/on\u0000\u0000\u0000\u0000'));
|
||||
|
||||
for (var i = 0; i <= 32; i++) {
|
||||
device.send(
|
||||
Buffer.from(
|
||||
'/ch/' +
|
||||
i.toString().padStart(2, '0') +
|
||||
'/config/name\u0000\u0000\u0000\u0000'
|
||||
)
|
||||
);
|
||||
}
|
||||
device.draw();
|
||||
} else if (msg[0] == '/meters/0') {
|
||||
//console.log(msg)
|
||||
} else if (msg[0].indexOf('/mix/fader') >= 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if (addr[0] == 'ch') {
|
||||
device.data.channelFaders[channel - 1] = buf.readFloatBE(24);
|
||||
device.data.channelFadersDB[channel - 1] = convertToDBTheBehringerWay(
|
||||
buf.readFloatBE(24)
|
||||
);
|
||||
} else if (addr[0] == 'lr') {
|
||||
device.data.stereoFader = buf.readFloatBE(20);
|
||||
device.data.stereoFaderDB = convertToDBTheBehringerWay(
|
||||
buf.readFloatBE(20)
|
||||
);
|
||||
}
|
||||
|
||||
device.draw();
|
||||
} else if (msg[0].indexOf('/mix/on') >= 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if (addr[0] == 'ch') {
|
||||
device.data.channelMutes[channel - 1] = buf[23];
|
||||
} else if (addr[0] == 'lr') {
|
||||
device.data.stereoMute = buf[19];
|
||||
}
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/mix/fader\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else if (msg[0].indexOf('/config/name') > 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelNames[channel - 1] = msg[4];
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/config/color\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else if (msg[0].indexOf('/config/color') > 0) {
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelColors[channel - 1] = buf.readInt8(27);
|
||||
device.draw();
|
||||
device.send(
|
||||
Buffer.from('/ch/' + addr[1] + '/mix/on\u0000\u0000\u0000\u0000')
|
||||
);
|
||||
} else {
|
||||
//console.log(msg)
|
||||
}
|
||||
//console.log(msg)
|
||||
};
|
||||
|
||||
exports.heartbeat = function (device) {
|
||||
device.send(Buffer.from('/xremote'));
|
||||
};
|
||||
|
||||
function parseAddress(msg) {
|
||||
var addr = msg.split('/');
|
||||
addr.shift();
|
||||
return addr;
|
||||
}
|
||||
|
||||
exports.data = function(device, buf){
|
||||
this.deviceInfoUpdate(device, "status", "ok");
|
||||
var msg = buf.toString().split('\u0000')
|
||||
|
||||
if(msg[0]=="/xinfo"){
|
||||
|
||||
if(msg[7].length>0){
|
||||
device.data.name = msg[7];
|
||||
}else{
|
||||
device.data.name = msg[6];
|
||||
}
|
||||
|
||||
device.data.ip = msg[5];
|
||||
device.data.firmware = msg[13];
|
||||
device.data.model = msg[9];
|
||||
this.deviceInfoUpdate(device, "defaultName", device.data.name);
|
||||
|
||||
|
||||
device.send(Buffer.from("/lr/mix/fader\u0000\u0000\u0000\u0000"));
|
||||
device.send(Buffer.from("/lr/mix/on\u0000\u0000\u0000\u0000"));
|
||||
|
||||
for(var i=0; i<=32; i++){
|
||||
device.send(Buffer.from("/ch/"+i.toString().padStart(2, "0")+"/config/name\u0000\u0000\u0000\u0000"));
|
||||
}
|
||||
device.draw();
|
||||
|
||||
|
||||
}else if(msg[0]=="/meters/0"){
|
||||
//console.log(msg)
|
||||
}else if(msg[0].indexOf("/mix/fader")>=0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if(addr[0]=="ch"){
|
||||
device.data.channelFaders[channel-1] = buf.readFloatBE(24);
|
||||
device.data.channelFadersDB[channel-1] = convertToDBTheBehringerWay(buf.readFloatBE(24));
|
||||
}else if(addr[0]=="lr"){
|
||||
device.data.stereoFader = buf.readFloatBE(20);
|
||||
device.data.stereoFaderDB = convertToDBTheBehringerWay(buf.readFloatBE(20));
|
||||
}
|
||||
|
||||
device.draw();
|
||||
|
||||
}else if(msg[0].indexOf("/mix/on")>=0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
|
||||
if(addr[0]=="ch"){
|
||||
device.data.channelMutes[channel-1] = buf[23];
|
||||
}else if(addr[0]=="lr"){
|
||||
device.data.stereoMute = buf[19];
|
||||
}
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/mix/fader\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else if(msg[0].indexOf("/config/name")>0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelNames[channel-1] = msg[4];
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/config/color\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else if(msg[0].indexOf("/config/color")>0){
|
||||
var addr = parseAddress(msg[0]);
|
||||
var channel = Number(addr[1]);
|
||||
device.data.channelColors[channel-1] = buf.readInt8(27);
|
||||
device.draw();
|
||||
device.send(Buffer.from("/ch/"+addr[1]+"/mix/on\u0000\u0000\u0000\u0000"));
|
||||
|
||||
}else{
|
||||
//console.log(msg)
|
||||
}
|
||||
//console.log(msg)
|
||||
|
||||
function convertToDBTheBehringerWay(f) {
|
||||
if (f >= 0.5) {
|
||||
return f * 40 - 30;
|
||||
} else if (f >= 0.25) {
|
||||
return f * 80 - 50;
|
||||
} else if (f >= 0.0625) {
|
||||
return f * 160 - 70;
|
||||
} else {
|
||||
return f * 480 - 90;
|
||||
}
|
||||
}
|
||||
|
||||
exports.heartbeat = function(device){
|
||||
device.send(Buffer.from("/xremote"));
|
||||
}
|
||||
|
||||
|
||||
function parseAddress(msg){
|
||||
var addr = msg.split("/");
|
||||
addr.shift();
|
||||
return addr;
|
||||
}
|
||||
|
||||
function convertToDBTheBehringerWay(f){
|
||||
if(f>=0.5){
|
||||
return f*40-30;
|
||||
}else if(f>=0.25){
|
||||
return f*80-50;
|
||||
}else if(f>=0.0625){
|
||||
return f*160-70;
|
||||
}else{
|
||||
return f*480-90;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user