Created
January 16, 2024 01:00
-
-
Save moebiussurfing/b2a5264b252fa0bcbe03f1a2ccb7ea56 to your computer and use it in GitHub Desktop.
ofParameterGroup callback lambda new api
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
ofParameterGroup parameters; | |
ofEventListener listenerParameters; | |
parameters.add(param1.set("p1", 1.f, 0.f, 10.f)); | |
parameters.add(param2.set("p2", 10.f, 1.f, 50.f)); | |
parameters.add(param3.set("p3", 5, 0, 10)); | |
listenerParameters = parameters.parameterChangedE().newListener([this](ofAbstractParameter& e){ | |
string n = e.getName(); | |
ofLogNotice("ofApp") << "Changed " << n << ": " << e; | |
if(e.isOfType<float>()) { | |
if(n == param1.getName() ){ | |
ofParameter<float>& paramfloat = e.cast<float>(); | |
// if(paramfloat.get()!=paramfloat.getInit()) { | |
//param has changed | |
//... | |
// } | |
} | |
else if(n == param2.getName() ){ | |
//ofParameter<float>& paramfloat = e.cast<float>(); | |
//... | |
} | |
else if(n == param3.getName() ){ | |
//ofParameter<float>& paramfloat = e.cast<float>(); | |
//... | |
} | |
} | |
else if(e.isOfType<int>()) { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment