Skip to content

Commit

Permalink
Merge pull request #2 from jrviz/master
Browse files Browse the repository at this point in the history
logo control and help update
  • Loading branch information
josephdadams authored Jul 29, 2021
2 parents 76e8fe5 + 8b5e901 commit 93d2e81
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
12 changes: 10 additions & 2 deletions help.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,17 @@ Example: `http:get,http://www.techministry.blog` : This would perform an HTTP GE

## Companion Button Press

Format: `companion:[bank],[button]`
Format: `companion:[bank],[button]` or `cbp:[bank],[button]`

* `bank`: The page in Companion where the button is
* `button`: The button on the page that you wish to press

Example: `companion:1,2` : This would press Button 2 on Page 1.
Example: `companion:1,2` : This would press Button 2 on Page 1.

## Turn bridge logo on or off

Format: `logo:[switch]`

* `switch`: Either `on` or `off`

Example: `logo:on` : To turn the logo on.
15 changes: 12 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,16 @@ function handleStageDisplayMessage(message) {
function parseStageDisplayMessage(text) {
if (text !== '') {
console.log('Stage Display Message: ' + text);
let commands = text.split(';');
let commands = text.replace(/\s/g, "").split(';');
for (let i = 0; i < commands.length; i++) {
let command = commands[i].substring(0, commands[i].indexOf(':'));
let command = commands[i].substring(0, commands[i].indexOf(':'))
console.log('Command: ' + command);
let parameters = commands[i].substring(commands[i].indexOf(':')+1).split(',');
console.log('Parameters: ' + parameters);

let commandObj = {};

if (parameters) {
if (command !== '' && parameters) {
switch(command.toLowerCase()) {
case 'noteon':
//"noteon:0,55,100" Note On Command, Channel 1 (zero based), Note 55, Velocity 100
Expand Down Expand Up @@ -777,6 +777,15 @@ function parseStageDisplayMessage(text) {
commandObj.button = parameters[1];
sendCompanionMessage(commandObj);
break;
case 'logo':
//"logo:on"
if (parameters[0].toLowerCase() === 'on') {
presentationbridge_gotologo();
}
else {
presentationbridge_turnofflogo();
}
break;
default:
console.log('Invalid command');
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "presentationbridge-client",
"productName": "PresentationBridge Client",
"version": "1.0.1",
"version": "1.0.2",
"description": "Links data from your Presentation/lyrics software to other software.",
"license": "MIT",
"repository": "josephdadams/presentationbridge-client",
Expand Down

0 comments on commit 93d2e81

Please sign in to comment.