Skip to content

Commit

Permalink
Merge pull request #8 from jrviz/master
Browse files Browse the repository at this point in the history
Additional Feedbacks
  • Loading branch information
josephdadams authored Jan 26, 2022
2 parents 5f5d841 + 313ef7b commit a44ae65
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 17 deletions.
1 change: 1 addition & 0 deletions HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ This module will allow you to control a Roland V-60HD video switcher.

**Available feedbacks:**
Input status for Program, Preset and Aux
Status for DSK, Output Fade and PinP/SPLIT
110 changes: 95 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class instance extends instance_skel {
// multiple rapid Query strings can result in async multiple responses so split response into individual messages
let allresponses = pipeline.split(';')
// last element will either be a partial response an <ack> (processed next timer tick) or an empty string from split where a complete pipeline ends with ';'
pipeline = allresponses.pop()
pipeline = allresponses.pop()
for (let response of allresponses) {
// Chance of leading <ack> responses from key commands or prior Query
while (response.charAt[0] == '\u0006') {
Expand All @@ -124,12 +124,12 @@ class instance extends instance_skel {
}
cmdPipeNext() {
if (this.cmdPipe.length > 0) {
return this.cmdPipe.pop()
return this.cmdPipe.pop()
} else {
this.log('error', 'Unexpected response count (pipe underrun)')
return ''
this.log('error', 'Unexpected response count (pipe underrun)')
return ''
}
}
}
processResponse(response) {
let category = 'XXX'
let args = []
Expand All @@ -152,22 +152,22 @@ class instance extends instance_skel {
}
this.log('error', 'ERR: ' + errstring + ' - Command = ' + pipeitem)
}

let settingseparator = response.search(':')
if (settingseparator > 2) {
category = response.substring(settingseparator - 3, settingseparator)
let argstring = response.substring(settingseparator + 1, response.length) // from start of params to end of string
args = argstring.split(',')
}
}
switch (category) {
case 'QPL': //button settings array (polled)
this.buttonSet = args
this.checkFeedbacks()
break
case 'ERR':
errorMessage(args[0], this.cmdPipeNext())
break
}
break
}
}
sendCommmand(cmd) {
if (cmd !== undefined) {
Expand Down Expand Up @@ -303,11 +303,11 @@ class instance extends instance_skel {
dsk_pvw: {
label: 'Press the DSK [PVW] button',
},
dsk_automixing: {
label: 'Press the DSK [AUTO MIXING] button',
automixing: {
label: 'Press the [AUTO MIXING] button',
},
dsk_outputfade: {
label: 'Press the DSK [OUTPUT FADE] button',
outputfade: {
label: 'Press the [OUTPUT FADE] button',
},
pinp1_position: {
label: 'Adjust display position of inset screen assigned to the [PinP 1] button',
Expand Down Expand Up @@ -538,10 +538,10 @@ class instance extends instance_skel {
case 'dsk_pvw':
cmd = 'DVW'
break
case 'dsk_automixing':
case 'automixing':
cmd = 'ATM'
break
case 'dsk_outputfade':
case 'outputfade':
cmd = 'FDE'
break
case 'pinp1_position':
Expand Down Expand Up @@ -668,6 +668,86 @@ class instance extends instance_skel {
}
},
}
feedbacks['dsk'] = {
type: 'boolean',
label: 'DSK Status',
description: 'Show DSK status',
style: {
color: this.rgb(0, 0, 0),
bgcolor: this.rgb(255, 0, 0),
},
callback: (feedback, bank) => {
if (this.buttonSet[4] == '1') {
return true
} else {
return false
}
},
}
feedbacks['PinP1status'] = {
type: 'boolean',
label: 'PinP 1 Status',
description: 'Show PinP 1 status',
style: {
color: this.rgb(0, 0, 0),
bgcolor: this.rgb(0, 255, 0),
},
callback: (feedback, bank) => {
if (this.buttonSet[3] == '1') {
return true
} else {
return false
}
},
}
feedbacks['PinP2status'] = {
type: 'boolean',
label: 'PinP 2 Status',
description: 'Show PinP 2 status',
style: {
color: this.rgb(0, 0, 0),
bgcolor: this.rgb(0, 255, 0),
},
callback: (feedback, bank) => {
if (this.buttonSet[3] == '2') {
return true
} else {
return false
}
},
}
feedbacks['SPLITstatus'] = {
type: 'boolean',
label: 'SPLIT Status',
description: 'Show SPLIT status',
style: {
color: this.rgb(0, 0, 0),
bgcolor: this.rgb(0, 255, 0),
},
callback: (feedback, bank) => {
if (this.buttonSet[3] == '3') {
return true
} else {
return false
}
},
}
feedbacks['outputfade'] = {
type: 'boolean',
label: 'Output Fade Status',
description: 'Show Output Fade status',
style: {
color: this.rgb(0, 0, 0),
bgcolor: this.rgb(255, 0, 0),
},
callback: (feedback, bank) => {
if (this.buttonSet[5] == '1') {
return true
} else {
return false
}
},
}
this.setFeedbackDefinitions(feedbacks)
}
initPresets() {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "roland-v60hd",
"version": "1.0.10",
"version": "1.0.11",
"api_version": "1.0.0",
"keywords": [ "Vision Mixer", "Video Switcher" ],
"manufacturer": "Roland",
Expand All @@ -16,7 +16,7 @@
"url": "git+https://github.com/bitfocus/companion-module-roland-v60hd.git"
},
"author": "Joseph Adams <[email protected]>",
"contributors": ["James Rankin"],
"contributors": ["James Rankin <[email protected]>"],
"license": "MIT",
"bugs": {
"url": "https://github.com/bitfocus/companion-module-roland-v60hd/issues"
Expand Down

0 comments on commit a44ae65

Please sign in to comment.