-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement shared settings menu #397
Draft
chrisib
wants to merge
75
commits into
Allen-Synthesis:main
Choose a base branch
from
chrisib:settings-menu
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…sic rendering, callback support, graphics & labels
…g through an editable menu item would change the active item. Fix the key for the graphics in the menu dict
…he constructor with keyword arguments. This allows us to create references to menu items to use in callback functions
… with/without type hints formatted, isn't it?
…(e.g. visualizations). Implement the new menu system in the sequential switch
…n. Refactor the Euclidean generator to use the new menu system
…ew menu this isn't necessary anymore
…gnore non-significant whitespace/newlines
…ion being too long to fit
…menus as the config editor. Add a note about 1 decimal place for voltage settings, to account for the editor's float_precision limit
…sensitive items. Show a ! in the corner of the configuration editor for such items
…applies them to integers too
…ot previously committed)
…y in the wave generation
…ding/saving channel settings. Unlike before, don't keep the banks in memory; just load & apply them on-demand. Banks are saved in parallel files, rather than in the main settings.
… to use these as s&h inputs, not autoselects
…ren't being read correctly
…when an autoselector changes its value
… from the autoselect feature
…tor script as an additional example in the menu
…allow CV and knob contriol over channel 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
draft
Not yet ready to merge
firmware
Software related issue
new script feature
Feature additions or improvements to a contrib script
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new SettingsMenu inspired by the menu system in Pam's Workout. This should give a more consistent look-and-feel to menu-oriented applications.
SettingsMenu
The
SettingsMenu
object contains one or moreMenuItem
objects.MenuItem
is a generic class that can be extended as-needed to e.g. add visualizations.Base
MenuItem
subclasses areSettingMenuItem
, which which acts as a wrapper around aChoiceConfigPoint
, andActionMenuItem
which simply invokes a callback function based on the user's selection.The
SettingsMenu
object manages button handlers for the rising & falling edge of the navigation button (b2
by default, and reads values from the navigation knob (k2
by default) as needed.SettingMenuItem
s can also be configured to automatically read fromain
or the non-navigation menu (k1
by default) at 10Hz and use that to automatically choose from the available choices. EachSettingMenuItem
also supports callbacks when its value changes, allowing for inter-option logic, or firing other events as a result of a setting change.An abstract
MenuItem
class is provided to add custom items to the menu, including visualizations (see SequentialSwitch and EuclideanRhythms for examples of visualizations implemented as menu items).Configuration Editor
A frequently-requested feature on Discord has been a way to edit EuroPi_Config on the module itself, rather than manually editing the JSON file. This is implemented by the new
tools/config_edit
module. TheConfigurationEditor
class implements a simpleSettingsMenu
to categorize the configuration points.Items that have the potential to cause harm/usability issues if edited (e.g. changing the display SDA, SCL, Channel, or Frequency values) are marked with a new
danger
flag, which displays a!
warning symbol onSettingMenuItem
instances that wrap them.Modified Contrib Scripts
The following scripts have been modified to use the new
SettingsMenu
instead of implementing their own menu system: