openframeworks/openFrameworks — pull request #1397 by arturoc (2012-07-12 14:41:07+00:00)
Title: Feature ofParameter

not ready to merge yet, just sent the PR to get early feedback

includes:

ofParameter moved to core + some additions to help with (de)serialization + ofParameterGroup
ofParameterGroup based on ofxAbstractParameter, tried with Poco::Any but had some problems
ofBaseSerialiazer
ofBaseFileSerializer
ofxXmlSettings modified to support ofSerializer
ofxJSON modified to support ofSerializer (included as a proof of concept but perhaps good to have as official addon)
ofxGui support for custom serializers

known problems:

- both ofxPanel and ofxParameterGroup store elements as pointers so it can be problematic when making copies or if you pass an element created in the stack, like:

void testApp::setup(){
ofxParameter p;
parameterGroup.add(p.set("param",0,0,100));
}

will crash when trying to access parameterGroup["param"] outside setup, same happens with ofxPanel. A possible solution could be to use smartpointers somehow