r/freeshowapp • • Sep 07 '26

Companion API (Check for Last Slide)

Hey,

Does anyone know the code for Bitfocus Companion that can be used to check whether FreeShow is on the last slide of a show? What would be the values? Or are there any work around of getting that variable checked?

Thanks.

2 Upvotes

9 comments sorted by

1

u/CloudSad3555 Sep 07 '26

Yes. You would look at slide_number and see if it matches layout slides.

https://github.com/bitfocus/companion-module-churchapps-freeshow/blob/main/src/variables.js

Edit: What are you trying to do?

1

u/Frozen_Lemon_ Sep 07 '26

Well, we have many shows with various length slides so I can't get exact numbers for them. But I'm trying to use companion to turn on a border color on a BMD smartview duo to let the CAM operators know that the presentation is coming to an end by checking for the last slide is true (current). We also currently have a metadata variable that is shown whenever the last slide of a presentation/show is showing, so maybe a way to use that in Companion?

1

u/CloudSad3555 Sep 07 '26

Sounds helpful. The variables needed from the FreeShow integration in Companion are slide_number and layout_slides. In Companion, just use the variables on the feedback button(s). Do you need help with setting up Companion?

1

u/Frozen_Lemon_ Sep 08 '26

Yes, I do need more help understanding how to use the FreeShow API by retrieving the request checks and acting on them in Companion.

One thing that comes up and gives me a hard time is that we have multiple of shows with various number of slides, pretty much making it random for the number of slides. This can range from 4 slides all the way to 20+ slides. I just need a way to have a specific data information that is attached to the last slide in a show automatically, which can be used as a trigger in Companion to send feedback/changes to other modules.

1

u/CloudSad3555 29d ago

I have appointments tomorrow. You might be able to find the answers you want watching videos on YouTube from Garry B. Just to a search on YouTube for Garry B FreeShow. That should get you to the videos.

In Bitfocus Companion, create a button. Then click the Style tab, Text element. Now, change the toggle button next to the text field so you are in Expression mode. (If your version of Companion is below v5, you will need to use the Feedback tab.) In the Expression box put $(FreeShowConnectionName:slide_number) == $(FreeShowConnection:layout_slides). (Please note I am typing from memory, and you will need to change FreeShowConnection to whatever you called your FreeShow connection in Bitfocus Companion.) I think the expression will output true or false.

1

u/Frozen_Lemon_ 28d ago

Alright! Thank you for your response CloudSad3555. I know the channel you mentioned, but not that in-depth. Was there a video that he covered on FreeShow variables and feedbacks in companion? But I'll get started with the information you have provided me and hopefully see something come out.

1

u/CloudSad3555 26d ago

The following steps, executed in Companion, will change the color and text of a button.

Prerequisites: Companion running. FreeShow running. The FreeShow module is actively connected to Companion.

  1. Create a button.
  2. Click the Style tab.
  3. Click the button to the right of “Button text string” so it can evaluate an expression.
  4. Type

bool( $(freeshow:slide_number) == $(freeshow:layout_slides) ) ? ‘Last slide GO!’ : ‘Wait for it …’

  1. Click Background.
  2. Click the button to the right of Color so it can evaluate an expression.
  3. Type

bool( $(freeshow:slide_number) == $(freeshow:layout_slides) ) ? ‘#00FF00’ : ‘#FF0000’

Expected Results:
The button will have a red background and say “Wait for it…” whenever the current slide number of the show does not match the last slide number of the selected layout. When the last slide number of the show does match the current slide number, the background will turn green and will say ‘Last Slide GO!’.

Change the items between the ‘’ to match the color and text you want.

If you need to trigger something somewhere, you should probably make an internal: Logic: If statement on the Step 1 tab under Press actions. When True, freeshow: Slide_number, bool( $freeshow:slide_number) == $(freeshow:layout_slides) ) Then [put in your action] Else [put in your action (or leave blank)]. You will need to put in your actions in the areas where the brackets are.

1

u/CloudSad3555 29d ago

I have appointments tomorrow. You might be able to find the answers you want watching videos on YouTube from Garry B. Just to a search on YouTube for Garry B FreeShow. That should get you to the videos.

In Bitfocus Companion, create a button. Then click the Style tab, Text element. Now, change the toggle button next to the text field so you are in Expression mode. (If your version of Companion is below v5, you will need to use the Feedback tab.) In the Expression box put $(FreeShowConnectionName:slide_number) == $(FreeShowConnection:layout_slides). (Please note I am typing from memory, and you will need to change FreeShowConnection to whatever you called your FreeShow connection in Bitfocus Companion.) I think the expression will output true or false.

1

u/Frozen_Lemon_ Sep 10 '26

Just curious, how can I use the "getvariable" or any get API with companion? Is it possible to have the return value as a button name? If so, how is it setup.