-
-
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
Fix for Mixer volume percentage labels are off by a factor of 100 #5654
Conversation
…MS#2340) Patch the default context menu and take into account variable m_displayConversion to multiply/divide by 100. Reset action: update the text with initValue multiplied by 100 if required. Copy action: update the text with value multiplied by 100 if required. Replace the default copy slot by one which also multiplies by 100 if required. Paste action: Replace the default paste slot which divides by 100 if required. Faders in FxMixer show now the correct context. Copying and pasting values between faders or even volume knobs in tracks shows consistent behavior. Other faders (like in Eq) show the old behavior.
🤖 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://8454-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.691-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8454?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://8455-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.691-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8455?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8453-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.691-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8453?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/w1xl5e7tjpxe4y0r/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34828615"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/1x9lqgcneyii9tdp/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34828615"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://8451-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.691-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8451?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "3910b235292583ff10dd6c9cbac21119ea9f29f6"} |
IMHO this PR fixes a problem but uses the wrong approach. I'll point some of the things on the approach that concern me and give an alternative in the end:
So my alternative solution that would address those issues is actually changing the |
Thanks for your remarks. To be honest, I've considered them all before creating the pull request. I explored several paths and came out on this one as the least impact on the codebase. The real problem is that parameters like the volume or panning in the track are expressed as %, but their underlying model uses 0 - 200 for volume and -100 to 100 for pan. The faders in the Fx mixer though use 0.0 to 2.0, but require *100 when they need to be displayed as %. Today the As the Keeping it local required the magical numbers. I agree it is not clean, but not too bad either IMHO. I've seen worse in other projects. As long as the menu stays static it is fine. Restructuring the menu requires once an update of the indices. I could not easily figure out how to get back the actions to be patched. Well actually I can, but that requires storing pointers in the Your suggestion is ok if all other parameters like Volume and Pan in a track also would store their value in the 0.0 to 1.0 range. What would you suggest to get around this? Would it be a good solution to move the Looking forward to your opinion. |
You're completely right, I didn't know the problem was this deep and other model-views that are displayed as percentages used the whole percentage numbers in their models instead of floats. I didn't mean your solution was bad, but if the I still think that's a mess we will have to deal with at some point: defining whether we will store percentages as whole percentages or their equivalent floats and changing every required model to do it. Since the FxMixer is the only one that uses floats maybe it'll be easier to change it to use percentages instead of changing everything else to use floats, though personally I think floats were more appropriate. I'll dig more into the code trying to come up with ideas or at least figure out how complicated it would be to change the models. If others agree about your approach as a quick fix I'm cool with it, but would still suggest that we add the deeper fixes to the models to our milestone and document the changes from this PR so we can reverse it when the models are fixed. |
I created a new PR #5661 with an alternative implementation. I close this one as it was not that well. |
(#2340)
Patch the default context menu and take into account variable m_displayConversion to multiply/divide by 100.
Reset action: update the text with initValue multiplied by 100 if required.
Copy action: update the text with value multiplied by 100 if required. Replace the default copy slot by one
which also multiplies by 100 if required.
Paste action: Replace the default paste slot which divides by 100 if required.
Faders in FxMixer show now the correct context. Copying and pasting values between faders or even volume knobs
in tracks shows consistent behavior. Other faders (like in Eq) show the old behavior.