Merge pull request #19 from stagehacks/qlab-qlab5

QLab 5 Support
This commit is contained in:
sparks-alec
2022-12-10 04:18:36 -05:00
committed by GitHub
8 changed files with 50 additions and 25 deletions
+11 -2
View File
@@ -24,8 +24,17 @@
<% } %>
</center></td>
<% if(cue.type == "Group"){ %>
<td><img src="./plugins/qlab/img/v5/group-<%= cue.groupMode %>.png" height="20px"></td>
<% }else{ %>
<td><img src="./plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
<% } %>
<td><img src="./plugins/qlab/img/<%= cue.type.toLowerCase().replace(' ','-') %>.png" height="20px"></td>
<td><center><%= cue.number || "&nbsp;" %></center></td>
@@ -86,7 +95,7 @@
<% if(cue.preWait){ %>
<td class="q-time hide-medium"><%= elapsedTime(cue.preWait, cue.preWaitElapsed, "preWait", cue) %></td>
<td class="q-time hide-small"><%= elapsedTime(cue.preWait, cue.preWaitElapsed, "preWait", cue) %></td>
<% }else{ %>
<td class="q-time q-gray-text hide-small">00:00.00</td>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+33 -23
View File
@@ -16,7 +16,7 @@ const cueTemplate = _.template(fs.readFileSync(path.join(__dirname, `cue.ejs`)))
const tileTemplate = _.template(fs.readFileSync(path.join(__dirname, `tile.ejs`)));
const cartTemplate = _.template(fs.readFileSync(path.join(__dirname, `cart.ejs`)));
exports.defaultName = 'QLab 4';
exports.defaultName = 'QLab';
exports.connectionType = 'osc';
exports.heartbeatInterval = 50;
exports.heartbeatTimeout = 2000;
@@ -73,25 +73,28 @@ exports.data = function data(_device, oscData) {
workspace.cueLists = {};
workspace.cues = {};
json.data.forEach(cueList => {
workspace.cueLists[cueList.uniqueID] = cueList;
addCueToWorkspace(workspace, cueList);
});
if(json.data){
device.draw();
setTimeout(() => {
json.data.forEach(ql => {
workspace.cueLists[ql.uniqueID] = ql;
getValuesForKeys(device, json.workspace_id, ql);
json.data.forEach(cueList => {
workspace.cueLists[cueList.uniqueID] = cueList;
addCueToWorkspace(workspace, cueList);
});
}, 0);
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "children"])){
device.draw();
setTimeout(() => {
json.data.forEach(ql => {
workspace.cueLists[ql.uniqueID] = ql;
getValuesForKeys(device, json.workspace_id, ql);
});
}, 0);
}
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "children"]) || match(oscAddressParts, ["reply", "workspace", "*", "cue_id", "*", "children"])){
const json = JSON.parse(oscData.args[0]);
const workspace = device.data.workspaces[json.workspace_id];
const cueID = oscAddressParts[2];
const cueID = json.address.substring(55, 91);
const cue = workspace.cues[cueID];
if(!_.isEqual(cue.cues, json.data)){
@@ -101,7 +104,7 @@ exports.data = function data(_device, oscData) {
getValuesForKeys(device, json.workspace_id, cue);
}
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "valuesForKeys"])){
}else if(match(oscAddressParts, ["reply", "cue_id", "*", "valuesForKeys"]) || match(oscAddressParts, ["reply", "workspace", "*", "cue_id", "*", "valuesForKeys"])){
const json = JSON.parse(oscData.args[0]);
const cueValues = json.data;
@@ -124,7 +127,7 @@ exports.data = function data(_device, oscData) {
cue.flagged = cueValues.isFlagged;
cue.paused = cueValues.isPaused;
cue.type = cueValues.type;
cue.cues = cueValues.children;
//cue.cues = cueValues.children;
cue.preWait = cueValues.preWait;
cue.postWait = cueValues.postWait;
cue.duration = cueValues.currentDuration;
@@ -139,6 +142,13 @@ exports.data = function data(_device, oscData) {
cue.actionElapsed = cueValues.actionElapsed;
cue.postWaitElapsed = cueValues.postWaitElapsed;
// QLab 5 fix
if(cueValues.type=="Group" || cueValues.type=="Cue List"){
cue.cues = cueValues.children;
}else{
cue.cues = undefined;
}
const nestedGroupModes = [];
const nestedGroupPosition = [];
@@ -181,7 +191,7 @@ exports.data = function data(_device, oscData) {
const json = JSON.parse(oscData.args[0]);
const workspace = device.data.workspaces[json.workspace_id];
const cue = workspace.cues[oscAddressParts[2]];
const cue = workspace.cues[json.address.substring(55, 91)];
cue.preWaitElapsed = json.data;
lastElapsedUpdate = Date.now();
@@ -192,7 +202,7 @@ exports.data = function data(_device, oscData) {
const json = JSON.parse(oscData.args[0]);
const workspace = device.data.workspaces[json.workspace_id];
const cue = workspace.cues[oscAddressParts[2]];
const cue = workspace.cues[json.address.substring(55, 91)];
cue.actionElapsed = json.data;
lastElapsedUpdate = Date.now();
@@ -203,7 +213,7 @@ exports.data = function data(_device, oscData) {
const json = JSON.parse(oscData.args[0]);
const workspace = device.data.workspaces[json.workspace_id];
const cue = workspace.cues[oscAddressParts[2]];
const cue = workspace.cues[json.address.substring(55, 91)];
cue.postWaitElapsed = json.data;
lastElapsedUpdate = Date.now();
@@ -352,14 +362,14 @@ exports.heartbeat = function heartbeat(device) {
heartbeatCount++;
if(Date.now() - lastElapsedUpdate > 300){
interval = 5;
interval = 24;
}else{
interval = 1;
}
if(heartbeatCount % interval === 0){
device.send(`/cue/active/preWaitElapsed`);
device.send(`/cue/active/actionElapsed`);
device.send(`/cue/active/postWaitElapsed`);
device.send(`/cue_id/active/preWaitElapsed`);
device.send(`/cue_id/active/actionElapsed`);
device.send(`/cue_id/active/postWaitElapsed`);
}
};
+6
View File
@@ -151,6 +151,12 @@ tr.playback-position .q-gray-text {
.gMode-4 {
border-color: #925fc0;
}
.gMode-4 {
border-color: #925fc0;
}
.gMode-6 {
border-color: #D05B15;
}
.gMode-,
.gMode-0 {
border-color: rgba(0, 0, 0, 0);