Skip to content

Commit

Permalink
Merge pull request #6 from bsmith96/openstagecontrol-module
Browse files Browse the repository at this point in the history
Future proofing, and easier setup
  • Loading branch information
bsmith96 committed Oct 6, 2021
2 parents 8b51dfb + 36b54ed commit 5b47feb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
This version runs entirely within the Open Stage Control software, as a 'custom module'. It also - theoretically - requires less of the Qlab computer, as it does not constantly send messages asking the current position. Instead, it prompts Qlab to give it updates when there are changes, and interprets the response appropriately.

- First, open `open-stage-control-config.json` and fill out the appropriate information – the Qlab IP address should be simple, and if you are using the built in template `open-stage-control-template.json` (within the `open-stage-control-module` folder) you shouldn't need to change the addresses. To find the workspace ID and Cue List ID, on your Qlab mac, run `Get-IDs.applescript`.
- Open **Open Stage Control**. Set the following settings, using files from the `open-stage-control-module` folder:
- Open **Open Stage Control**. Load `Get-Playhead.config` in the Open Stage Control menu.
- Alternatively, Set the following settings, using files from the `open-stage-control-module` folder:
- **load**: select the file "open-stage-control-template.json"
- **custom-module**: select the file "get-display-name-from-id.js"
- **osc-port**: set 53001. This is the port it will listen for replies from.
Expand Down
2 changes: 1 addition & 1 deletion open-stage-control-module/Get-IDs.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tell application id "com.figure53.Qlab.4" to tell front workspace

-- write text to paste in config file
set jsonString to "\"workspaceID\":\"" & workspaceID & "\",
\"cueListID\": \"" & cueListID & "\","
\"cueListID\": \"" & cueListID & "\""

-- copy the text
set the clipboard to jsonString
Expand Down
1 change: 1 addition & 0 deletions open-stage-control-module/Get-Playhead.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"custom-module":"/Users/Ben/Documents/qlab-display/open-stage-control-module/get-display-name-from-id.js","port":7000,"no-gui":true,"load":"/Users/Ben/Documents/qlab-display/open-stage-control-module/open-stage-control-template.json","osc-port":53001}
16 changes: 10 additions & 6 deletions open-stage-control-module/get-display-name-from-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ var config = loadJSON("open-stage-control-config.json");
var nameAddress = config.address.name;
var numAddress = config.address.number;

var qlabIP = config.qlabIP;
var workspaceID = config.workspaceID;
var cueListID = config.cueListID;
var qlabIP = config.QlabMain.ip;
var workspaceID = config.QlabMain.workspaceID;
var cueListID = config.QlabMain.cueListID;

module.exports = {

// ON START, ASK QLAB FOR UPDATES
init:function(){
send(qlabIP, 53000, '/workspace/' + workspaceID + '/updates', 1)
send(qlabIP, 53000, '/workspace/' + workspaceID + '/updates', 1);
},

// FILTER ALL INCOMING MESSAGES
Expand All @@ -49,13 +49,17 @@ module.exports = {
if (address.startsWith("/reply")) {
var returnedValue = decodeQlabReply(args); // decode the reply to get the value requested
if (address.endsWith("/displayName")) {
receive(qlabIP, 53000, nameAddress, returnedValue) // send the name to the server
receive(qlabIP, 53001, nameAddress, returnedValue) // send the name to the server
} else if (address.endsWith("/number")) {
receive(qlabIP, 53000, numAddress, returnedValue) // send the number to the server
receive(qlabIP, 53001, numAddress, returnedValue) // send the number to the server
}
return
}

if (address.endsWith("/disconnect")) {
receive(qlabIP, 53001, "/NOTIFY", "Qlab is disconnected");
}

return {address, args, host, port}

},
Expand Down
13 changes: 10 additions & 3 deletions open-stage-control-module/open-stage-control-config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"qlabIP": "192.168.68.150",
"workspaceID":"0C064194-574C-4CB0-BE2E-E36243B8F273",
"cueListID": "90375EE0-C014-43CE-913E-D51E563D0D54",
"QlabMain": {
"ip": "127.0.0.1",
"workspaceID":"844C6E1A-2621-4B21-BC5D-9EE6D746FCC1",
"cueListID": "90375EE0-C014-43CE-913E-D51E563D0D54"
},
"QlabBackup": {
"ip": "127.0.0.1",
"workspaceID":"844C6E1A-2621-4B21-BC5D-9EE6D746FCC1",
"cueListID": "90375EE0-C014-43CE-913E-D51E563D0D54"
},
"address": {
"name": "/next/name",
"number": "/next/number"
Expand Down

0 comments on commit 5b47feb

Please sign in to comment.