Improve MIDI device listing & selection #7863
Draft
+167
−39
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 PR aims to bring midi device listing to be on par with other apps. I mainly compared it to musescore.
Dummy devices like "System:Announce" are gone, and the names of MIDI devices are friendlier now. Note that the longer names are still used by the system and stored in config, but the "friendly names" are only displayed to the user.
Another thing this PR does (since 359b58c) is improve the persistence of MIDI devices with midiautoassign. Essentially, the client ID of a device can change on restart, which makes LMMS recognise it as a seperate device- this PR fixes that.
Previously, the code checked if the
client id
,port id
,client name
andport name
all match. Now, if all 4 don't match, it checks if theport id
,client name
andport name
match. While there is technically the ability for the wrong device to be selected because of this, it's better than no device being selected, and the user having to reselect it. if (in some edge case) the wrong device is selected because of this, but the correct device is reconnected, it should automatically go back to the correct device. This is very wordy to explain, but it really is a simple change.Edit: it appears my changes in 359b58c are linux only, and the code won't compile on anything else. so im drafting this for now.
Before:



input:
output:
auto assign midi:
After:



input:
output:
auto assign midi:
Musescore for comparison:
