Skip to content
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

Added IntParam::range() and FloatParam::range() #89

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

rbmj
Copy link
Contributor

@rbmj rbmj commented Oct 26, 2023

This allows calling code e.g. pass a bunch of IntParams to a function that creates widgets - removing the need to create custom widgets for each GUI library and instead use some glue code to generate widgets since now they can determine the correct bounds for a knob/slider from the &IntParam

I'm open to modifying it to return &Range instead of Range... over to you on that API decision

@robbert-vdh
Copy link
Owner

This allows calling code e.g. pass a bunch of IntParams to a function that creates widgets - removing the need to create custom widgets for each GUI library and instead use some glue code to generate widgets since now they can determine the correct bounds for a knob/slider from the &IntParam

That's part of the reason why most widgets (also in other plugin frameworks) work with normalized parameter values. The unnormalized values typically aren't very useful.

That being said, there's no harm in exposing these ranges on the parameter objects, so may as well.

@robbert-vdh robbert-vdh enabled auto-merge (rebase) November 5, 2023 20:44
@robbert-vdh robbert-vdh merged commit bf01371 into robbert-vdh:master Nov 5, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants