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

Why does get_extended modify val_max and val_default and stuff #4861

Closed
baconpaul opened this issue Aug 18, 2021 · 4 comments · Fixed by #4865
Closed

Why does get_extended modify val_max and val_default and stuff #4861

baconpaul opened this issue Aug 18, 2021 · 4 comments · Fixed by #4865
Labels
Bug Report Item submitted using the Bug Report template
Milestone

Comments

@baconpaul
Copy link
Collaborator

I was about to make this const and realized it isn't
Why on earth isn't it?

@baconpaul baconpaul added the Bug Report Item submitted using the Bug Report template label Aug 18, 2021
@baconpaul
Copy link
Collaborator Author

this in turn means get_display can't be const and so on.

baconpaul added a commit to baconpaul/surge that referenced this issue Aug 18, 2021
baconpaul added a commit that referenced this issue Aug 18, 2021
Addresses #3808
but see the problem in #4861
@mkruselj
Copy link
Collaborator

mkruselj commented Aug 18, 2021

Because some params need to have different default and/or min/max values in extended mode only (i. e. certain params going from unipolar to bipolar etc.).

Any other way to deal with this? I couldn't figure out how to have these params update in such way exactly when toggling Extended on/off, other than this (as you can see through git blame)...

@baconpaul
Copy link
Collaborator Author

yeah the answer is to make a set_extend_range() which is non const and call it consistently and do the change there. On it.

@baconpaul
Copy link
Collaborator Author

(the reason you want things marked const correctly is so this would fail to build when we made the change, btw; its why #3808 is important).

baconpaul added a commit to baconpaul/surge that referenced this issue Aug 18, 2021
get_extended was mutating the state of Parameter; rather than
do that add a set_extend_range and call it consistently. Add
but don't activate a mode where you can force a write to extend
into a compiler error also

Closes surge-synthesizer#4861
Addresses surge-synthesizer#3808
baconpaul added a commit that referenced this issue Aug 18, 2021
get_extended was mutating the state of Parameter; rather than
do that add a set_extend_range and call it consistently. Add
but don't activate a mode where you can force a write to extend
into a compiler error also

Closes #4861
Addresses #3808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants