mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-07-26 09:18:39 +00:00
initial prototype
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<tr class="fader" id="<%=type%>-<%=index%>">
|
||||
<td class="fader-channel"><%=index%></td>
|
||||
|
||||
<% if(type=="Control_Groups"){ %>
|
||||
<td class="fader-name lcd-control-group state-<%= fader ? fader.solo : '' %>">
|
||||
<%= fader ? fader.name : "-" %>
|
||||
</td>
|
||||
<% }else if(type=="Input_Channels"){ %>
|
||||
<td class="fader-name lcd-channel-input state-<%= fader ? fader.solo : '' %>">
|
||||
<%= fader ? (fader.Channel_Input ? fader.Channel_Input.name: "") : "" %>
|
||||
</td>
|
||||
<% }else if(type=="Group_Outputs"){ %>
|
||||
<td class="fader-name lcd-group-output state-<%= fader ? fader.solo : '' %>">
|
||||
<%= fader ? (fader.Buss_Trim ? fader.Buss_Trim.name: "") : "" %>
|
||||
</td>
|
||||
<% }else if(type=="Aux_Outputs"){ %>
|
||||
<td class="fader-name lcd-aux-output state-<%= fader ? fader.solo : '' %>">
|
||||
<%= fader ? (fader.Buss_Trim ? fader.Buss_Trim.name: "") : "" %>
|
||||
</td>
|
||||
<% } %>
|
||||
|
||||
<td class="fader-mute state-<%= fader ? fader.mute : '-' %>"></td>
|
||||
|
||||
<% if(fader){ %>
|
||||
<% let percent = (fader.fader-10)*1.5+100 %>
|
||||
<td class="fader-fader" style="background: linear-gradient(90deg, rgb(150, 150, 150, 0.2) <%=percent%>%, transparent <%=percent%>%);">
|
||||
<% if(fader.fader>-100){ %>
|
||||
<small style="mix-blend-mode: difference;"><%= fader ? Math.round(fader.fader*10.0)/10.0 : '-' %>db</small>
|
||||
<% } %>
|
||||
</td>
|
||||
<% }else{ %>
|
||||
<td>-</td>
|
||||
<% } %>
|
||||
|
||||
|
||||
</tr>
|
||||
+108
-20
@@ -1,9 +1,13 @@
|
||||
const _ = require('lodash');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
exports.config = {
|
||||
defaultName: 'DiGiCo',
|
||||
connectionType: 'osc-udp',
|
||||
defaultPort: 9000,
|
||||
mayChangePort: false,
|
||||
heartbeatInterval: 9000,
|
||||
defaultPort: 8000,
|
||||
mayChangePort: true,
|
||||
heartbeatInterval: 2000,
|
||||
heartbeatTimeout: 11000,
|
||||
searchOptions: {
|
||||
type: 'UDPsocket',
|
||||
@@ -11,8 +15,8 @@ exports.config = {
|
||||
searchBuffer: Buffer.from([
|
||||
0x2f, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2f, 0x4e, 0x61, 0x6d, 0x65, 0x2f, 0x3f,
|
||||
]),
|
||||
devicePort: 9000,
|
||||
listenPort: 8000,
|
||||
devicePort: 8000,
|
||||
listenPort: 9000,
|
||||
validateResponse(msg, info) {
|
||||
console.log(msg);
|
||||
console.log(msg.toString());
|
||||
@@ -28,18 +32,18 @@ exports.ready = function ready(_device) {
|
||||
device.send('/Console/Name/?');
|
||||
device.send('/Console/Session/Filename/?');
|
||||
device.send('/Console/Channels/?');
|
||||
device.send('/Console/Input_Channels/modes/?');
|
||||
device.send('/Console/Group_Outputs/modes/?');
|
||||
device.send('/Console/Aux_Outputs/modes/?');
|
||||
device.send('/Console/Multis/?');
|
||||
|
||||
device.send('/Snapshots/Surface_Snapshot/?');
|
||||
// device.send('/Console/Input_Channels/modes/?');
|
||||
// device.send('/Console/Group_Outputs/modes/?');
|
||||
// device.send('/Console/Aux_Outputs/modes/?');
|
||||
// device.send('/Console/Multis/?');
|
||||
|
||||
device.send('/Snapshots/Current_Snapshot/?');
|
||||
|
||||
device.send('/Input_Channels/?');
|
||||
// device.send('/Input_Channels/?'); // no response
|
||||
|
||||
device.send('/Layout/Layout/Banks/?');
|
||||
// device.send('/Layout/Layout/Banks/?');
|
||||
|
||||
// console.log(device);
|
||||
|
||||
// These are also sent by the iPad app but aren't queries (?) so may potentially write to console?
|
||||
// device.send('/Meters/clear');
|
||||
@@ -49,12 +53,81 @@ exports.data = function data(_device, oscData) {
|
||||
const device = _device;
|
||||
this.deviceInfoUpdate(device, 'status', 'ok');
|
||||
|
||||
console.log(oscData);
|
||||
setObjectProperty(device.data, oscData.address, oscData.args);
|
||||
console.log(device.data);
|
||||
const properties = oscData.address.split('/');
|
||||
properties.shift();
|
||||
setObjectProperty(device.data, properties, oscData.args);
|
||||
|
||||
// console.log(Object.keys(device.data.Control_Groups).length);
|
||||
|
||||
// console.log(properties);
|
||||
if (properties[1] === 'Control_Groups') {
|
||||
for (let i = 1; i <= device.data.Console.Control_Groups; i++) {
|
||||
device.send(`/Control_Groups/${i}/?`);
|
||||
}
|
||||
console.log('draw');
|
||||
device.draw();
|
||||
} else if (properties[0] === 'Control_Groups') {
|
||||
device.update('updateFader', {
|
||||
type: 'Control_Groups',
|
||||
channel: properties[1],
|
||||
});
|
||||
} else if (properties[0] === 'Console' && properties[1] === 'Input_Channels') {
|
||||
// console.log(properties);
|
||||
// console.log(device.data);
|
||||
// device.send(`/Input_Channels/1/?`);
|
||||
// device.send(`/Input_Channels/2/?`);
|
||||
for (let i = 1; i <= device.data.Console.Input_Channels; i++) {
|
||||
device.send(`/Input_Channels/${i}/Channel_Input/name`);
|
||||
device.send(`/Input_Channels/${i}/mute/?`);
|
||||
device.send(`/Input_Channels/${i}/solo/?`);
|
||||
device.send(`/Input_Channels/${i}/fader/?`);
|
||||
}
|
||||
device.draw();
|
||||
} else if (properties[0] === 'Input_Channels') {
|
||||
device.update('updateFader', {
|
||||
type: 'Input_Channels',
|
||||
channel: properties[1],
|
||||
});
|
||||
} else if (properties[0] === 'Console' && properties[1] === 'Group_Outputs') {
|
||||
for (let i = 1; i <= device.data.Console.Group_Outputs; i++) {
|
||||
device.send(`/Group_Outputs/${i}/mute/?`);
|
||||
device.send(`/Group_Outputs/${i}/solo/?`);
|
||||
device.send(`/Group_Outputs/${i}/fader/?`);
|
||||
device.send(`/Group_Outputs/${i}/Buss_Trim/name/?`);
|
||||
}
|
||||
device.draw();
|
||||
} else if (properties[0] === 'Group_Outputs') {
|
||||
device.update('updateFader', {
|
||||
type: 'Group_Outputs',
|
||||
channel: properties[1],
|
||||
});
|
||||
} else if (properties[0] === 'Console' && properties[1] === 'Aux_Outputs') {
|
||||
for (let i = 1; i <= device.data.Console.Aux_Outputs; i++) {
|
||||
device.send(`/Aux_Outputs/${i}/mute/?`);
|
||||
device.send(`/Aux_Outputs/${i}/solo/?`);
|
||||
device.send(`/Aux_Outputs/${i}/fader/?`);
|
||||
device.send(`/Aux_Outputs/${i}/Buss_Trim/name/?`);
|
||||
}
|
||||
device.draw();
|
||||
} else if (properties[0] === 'Aux_Outputs') {
|
||||
device.update('updateFader', {
|
||||
type: 'Aux_Outputs',
|
||||
channel: properties[1],
|
||||
});
|
||||
} else if (properties[0] === 'Console' && properties[1] === 'Name') {
|
||||
this.deviceInfoUpdate(device, 'defaultName', device.data.Console.Name);
|
||||
} else if (properties[0] === 'Snapshots') {
|
||||
device.update('updateSnapshot', {
|
||||
snapshots: device.data.Snapshots,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.heartbeat = function heartbeat(device) {};
|
||||
exports.heartbeat = function heartbeat(device) {
|
||||
device.send('/Console/Name/?');
|
||||
// device.draw();
|
||||
console.log(device.data);
|
||||
};
|
||||
|
||||
class DiGiCo {
|
||||
constructor() {
|
||||
@@ -80,10 +153,10 @@ class DiGiCo {
|
||||
}
|
||||
|
||||
*/
|
||||
function setObjectProperty(_object, path, value) {
|
||||
function setObjectProperty(_object, _properties, value) {
|
||||
let object = _object;
|
||||
const properties = path.split('/');
|
||||
properties.shift();
|
||||
const properties = _properties;
|
||||
|
||||
for (let i = 0; i < properties.length - 1; i++) {
|
||||
const property = properties[i];
|
||||
if (object[property] === undefined) {
|
||||
@@ -101,3 +174,18 @@ function setObjectProperty(_object, path, value) {
|
||||
}
|
||||
object[property] = value;
|
||||
}
|
||||
|
||||
const faderTemplate = _.template(fs.readFileSync(path.join(__dirname, `/fader.ejs`)));
|
||||
exports.update = function update(device, doc, updateType, data) {
|
||||
if (updateType === 'updateFader') {
|
||||
const $elem = doc.getElementById(`${data.type}-${data.channel}`);
|
||||
$elem.outerHTML = faderTemplate({
|
||||
type: data.type,
|
||||
fader: device.data[data.type][data.channel],
|
||||
index: data.channel,
|
||||
});
|
||||
} else if (updateType === 'updateSnapshot') {
|
||||
const $elem = doc.getElementById(`snapshot`);
|
||||
$elem.textContent = `${data.snapshots.Current_Snapshot}`;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
.column {
|
||||
float: left;
|
||||
margin: 5px;
|
||||
}
|
||||
.section {
|
||||
border: #333 3px solid;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
padding: 10px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.section h3 {
|
||||
font-weight: 300;
|
||||
margin-top: 0px;
|
||||
color: #aaa !important;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
display: block;
|
||||
}
|
||||
.fader:nth-child(even) {
|
||||
background: #1a1a1a;
|
||||
}
|
||||
.fader:nth-child(odd) {
|
||||
background: #1f1f1f;
|
||||
}
|
||||
.fader td {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
height: 20px;
|
||||
border: black 1px solid;
|
||||
}
|
||||
.fader .fader-channel {
|
||||
color: #444;
|
||||
font-size: 10px;
|
||||
}
|
||||
.fader .fader-name {
|
||||
width: 80px;
|
||||
color: black;
|
||||
font-family: monospace;
|
||||
}
|
||||
.fader .lcd-control-group {
|
||||
background-color: rgb(66, 132, 255);
|
||||
}
|
||||
.fader .lcd-channel-input {
|
||||
background-color: rgb(135, 175, 235);
|
||||
}
|
||||
.fader .lcd-group-output {
|
||||
background-color: rgb(241, 71, 48);
|
||||
}
|
||||
.fader .lcd-aux-output {
|
||||
background-color: rgb(197, 0, 187);
|
||||
}
|
||||
.fader .fader-name.state-1 {
|
||||
background-color: rgb(0, 185, 0);
|
||||
}
|
||||
.fader .fader-mute {
|
||||
width: 10px;
|
||||
background-color: #444;
|
||||
}
|
||||
.fader .fader-mute.state-1 {
|
||||
background-color: red;
|
||||
}
|
||||
.fader .fader-fader {
|
||||
text-align: left;
|
||||
width: 70px;
|
||||
padding: 0px 10px;
|
||||
color: rgb(68, 68, 68);
|
||||
}
|
||||
|
||||
#snapshot {
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
font-family: 'Arial Black', 'Impact';
|
||||
}
|
||||
|
||||
@@ -2,3 +2,55 @@
|
||||
<h1><%= listName %></h1>
|
||||
<h2><%= data.Console.Session.Filename %></h2>
|
||||
</header>
|
||||
|
||||
<%
|
||||
const fs = require('fs');
|
||||
let _ = require('lodash');
|
||||
const path = require('path');
|
||||
|
||||
let faderTemplate = _.template(fs.readFileSync(path.join(__dirname, `/plugins/digico/fader.ejs`)));
|
||||
%>
|
||||
|
||||
<div class="column">
|
||||
<div class="section">
|
||||
<h3>snapshot <span id="snapshot"></span></h3>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3>control groups</h3>
|
||||
<table>
|
||||
<% for(let i=1; i<=data.Console.Control_Groups; i++){ %>
|
||||
<%= faderTemplate({type: "Control_Groups", fader: data.Control_Groups[i], index: i}) %>
|
||||
<% } %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3>group outputs</h3>
|
||||
<table>
|
||||
<% for(let i=1; i<=data.Console.Group_Outputs; i++){ %>
|
||||
<%= faderTemplate({type: "Group_Outputs", fader: data.Group_Outputs[i], index: i}) %>
|
||||
<% } %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h3>aux outputs</h3>
|
||||
<table>
|
||||
<% for(let i=1; i<=data.Console.Aux_Outputs; i++){ %>
|
||||
<%= faderTemplate({type: "Aux_Outputs", fader: data.Aux_Outputs[i], index: i}) %>
|
||||
<% } %>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column section">
|
||||
<h3>input channels</h3>
|
||||
<table>
|
||||
<% for(let i=1; i<=data.Console.Input_Channels; i++){ %>
|
||||
<%= faderTemplate({type: "Input_Channels", fader: data.Input_Channels[i], index: i}) %>
|
||||
<% } %>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ function initDeviceConnection(id) {
|
||||
if (plugins[type].config.connectionType.includes('udp')) {
|
||||
device.connection = new osc.UDPPort({
|
||||
localAddress: '0.0.0.0',
|
||||
localPort: 8001, // added this line
|
||||
remoteAddress: device.addresses[0],
|
||||
remotePort: device.port,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user