-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fixes bug where clicking on the Activity Indicator doesn't play a note #5824
Merged
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
This attempts to fix a bug uncovered by LMMS#5581, where the wrong MidiEvent constructor is selected due to ambiguity in the arguments that are used in the call. Part of the solution is to use a enum class on the last parameter instead of a boolean to avoid implicit conversions and a more strict method selection through the ADL. One of the parameters type on a constructor was also changed from int to std::size_t which more accurately represents it. "ignoreOnExport" was replaced with "source", which for now can be Source::Internal or Source::External, and its value is still used on the processInEvent to define whether a MidiEvent should be ignored during the song export.
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://11312-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.40%2Bga52ab90-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/11312?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://11310-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.40%2Bga52ab9070-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/11310?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://11313-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.40%2Bga52ab9070-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/11313?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/s9rglpioyd865nyw/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36672883"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/jvyxvxu1rfo761tx/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/36672883"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://11314-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.40%2Bga52ab9070-mac10.14.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/11314?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "cd90121c798fe3be3f9475d56c4b7a2d81d682bb"} |
DomClark
approved these changes
Dec 5, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and fixes the bug. There are a couple more things that could be done, but I'm not sure if it's worth doing them here:
m_data.m_sysExDataLen
should be changed to astd::size_t
, to matchdataLen
which is stored in it. However, it seems to be unused, so it doesn't matter too much right now.- Should all
MidiEvent
s be constructed with the correct source? Currently everything is marked as external, except controller changes. Again, this is fine for now, since most messages go toprocessOutEvent
where the source doesn't matter, but it might be worth correcting at some point. (I would probably make the default sourceInternal
, and specifyExternal
in the MIDI backends, to keep the core code cleaner.)
IanCaio
added a commit
to IanCaio/lmms
that referenced
this pull request
Mar 28, 2021
devnexen
pushed a commit
to devnexen/lmms
that referenced
this pull request
Apr 10, 2021
sdasda7777
pushed a commit
to sdasda7777/lmms
that referenced
this pull request
Jun 28, 2022
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.
After merging of #5581 a bug was unveiled, where an ambiguity on the arguments types of calls to the
MidiEvent
constructor would result in ADL picking the wrong option.Discussing with others in Discord about approaches to fix the issue, @DomClark suggested using an
enum class
instead of a boolean on the last argument, replacing it fromignoreOnExport
tosource
(representing the source of a MidiEvent). One of the arguments type from the second constructor was also changed fromint
tostd::size_t
to better represent it.Those changes alone fixes the Activity Indicator. It's possible though that adding
static_casts
to the constructor calls could still be needed. For now I'm submitting the changes for further review and discussion.