#pragma once #include "ofMain.h" #include "ofxGui.h" #include "ofxAChaoslib.h" struct float_param { public: string name; float val; float min; float max; }; class loader { public: loader(string _n,AChaosBase *_plugin,vector _params={}){ name=_n; plugin=_plugin; params=_params; } string name; AChaosBase *plugin; vector params; }; class pluginPanel : public ofxPanel { public: pluginPanel(){ ofRegisterKeyEvents(this, defaultEventsPriority); plugins={ loader("baker",&baker), loader("clifford",&clifford,{ {"a",0.0f,-1.0f,1.0f}, {"b",0.0f,-1.0f,1.0f}, {"c",0.0f,-1.0f,1.0f}, {"d",0.0f,-1.0f,1.0f} } ) }; index=0; update(); } bool mouseMoved(ofMouseEventArgs & args){ if (args.x>getPosition().x&& args.x-getPosition().xgetPosition().y&& args.y-getPosition().y "< "< "< param; ofLog()<<"creating parameter: "<set(iv); plugins[index].plugin->calc(); } private: int index; bool isSelected; ofxLabel label; vector plugins; ofParameter active; ofParameter amount; vector > params; AChaosBaker baker; AChaosClifford clifford; };