Description
Project Suggestion
I've noticed a bunch of places where scripts want to make a particular option configurable, but the limited user interface elements of the EuroPi make it difficult. These options are usually 'set and forget' type options, or are similarly not edited during normal script use. These options end up getting hidden behind long button presses, or are relegated to a well documented code change.
I suggest a script called 'Configuration' (or similar) whose purpose is to surface these options, but keep them from cluttering their script's UI. The script would present a hierarchical menu of config options for each script that has them, and provide a simple and consistent way for setting these options.
UI
The initial interface would be a menu of scripts, similar to the menu script. The left knob would select a menu item. The right button would select it, the left button would be 'back'. After choosing a script the user would be presented with a menu of the config options for that script. Again the buttons would be 'back' and 'select'. Upon selecting an option the user would see a screen for adjusting the value with the right knob. The buttons would be 'back' and 'save'.
API
Scripts declare that they have config points in the same way as declaring menu participation, imports in the settings app. And in the same way as the Menu, scripts would need to implement EuroPiScript
to participate.
Scripts would indicate that they have config options, by overriding a method. The method will return a data structure describing the settings. This structure will be well defined and will contain things like: name, type, type details (range), and default value.
Scripts would then have a member variable that would be a dictionary of name -> value that would automatically be loaded at script boot but the underlying EuroPiScript
class.
Settings would be saved in a json file per script in a settings directory.
Types
Example types: choice, bool, int, float, voltage, const
Examples
- PolySquare - set the mode for the ain: v/oct, detune, chord
- consequencer - that one param that was added late
- some parameters that are configurable in code now
- TM: write 0 or 1
- pico version (for eventual wifi support)
- europi lib Voltage range
- display modes
- probapoly ain.mode