From ecc82882232a13eeed2bad382b0278e0d6c5e946 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 19 Feb 2023 16:46:07 -0600 Subject: [PATCH] add activation displaying --- plugins/scs/main.js | 24 ++++++++++++++++++++++-- plugins/scs/template.ejs | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/plugins/scs/main.js b/plugins/scs/main.js index 638a545..ff8712e 100644 --- a/plugins/scs/main.js +++ b/plugins/scs/main.js @@ -44,6 +44,23 @@ const versionMap = { 50: 'PLAT', }; +const activationMap = { + man: 'Manual', + 'm+c': 'Manual w/ Confirmation', + auto: 'Auto-start', + 'a+c': 'Auto-start w/ Confirmation', + callq: 'Call Cue', + hot: 'Hotkey (Trigger)', + hktg: 'Hotkey (Toggle)', + hknt: 'Hotkey (Note)', + time: 'Time-Based', + ext: 'External (Trigger)', + extg: 'External (Toggle)', + exnt: 'External (Note)', + mtc: 'MIDI Time Code', + ocm: 'On Cue Marker', +}; + exports.ready = function ready(_device) { const device = _device; console.log('Show Cue Systems ready'); @@ -82,7 +99,7 @@ exports.data = function data(_device, message) { description: '', type: { code: '', display: '' }, state: '', - activation: '', + activation: { code: '', display: '' }, file_info: '', length: '', colors: ['', ''], @@ -141,7 +158,10 @@ exports.data = function data(_device, message) { device.data.cues[cueIndex].length = millisToString(itemParts[6]); device.data.cues[cueIndex].state = itemParts[7]; device.data.cues[cueIndex].position = itemParts[8]; - device.data.cues[cueIndex].activation = sanitizeSCSString(itemParts[9]); + device.data.cues[cueIndex].activation = { + code: sanitizeSCSString(itemParts[9]), + display: activationMap[sanitizeSCSString(itemParts[9])], + }; device.data.cues[cueIndex].repeat = itemParts[10]; device.data.cues[cueIndex].loop = itemParts[11]; device.draw(); diff --git a/plugins/scs/template.ejs b/plugins/scs/template.ejs index 0d4ac32..d00d628 100644 --- a/plugins/scs/template.ejs +++ b/plugins/scs/template.ejs @@ -18,7 +18,7 @@ <%=cue.description%> <%=cue.type.display%> <%=cue.state%> - <%=cue.activation%> + <%=cue.activation.display%> <%=cue.length%> <% }) %>