Quantcast
Viewing all articles
Browse latest Browse all 40524

How to get the ofParameter from the ofEvent of parameterChangedE()

How can I get the related ofParameter from the ofAbstractParameter created by the ofParameterGroup.parameterChangedE() when i add a eventListener in the event method?
Yeai straight question so let's break it up.
ofAddListener(ParametersClass.parameterChangedE(),this,&ofApp::guiEvent);
and then
ofApp::guiEvent(ofAbstractParameter &e){}
in the guiEvent there will be the call to my oscSender class and i have about 15 different ofParameterGroups in this call and i don't want to write for every group the same method again.

So my solution is to use ofAbstractParameter.toString() and then convert it back to int/bool/float.
But this gets difficult with ofVec2f and ofColor.
I could also Group all ofParameters that i use to one Group and do a search in there with the .getBool(name) but i think this is cpu-intense and unnecessary.
Is there another way to implement this or can we add a function to ofParameterGroup which sends the ofParameter?


Viewing all articles
Browse latest Browse all 40524

Trending Articles