Skip to content

Commit

Permalink
Some fixes and a new preset icon
Browse files Browse the repository at this point in the history
greyshirtguy committed Jan 13, 2025
1 parent e461a00 commit 5a83e15
Showing 7 changed files with 74 additions and 4 deletions.
1 change: 1 addition & 0 deletions companion/HELP.md
Original file line number Diff line number Diff line change
@@ -125,6 +125,7 @@ Can be used on button labels - can be used in many action inputs.
Some variables are dynamically created so that there are variables for each thing - eg timers, stage display layouts.
When looking at the Variable ID's you will notice that the uuid is sometimes included - which makes for a bit of a confusing/long ID, but this long ID is globally unique and allows these variables to always work even if the names have duplicates.
Note that, the Variable description has a nice friendly name.
Note also that the variable "Active Presentation Index" seems to mostly return invalid indexes but I am keeping it available for the future, in case it becomes useful in a future version of ProPresenter For now, you probably want to use "Active Presentation PlaylistItem Index" instead.
One special variable is Time Since Last Status Update - for debugging purposes. (You can even Trigger the module to automatically restart when the "Time Since Last Status Update" gets over some appropiate limit - Although hopefully you never need to!)

### Feedbacks:
2 changes: 1 addition & 1 deletion companion/manifest.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"name": "Propresenter-API",
"shortname": "Propresenter-API",
"description": "ProPresenter API Module (Pro Versions 7.9 and higher)",
"version": "1.0.3",
"version": "1.0.4",
"license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-renewedvision-propresenter-rest.git",
"bugs": "https://github.com/bitfocus/companion-module-renewedvision-propresenter-rest/issues",
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renewedvision-propresenter-api",
"version": "1.0.3",
"version": "1.0.4",
"main": "dist/main.js",
"scripts": {
"prepare": "husky install",
3 changes: 3 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
@@ -505,6 +505,9 @@ export function GetActions(instance: InstanceBaseExt<DeviceConfig>): CompanionAc
callback: async (actionEvent) => {
const playlist_id: string = await instance.parseVariablesInString(actionEvent.options.playlist_id as string)
switch (actionEvent.options.specific_playlist_operation) {
case 'focus':
instance.ProPresenter.playlistByPlaylistIdFocus(playlist_id)
break
case 'trigger_next':
instance.ProPresenter.playlistByPlaylistIdNextTrigger(playlist_id)
break
15 changes: 14 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -175,6 +175,7 @@ class ModuleInstance extends InstanceBase<DeviceConfig> {
"announcement/slide_index":this.announcementSlideIndexUpdated,
"playlist/active":this.activePlaylistUpdated,
"presentation/focused":this.focusedPresentationUpdated,
"presentation/active":this.activePresentationUpdated, // The doco for /v1/status/updates mentions presentation/current as a permitted streaming endpoint - but it's a hyperlink that actually links to presentation/active (I tested and either works - but I'm using the one that is linked to).
"look/current":this.activeLookUpdated,
"looks":this.looksUpdated,
"macros":this.macrosUpdated,
@@ -369,7 +370,7 @@ class ModuleInstance extends InstanceBase<DeviceConfig> {
this.initFeedbacks()
this.checkFeedbacks()

// Watchdog function - makes checks and updates every second.
// Watchdog function - checks each second to record total time since last status update in a variable. (Users can monitor this variable to know if the module is still connected to ProPresenter)
setInterval(() => {
SetVariableValues(this, {time_since_last_status_update: (Date.now()-this.timeOfLastStatusUpdate)/1000})
},1000)
@@ -519,11 +520,14 @@ class ModuleInstance extends InstanceBase<DeviceConfig> {
if (statusJSONObject.data.presentation_index) { // ProPresenter can return a null presentation_index when no presentation is active
SetVariableValues(this, {
active_presentation_slide_index: statusJSONObject.data.presentation_index.index,
// This status update includes the name and uuid of the presentation - so we can update these variables too
active_presentation_name: statusJSONObject.data.presentation_index.presentation_id.name,
active_presentation_uuid: statusJSONObject.data.presentation_index.presentation_id.uuid,
active_presentation_index: statusJSONObject.data.presentation_index.presentation_id.index, // Note that this seems to return invalid indexes. Keeping it here for the future, in case it becomes useful in a future version of ProPresenter
})
} else {
SetVariableValues(this, {
// For the times when no presentation is active:
active_presentation_slide_index: '',
active_presentation_name: '',
active_presentation_uuid: ''
@@ -540,6 +544,15 @@ class ModuleInstance extends InstanceBase<DeviceConfig> {
})
}

activePresentationUpdated = (statusJSONObject: StatusUpdateJSON) => {
this.log('debug', 'activePresentationUpdated: ' + JSON.stringify(statusJSONObject))
SetVariableValues(this, {
active_presentation_index: statusJSONObject.data.presentation.id.index, // Note that this seems to return invalid indexes. Keeping it here for the future, in case it becomes useful in a future version of ProPresenter
active_presentation_name: statusJSONObject.data.presentation.id.name,
active_presentation_uuid: statusJSONObject.data.presentation.id.uuid,
})
}

activePlaylistUpdated = async (statusJSONObject: StatusUpdateJSON) => {
this.log('debug', 'activePlaylistUpdated: ' + JSON.stringify(statusJSONObject))
if (statusJSONObject.data.presentation.playlist) {
51 changes: 50 additions & 1 deletion src/presets.ts
Original file line number Diff line number Diff line change
@@ -53,7 +53,56 @@ export function GetPresets(instance: InstanceBaseExt<DeviceConfig>): CompanionPr
size: 14,
bgcolor: combineRgb(120, 0, 0),
color: combineRgb(255, 192, 192),
// TODO: Add a png64 with the ProPresenter capture image
png64: 'iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw1AUhU9TpSoVBTuIOGSo\
ThakijhqFYpQIdQKrTqYvPRHaNKQpLg4Cq4FB38Wqw4uzro6uAqC4A+Iu+Ck6CIl3pcUWsR44fE+zrvn8N59gFAvM83qGAc03TbT\
yYSYza2IoVcEEEI3+hGXmWXMSlIKvvV1T91UdzGe5d/3Z/WqeYsBAZF4hhmmTbxOPLVpG5z3iSOsJKvE58RjJl2Q+JHrisdvnIsu\
CzwzYmbSc8QRYrHYxkobs5KpEU8SR1VNp3wh67HKeYuzVq6y5j35C8N5fXmJ67SGkcQCFiFBhIIqNlCGjRjtOikW0nSe8PEPuX6J\
XAq5NsDIMY8KNMiuH/wPfs/WKkzEvaRwAuh8cZyPESC0CzRqjvN97DiNEyD4DFzpLX+lDkx/kl5radEjoG8buLhuacoecLkDDD4Z\
sim7UpCWUCgA72f0TTlg4BboWfXm1jzH6QOQoVmlboCDQ2C0SNlrPu/uap/bvz3N+f0ARb9ylSPOsy0AAAAGYktHRAB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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAA////oP///+v///8iAAAAAAAAAAAAAAAAAAAAAAD///+/////xv///wcAAAAAAAAAAP///wYAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8GAAAAAAAAAAD///8H////yP///7wAAAAAAAAAAAAAAAAA////Sv////3/\
//8xAAAAAAAAAAD///9E////1f///w0AAAAAAAAAAAAAAAAAAAAA////BP///wQAAAAAAAAAAAAAAAAAAAAA////Df///9X///9E\
AAAAAAAAAAD///8z/////v///0gAAAAAAAAAAAD///+9////qAAAAAAAAAAA////Dv///+r///+aAAAAAAAAAAD///8B////X///\
/83////9/////f///83///9dAAAAAAAAAAAAAAAA////mv///+n///8OAAAAAAAAAAD///+p////vAAAAAAA////Ev////v///9N\
AAAAAAAAAAD///9/////6P///wwAAAAA////Af///5v///////////////////////////////////+YAAAAAAAAAAD///8M////\
6P///34AAAAAAAAAAP///07////6////EQD///9W////9v///wkAAAAAAAAAAP///9r///+BAAAAAAAAAAD///9f////////////\
//////////////////////////////////9cAAAAAAAAAAD///+B////2AAAAAAAAAAA////Cf////b///9UAgAAACAAAADhAQEB\
9wAAAAD///8bAAAAJQAAALcAAAAAAAAAAAAAAG8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAA\
ALgAAAAn////GQAAAAABAQH3AAAA4QAAACACAAAAGgAAAOUAAAAAAAAAAAAAABsAAAAAAAAA3gAAAAD///8FAAAALwAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMP///wQAAAAAAAAA3gAAAAAAAAAcAAAAAAAAAAAAAADmAAAAGgIAAAD/AAAAAQAA\
AAAAAAAAAAAA/wAAAAAAAAACAAAAAAAAAP8AAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAA\
AAABAAAAAAAAAP8AAAAAAAAAAAAAAAEAAAD/AgAAAOYAAAAaAAAAAAAAAAAAAADlAAAAAAAAACAAAAAAAQEB/AAAANIAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM8BAQH9AAAAAAAAACEAAAAAAAAA5QAAAAAAAAAAAAAAGQAAAOcCAAAA4QAAAB//\
//8JAAAAAAEBAeYAAADaAAAASgAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAA\
AAAASQAAANkBAQHnAAAAAP///woAAAAgAAAA4AD///8S////+////04AAAAAAAAAAP///37////o////DAAAAAAAAAAA////mv//\
/////////////////////////////////5gAAAAAAAAAAP///w3////p////fQAAAAAAAAAA////Tv////r///8RAAAAAAD///+9\
////qQAAAAAAAAAA////Dv///+n///+bAAAAAAAAAAAAAAAA////Xf///83////9/////f///8z///9bAAAAAAAAAAAAAAAA////\
m////+j///8NAAAAAAAAAAD///+p////uwAAAAAAAAAAAP///0n////9////MgAAAAAAAAAA////Q////9X///8NAAAAAAAAAAAA\
AAAAAAAAAP///wT///8EAAAAAAAAAAAAAAAAAAAAAP///w3////V////QwAAAAAAAAAA////NP////7///9HAAAAAAAAAAAAAAAA\
AP///77////H////BwAAAAAAAAAA////BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//\
/wYAAAAAAAAAAP///wf////J////uwAAAAAAAAAAAAAAAAAAAAAA////Iv///+v///+eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////n////+v///8hAAAAAAAAAAACAAAAAAAA\
AAABAQHeAAAAVQAAAMsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAADLAAAAVAEBAd8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwwFg9\
yO8EogAAAABJRU5ErkJggg==',
},
steps: [
{
4 changes: 4 additions & 0 deletions src/variables.ts
Original file line number Diff line number Diff line change
@@ -43,6 +43,10 @@ export function GetVariableDefinitions(propresenterStateStore: ProPresenterState
name: 'Active Presentation UUID',
variableId: 'active_presentation_uuid',
})
variables.push({
name: 'Active Presentation Index',
variableId: 'active_presentation_index', /// Note that this seems to be mostly invalid indexes. Keeping it here for the future, in case it becomes useful in a future version of ProPresenter
})
variables.push({
name: 'Active Announcement Slide Index',
variableId: 'active_announcement_slide_index',

0 comments on commit 5a83e15

Please sign in to comment.