Skip to content

Conversation

arturoc
Copy link
Member

@arturoc arturoc commented May 9, 2017

Some new features for ofParameter, mostly useful in conjunction with ofxGui:

  • ofParameter allows to set a logarithmic scale (only numeric ones) which then translates in sliders with logarithmic scale. Can be directly use in the header like:
ofParameter<float> volume{"volume", 0, 0, 1000, ofParameterScale::Logarithmic);
  • ofSetMutuallyExclusive(p1,p2,p3,...): allows to pass an arbitrary number of parameters and they will be set as mutually exclusive so when one is set to true the rest are set to false which allows to create option groups in guis really easy just by setting the corresponding parameters as mutually exclusive. It would probably be useful to be able to do the same with an ofParameterGroup or a collection of ofParameter<bool>

  • ofParameterLink(p1,p2,p3...): allows to pass an arbitrary number of parameters that will "track" each other so if any of them changes all the rest are set to the same value

@tgfrerer
Copy link
Member

tgfrerer commented May 9, 2017

Super useful - one remark about naming the naming of [set|get]PctScaled: I assume "Pct" refers to %, which would mean a number between 0..100, i.e. a fraction of 100. How about [get|set]NormalizedScaled?

"Normalized" by convention means 0..1 range, which is the range the getter/setters appear to expect.

Or perhaps just: get|setAsNormalized ?

@arturoc
Copy link
Member Author

arturoc commented May 9, 2017

yeah that makes sense, will change it in a bit...

@arturoc arturoc changed the title ofParameter / ofxSlider: logarithmic scale ofParameter advanced features May 18, 2017
@roymacdonald
Copy link
Contributor

this looks great! Super useful.
I've been dealing with something where parameter link would have been super useful, although I've had problems with parameters in different threads, so, Is this new function thread safe? From what I can read it doesn't seem to be.
best

@artificiel artificiel mentioned this pull request Aug 31, 2023
54 tasks
@dimitre dimitre added this to the 0.12.1 milestone Aug 31, 2023
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.

5 participants