-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor Elements #154
Merged
Merged
Refactor Elements #154
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
Different ranges for different elements
-added to Elements variant
Use SlideSwitch for hetrickcv CKSSRot
Fix missing brackets in tests. Fix button ranges
simplifies some duplicate code simplifies some braces for Elements Also fix some `this` captures
So that the handle can be centered on the bg which also has an even number of pixels
I fixed the pixel alignment issue with sliders. The cause was that VCV_adaptor just used the xy position specified in the ModuleWidget constructor calls to createParam(). Some widgets change their xy position by adding a margin, but this was not being picked up by MetaModule. I also tested merging all the open PRs together, and it's not going to be a problem to merge. So I'm going ahead with this! |
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 PR refactors the MetaModule::Elements variant, with a few benefits:
Previously, each widget type needed a corresponding variant alternative type in the ever-growing Elements std::variant type.
Now, the Element variant alternatives are reduced to a small set of general types (like Knob, Slider, DualLight). Each one is parameterized by non-static member vars (e.g. image, color). This makes it easier to add new types.
Other changes (besides refactoring Elements):
fix-switches-gui
that make manually controlling switches/buttons "more natural" are present in this branch tooThere's almost no changes needed to 4ms modules (one very subtle difference, I'll document).
Performance-wise, I've noticed no change. I expect it to change very little, since this almost exclusively effects the GUI thread (which is bottlenecked by hardware) and pre-main startup (when Rack modules are converted to MetaModule-native structures). The binary is ~64k smaller, also.
TODO:
std::string_view image
from the derived classes toBaseElement