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.57k stars 499 forks source link

Next / Previous dropdown selection via action #2848

Open phillipivan opened 5 months ago

phillipivan commented 5 months ago

Is this a feature relevant to companion itself, and not a module?

Is there an existing issue for this?

Describe the feature

I would like internal actions to select the next or previous item from a dropdown in an action or feedback. This would be especially useful with the rotary actions. For this to be most useable, the label field of the dropdown would need to be exposed as a variable so it can be displayed so the operator can see currently selected item.

I am not sure how this might work with multidrop option fields.

Sometimes this kind of action can be achieved with variables, especially if the input is a sequential number element, however for non sequential lists or strings any user side solution gets much more complicated. Even more so if the elements of the dropdown are determined at run time (and may even change during operation).

This can be implemented inside a module but requires some specific work for every element it is to apply to which adds a lot of boiler plate code.

Usecases

Selecting a source from a list for router control. Changing mode of a device, selecting a preset to recall etc. Allowing much more space efficient programming that a 'button per option' approach, and allows for the option list to change during runtime without needing a button reconfiguration / addition.

dnmeid commented 5 months ago

This relates to #2345. With the changes there you could switch a dropdown to an expression and then e.g. use its values by an index. That means you just have to count up/down a number and get the corresponding option value. Would the changes of 2345 fullfill your needs? Then please close this issue, otherwise please clarify what else could be of interest.

phillipivan commented 5 months ago

I believe #2345 would get some but not all of the way there.

The critical element that I believe is missing, is a practical way to return the label element of a drop down for displaying on the button, so the user knows which element is selected.