Calling procedures #3149
Labels
area/internal
Related to an internal action or function of Companion.
Enhancement
New feature or request
Needs beer!
This needs discussion while drinking beer
Is this a feature relevant to companion itself, and not a module?
Is there an existing issue for this?
Describe the feature
Currently the only way to reuse sets of actions is to call one button from another button. As this approach works pretty well, it has some major drawbacks: it can be easily broken (by rearranging pages or buttons that rely on each other), it is hard to trace and doesn't allow parametrized inputs.
Introducing procedures that are just set of actions that will be triggered one by one just like on buttons would fix those issues. Each procedure should accept a configurable amount of parameters that would be passed from button, trigger or another procedure and those parameters would be present as variables in the procedure itself.
It is worth noting that implementation should account for 2 instances of the same procedure being called at once and make sure parameters are locally scope and each call sees their own values.
This issue can possibly benefit people waiting for #3138, #3085, #2370, #2138 (by exposing procedures over HTTP API), #1924, #1676 and can be a step towards #2387. Also loosely relates to #1909 as the concept of passing parameters seems similar. It may also help with #1849.
Usecases
Example: with ATEM switchers user may want to set a specific output as a flying key on a specific position on the screen and then trigger a specific transition, maybe changing also the background. Now, if there are multiple inputs that need this treatment, the only way is to separate the same actions onto yet another button (possibly hidden on an unused page) and trigger this button from other buttons and have only the actions that differ on each directly pressed button.
Procedures will allow to streamline this process as well as parametrize the input, so now only action on buttons would be triggering a specific procedure with a different parameter. Changing the position of the flying key would also be easier as it can be another parameter on the same procedure.
The text was updated successfully, but these errors were encountered: