Initial prettify

This commit is contained in:
Sam Schloegel
2022-01-03 10:51:25 -05:00
parent 551d29da60
commit c5691b56c9
26 changed files with 2602 additions and 2545 deletions
+89 -72
View File
@@ -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
View File
@@ -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 "-&infin;";
}
if(val>0){
return "+"+val.toFixed(1);
}
return val.toFixed(1);
}
%>
<% function formatAsDB(val){ if(val==-90){ return "-&infin;"; } if(val>0){
return "+"+val.toFixed(1); } return val.toFixed(1); } %>
+118 -115
View File
@@ -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;
}
}