bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.6k stars 504 forks source link

Synchronize Button Names #1266

Closed Kaniee closed 2 years ago

Kaniee commented 4 years ago

Describe the feature It would be helpful, if I could make sure that several buttons have the same name. So when I change the name of on of them, all the linked buttons apply this change

Usecases We control a PTZ camera and use its presets. For example, preset 1 for speaker, preset 2 for piano, preset 3 for drums, and so on. On page 1 are the buttons we need before the event starts and on page 2 the buttons we need during the event. On both sides we have eight buttons to access the camera presets 1-8. On side 1 there is also a button that goes to page 99, where again there are eight buttons for the presets, but this time a button press means that the camera saves its position as preset number x. So for the speaker, there is a button on page 1 and 2 to recall the preset and a button to set the preset on page 99. Now if I want to change the name of a preset (e.g. guitar instead of drums), I have to change the names of all three buttons one by one.

This is my first time opening an issue, please give any advice, what I should do different.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label Enhancement to this issue, with a confidence of 0.90. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Kaniee commented 4 years ago

Implementation proposal Maybe the use of variables would be helpful. If there would be a interface to set and change a new variable, then the button name could be something like $(costumvariables:preset_1)

Kaniee commented 4 years ago

This is similar to #1189.

dnmeid commented 3 years ago

Implementation proposal Maybe the use of variables would be helpful. If there would be a interface to set and change a new variable, then the button name could be something like $(costumvariables:preset_1)

That's exactly what is going to happen. Let's see who writes the variables module first. If noone else does, it is on my schedule.

fdebeer commented 3 years ago

This is my first time opening an issue, please give any advice, what I should do different.

there is a simple way to save and recall a preset for the ptz with just one button. in this case button 1 mark Relative Delay on key-down put internal:button press and release page 99 bank 1 with a delay 1000 ms (button for save preset) on key-up internal:aboard all delayed actions cam 1 recall preset

this wil save your preset when you press the button for 1 second, but a shorter press it recalls the preset No need to change the name for the preset-button.

Kaniee commented 3 years ago

this will save your preset when you press the button for 1 second, but a shorter press it recalls the preset

I haven't tried that yet but that setup might help in this particular issue. Nevertheless I would still prefer to have two separate buttons for setting and calling to be sure that a preset is not set accidentally.

sydneyjd commented 3 years ago

I will give this request a one-up. Had a co-worker wonder about doing this, in a very similar setup to the above mentioned setup(three PTZs, one main "hybrid" page with combined save/recall preset buttons, and an ATEM switcher setup, as well as individual pages for in depth controlling of each camera). Just looking to synchronize the name of button eg, 3.13 based on button 6.22. Or even have the button act as a shortcut, although I see there is another request for that.

istnv commented 3 years ago

@sydneyjd Beta builds should have internal variables that return the text of another button: $(internal:b_text_6_22) in the text of button 3.13 would mirror the text on 6.22. There is also a feedback option to use the colors of another button.

sydneyjd commented 3 years ago

@istnv Ah, thank you, that is perfect! I was going off of what was being shown under the variables tab, but it does not show that internal variable. Is that something that just has to be updated for the variables tab, or is there documentation somewhere else?

istnv commented 3 years ago

@sydneyjd The variables are dynamic based on active buttons. Since they are not pre-defined, they do not appear in the dropdown. The normal help is not available for the internal module so I haven't figured out where to document these.

sydneyjd commented 3 years ago

@istnv Thank you for the info. Very much appreciate it.

llamafilm commented 2 years ago

@sydneyjd Beta builds should have internal variables that return the text of another button: $(internal:b_text_6_22) in the text of button 3.13 would mirror the text on 6.22. There is also a feedback option to use the colors of another button.

Is there a way to use a variable inside a variable, e.g. $(internal:b_text_6_$(internal:custom_last_button)) ? I'm trying to make a button's text show the text of the last-pressed button which brought the user to this page.

Also, where is this documented? This doesn't appear in the dropdown when you start typing a variable name, but your example does work. I tried searching the code for b_text and found nothing.

istnv commented 2 years ago

Is there a way to use a variable inside a variable, e.g. $(internal:b_text_6_$(internal:custom_last_button)) ? I'm trying to make a button's text show the text of the last-pressed button which brought the user to this page.

Not that I am aware of. The evaluation logic only looks for the _p_b pattern and extracts the text from the other button. It does check to ensure it is not looking at itself. (Companion locked up until the call stack broke :)

Also, where is this documented? This doesn't appear in the dropdown when you start typing a variable name, but your example does work. I tried searching the code for b_text and found nothing.

It is in one of the core (internal) modules and I never found the place to document it. The drop down lists the pre-defined variables that modules submit to the core/UI list. These 'button text' variables are completely dynamic and generated as needed, otherwise there would be another 3100+ internal variables that rarely get used.

llamafilm commented 2 years ago

Rats, okay then... Is there a way for a button to read its own text as a variable then? Then I could add an action to store that as a new variable which could be accessed elsewhere.

istnv commented 2 years ago

Reading itself is a recursive introspection which is why it is prevented. Have you looked at the Internal: Set surface () to page BACK option? That returns to the page you came from.

llamafilm commented 2 years ago

Sure, that action works fine, but that's not what I'm asking for here. I'm trying to update the text on a button to match the text of the last button pressed. For more context, I'm making a traditional video router control, with all the destinations on one page and all the sources on a different page. So when you press a destination button, it jumps to the source page. I want one button on that page to identify which destination was just selected in case you forget.

istnv commented 2 years ago

For that, it may be easier use the Internal: Set Button Text to change the text of the 'return' button on the destination select button before changing pages.

llamafilm commented 2 years ago

Nice idea, thanks! That does indeed work, but it requires entering the same text in 2 places: the button text and the "set button text" action. This will be fine once it's all setup, I was just hoping to have a more automatic way.

istnv commented 2 years ago

If you have dynamic content, such as the Destination Name (REC A) on the button, you can also push the $(internal:b_text_#_#) into the return button text.

llamafilm commented 2 years ago

Do you mean typing that literally with hash signs like this? That doesn't work for me, it labels the button "$NA".

Screen Shot 2021-12-22 at 18 27 18
istnv commented 2 years ago

Replace the # with the page and button # of the Destination button. You still have to specify which button text to copy.

Julusian commented 2 years ago

Following up on this, as @istnv says, there are variables for button names that can be used for this (eg $(internal:b_text_6_22)) Or alternatively, you can use the 'internal: Use another buttons style' to get the full style of the button. As such, you can effectively have the same button on multiple pages by doing the following: image