Skip to content

Commit

Permalink
Merge pull request #100 from istnv/feat/q5_audition
Browse files Browse the repository at this point in the history
Add Q5 Overrides and support new Audition monitors
  • Loading branch information
istnv authored Oct 8, 2023
2 parents 55605e3 + 1b0a896 commit e3e8e6d
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 424 deletions.
73 changes: 68 additions & 5 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export function compileActionDefinitions(self) {
} else if (cmd !== undefined) {
self.log('debug', `sending ${cmd} ${JSON.stringify(args)} to ${self.config.host}`)
// everything except 'auditionWindow' and 'overrideWindow' works on a specific workspace
self.sendOSC(cmd, args, ['/auditionWindow', '/overrideWindow'].includes(cmd))
self.sendOSC(cmd, args, ['/auditionWindow', '/alwaysAudition', '/overrideWindow'].includes(cmd))
}
// QLab does not send window updates so ask for status
if (self.useTCP && ['/auditionWindow', '/overrideWindow'].includes(cmd)) {
if (self.useTCP && ['/auditionWindow', '/alwaysAudition', '/overrideWindow'].includes(cmd)) {
self.sendOSC(cmd, [], true)
self.sendOSC('/cue/playhead/valuesForKeys', self.qCueRequest)
}
Expand All @@ -47,6 +47,14 @@ export function compileActionDefinitions(self) {
await sendCommand(action, '/go')
},
},
audition_go: {
name: 'Audition GO',
description: 'QLab 5 ONLY',
options: [],
callback: async (action, context) => {
await sendCommand(action, '/auditionGo')
},
},
stop: {
name: 'Stop',
options: [],
Expand Down Expand Up @@ -226,6 +234,40 @@ export function compileActionDefinitions(self) {
await sendCommand(action, '/cue/' + optCue + '/panicInTime', timeArg)
},
},
audition_go_cue: {
name: 'Audition Cue',
description: 'QLab5 ONLY',
options: [
{
type: 'textinput',
label: 'Cue',
id: 'cue',
default: '1',
useVariables: true,
},
],
callback: async (action, context) => {
const optCue = await context.parseVariablesInString(action.options.cue)
await sendCommand(action, '/cue/' + optCue + '/audition')
},
},
audition_go_id: {
name: 'Audition Cue ID',
description: 'QLab5 ONLY',
options: [
{
type: 'textinput',
label: 'Cue',
id: 'cueId',
default: '1',
useVariables: true,
},
],
callback: async (action, context) => {
const optCueId = await context.parseVariablesInString(action.options.cueId)
await sendCommand(action, '/cue_id/' + optCueId + '/audition')
},
},
goto_id: {
name: 'Goto (Cue ID)',
options: [
Expand All @@ -239,7 +281,7 @@ export function compileActionDefinitions(self) {
],
callback: async (action, context) => {
const optCueId = await context.parseVariablesInString(action.options.cueId)
const phID = (self.qVer< 5 ? 'Id' : 'ID')
const phID = self.qVer < 5 ? 'Id' : 'ID'
await sendCommand(action, `/playhead${phID}/` + optCueId)
},
},
Expand Down Expand Up @@ -334,7 +376,8 @@ export function compileActionDefinitions(self) {
},
},
auditMode: {
name: 'Audition Window',
name: 'Audition',
description: `QLab 5 sets 'Always Audition' mode\nOtherwise Show/Hide 'Audition Window'`,
options: [
{
type: 'dropdown',
Expand All @@ -345,12 +388,32 @@ export function compileActionDefinitions(self) {
},
],
callback: async (action, context) => {
await sendCommand(action, '/auditionWindow', {
const act = self.qVer < 5 ? '/auditionWindow' : '/alwaysAudition'
await sendCommand(action, act, {
type: 'i',
value: setToggle(self.auditMode, action.options.onOff),
})
},
},
auditWindows: {
name: 'Audition Monitors',
description: 'QLab 5 only, open/close ALL audition monitors',
options: [
{
type: 'dropdown',
label: 'Mode',
id: 'onOff',
default: 1,
choices: Choices.TOGGLE,
},
],
callback: async (action, context) => {
await sendCommand(action, '/auditionMonitors', {
type: 'i',
value: setToggle(self.auditMonitors, action.options.onOff),
})
},
},
overrideWindow: {
name: 'Override Controls Window',
options: [
Expand Down
25 changes: 15 additions & 10 deletions choices.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ export const ON_OFF = [
]

export const OVERRIDE = [
{ id: 'midiInputEnabled', label: 'Midi Input' },
{ id: 'midiOutputEnabled', label: 'Midi Output' },
{ id: 'mscInputEnabled', label: 'MSC Input' },
{ id: 'mscOutputEnabled', label: 'MSC Output' },
{ id: 'sysexInputEnabled', label: 'SysEx Input' },
{ id: 'sysexOutputEnabled', label: 'SysEx Output' },
{ id: 'oscOutputEnabled', label: 'OSC Output' },
{ id: 'timecodeInputEnabled', label: 'Timecode Input' },
{ id: 'timecodeOutputEnabled', label: 'Timecode Output' },
{ id: 'artNetEnabled', label: 'Art-Net Enabled' },
{ id: 'midiInputEnabled', label: 'Midi Input [4, 5]' },
{ id: 'midiOutputEnabled', label: 'Midi Output [4, 5]' },
{ id: 'mscInputEnabled', label: 'MSC Input [4, 5]' },
{ id: 'mscOutputEnabled', label: 'MSC Output [4, 5]' },
{ id: 'sysexInputEnabled', label: 'SysEx Input [4, 5]' },
{ id: 'sysexOutputEnabled', label: 'SysEx Output [4, 5]' },
{ id: 'oscOutputEnabled', label: 'OSC Output [4]' },
{ id: 'timecodeInputEnabled', label: 'Timecode Input [4, 5]' },
{ id: 'timecodeOutputEnabled', label: 'Timecode Output [4, 5]' },
{ id: 'artNetEnabled', label: 'Art-Net Enabled [4]' },
{ id: 'dmxOutputEnabled', label: 'DMX Output [5]' },
{ id: 'networkExternalInputEnabled', label: 'External Network Input [5]' },
{ id: 'networkExternalOutputEnabled', label: 'External Network Output [5]' },
{ id: 'networkLocalInputEnabled', label: 'Local Network Input [5]' },
{ id: 'networkLocalOutputEnabled', label: 'Local Network Output [5]' },
]
18 changes: 9 additions & 9 deletions companion/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ https://github.com/sponsors/istnv

## Configuration

| Setting | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Target IP** | Enter the address of the QLab computer. You can enter 127.0.0.1 if Companion is running on the same computer. |
| **Target Port** | Enter the port number where QLab is listening for OSC messages. This defaults to 53000. Has no effect on QLab4 (or QLab3) |
| **Use TCP?** | Check to enable TCP mode. This is required for variables and feedback. |
| **Use Tenths** | If checked, the variable _r_left_ will display 0.1 seconds when less than 5 seconds. If unchecked, the time left will be adjusted by 1 second for a more accurate count-down. |
| **OSC Passcode** | Enter a passcode if needed for the QLab workspace. QLab 5 requires a passcode to work reliably from Companion. |
| Setting | Description |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target IP** | Enter the address of the QLab computer. You can enter 127.0.0.1 if Companion is running on the same computer. |
| **Target Port** | Enter the port number where QLab is listening for OSC messages. This defaults to 53000. Has no effect on QLab4 (or QLab3) |
| **Use TCP?** | Check to enable TCP mode. This is required for variables and feedback. |
| **Use Tenths** | If checked, the variable _r_left_ will display 0.1 seconds when less than 5 seconds. If unchecked, the time left will be adjusted by 1 second for a more accurate count-down. |
| **OSC Passcode** | Enter a passcode if needed for the QLab workspace. QLab 5 requires a passcode to work reliably from Companion. |
| **Workspace** | Dropdown selection to select a specific Workspace. You can enter 'default' or leave blank to control front-most workspace (if more than one is open) in QLab4. QLab5 commands go to all open workspaces. You can change the IP Control Port too allow multiple workspaces open at once. |
| **Specific Cue List** | Dropdown selection to limit control to a specific cuelist. |
| **Specific Cue List** | Dropdown selection to limit control to a specific cuelist. |

## Actions

Expand All @@ -59,7 +59,7 @@ https://github.com/sponsors/istnv
| **Show Mode** | Enable for Show Mode, Disable for Edit Mode. |
| **Audition Window** | Show or Hide the Audition Window. |
| **Override Window** | Show or Hide the Override Controls Window. |
| **Master Override** | Set Master override for Midi, MSC, SysEx, OSC, Timecode, Art-Net On or Off |
| **Master Override** | Toggle or Set Master overrides. Enabling an override will open/show the Override Control window <br/><ul><li> QLab 4 and 5: Midi, MSC, SysEx, Timecode </li><li> QLab 4 only: OSC, Art-Net </li><li> QLab 5 only: Dmx, External/Local Network </li></ul> |
| **Set Minimum Go** | Sets the time for double-GO protection |
| **Increase Prewait** | Increases the prewait time by given time for the selected cue. |
| **Decrease Prewait** | Decreases the prewait time by given time for the selected cue. |
Expand Down
2 changes: 2 additions & 0 deletions cues.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Cue {
isPaused = false
isArmed = false
isFlagged = false
isAuditioning = false
infiniteLoop = false
holdLastFrame = false
autoLoad = false
Expand Down Expand Up @@ -37,6 +38,7 @@ function JSONtoCue(newCue, j, self) {
newCue.qColorName = j.colorName
newCue.qType = j.type.toLowerCase()
newCue.isRunning = j.isRunning
newCue.isAuditioning = j.isAuditioning
newCue.isLoaded = j.isLoaded
newCue.isBroken = j.isBroken
newCue.isPaused = j.isPaused
Expand Down
25 changes: 22 additions & 3 deletions feedbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,27 @@ export function compileFeedbackDefinitions(self) {
}
},
},
ws_audit: {
type: 'boolean',
name: 'Audit Monitors',
description: 'Set Button when ALL Audit monitors are open',
options: [
// {
// type: 'dropdown',
// label: 'Override',
// id: 'which',
// default: 1,
// choices: Choices.ON_OFF,
// },
],
defaultStyle: {
color: combineRgb(255, 255, 255),
bgcolor: combineRgb(102, 0, 0),
},
callback: (feedback, context) => {
return !!self.auditMonitors
},
},
override: {
type: 'boolean',
name: 'Master Override',
Expand Down Expand Up @@ -211,9 +232,7 @@ export function compileFeedbackDefinitions(self) {
bgcolor: combineRgb(102, 0, 0),
},
callback: (feedback, context) => {
const options = feedback.options

return self.overrideWindow == 1
return !!self.overrideWindow
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figure53-qlab-advance",
"version": "2.2.2",
"version": "2.3.0",
"main": "qlabfb.js",
"type": "module",
"scripts": {
Expand Down
Loading

0 comments on commit e3e8e6d

Please sign in to comment.