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.55k stars 502 forks source link

Button to show a file-dialog box to specify location of files to load or store #1332

Open BaseballJim opened 3 years ago

BaseballJim commented 3 years ago

I’d like to see an additional GUI element for use in the ‘Actions’ section. Specifically I would like to have a button in place of the text field that would show a ‘file-open’ or ‘file-save’ dialog. I have a module that I specify a disk file (on the Companion host computer) that is used to save or restore the routing table in the BMD-VideoHub router. I would like to be able to use a standard (i.e. standard to whatever the host computer supplies) file dialog box to navigate to the file location rather than typing in a long, error prone, text string. key actions

BaseballJim commented 3 years ago

Here is a picture of the UI type. In this example its 'textinput' which creates a text box for the user to type into. My request is for another type (maybe 'fileDialog') that would launch the native browsers file dialog box to select files from. key type

josephdadams commented 3 years ago

This would be problematic when accessing Companion running on a remote device. You can’t exactly open a native file dialog that browses the remote Companion’s drive.

Julusian commented 3 years ago

^ as @josephdadams says it would be tricky, but possible to do as a non-native dialog. I would be a bit concerned about security with a ui control like that, but some bits like the shell command are much worse for that so maybe this isnt that bad.

Another way to do this would be to select a file from your local machine and upload it to companion. It should be possible to detect if running companion on the same machine and optimise (skip the upload step)

BaseballJim commented 3 years ago

@Julusian I think for the broad use-case (at least how I would use it) it wouldn't matter too much if it was the computer running Companion or the computer that the interface is running from that was the location of the file. Either would be useful. The Module I use now has a text string with full drive and path information that references the computer running Companion. I kind of figured that would be the logical place to reference the file-dialog. Using the browser on the interface computer to find a file on that same computer would work fine. As long as there was a way to launch the dialog and a way to transport the data from the file to the Companion server machine. Neither of which I know how to do at this point.

josephdadams commented 3 years ago

Another option, ditch the file on disk method. It seems very use case specific anyway and prone to error due to wrong file name, moved file, etc.

Instead, add “memory slots” to your module. 10 slots, for example. Then you can just have an action that loads or saves to that slot number (as JSON data). You can have an option to give it a name if you want to store that in the module’s config.

BaseballJim commented 3 years ago

Hmmm... Let me think on that for awhile