Fix allows slots with default values to be set to None#2
Open
xotmatrix wants to merge 1 commit intoanomixer:masterfrom
Open
Fix allows slots with default values to be set to None#2xotmatrix wants to merge 1 commit intoanomixer:masterfrom
xotmatrix wants to merge 1 commit intoanomixer:masterfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This patch addresses a problem with setting certain slots to be empty.
Background:
Attempting to select "—None—" for a slot with a default device will immediately select the default device. I do not have a Mac to compare to, but according to my discussion with Kelvin Sherlock, the correct behavior is to explicitly set the slot to empty in the command line. For example, slot 6 defaults to
diskiingwhen no command line argument is given. To disable it, the empty string-sl6 ''is required. Ample does this, but AmpleWin does not.Cause:
This problem is caused by
initialize_default_slots()being called each time the UI selections change. That function will automatically set a slot to its default value because an empty slot is indistinguishable from an unset slot.Fix:
According to Kelvin, Ample does not initialize the system when the UI is changed. It simply updates the command line. The first part of this patch removes the reinitialization when the UI is refreshed. The second part sets the slot to a quoted, empty string whenever it has a default=False value in its XML, which I believe means the slot must be explicitly disabled in the command line.
Linux:
It looks like the same fix could be applied to the Linux port. I cannot build for Linux, so I left this alone. I think these are the equivalent lines.
ample/AmpleLinux/main.py
Line 1290 in d6ef2a9
ample/AmpleLinux/main.py
Line 1414 in d6ef2a9