diff options
| author | Tim Redfern <tim@getdrop.com> | 2018-06-26 11:11:35 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2018-06-26 11:11:35 +0100 |
| commit | efda4fd446da89ccd3909c988b6c1e932efa24bb (patch) | |
| tree | 753e13bcf097a9468aecef9ecd8aacd9d1b07720 /gui | |
| parent | 3baf7e68c29a5a37f9317aeb0f4e75252a9e4530 (diff) | |
multi chaos panel WIP
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/AudioPlotter.h | 7 | ||||
| -rw-r--r-- | gui/src/ofApp.cpp | 2 | ||||
| -rw-r--r-- | gui/src/ofApp.h | 20 |
3 files changed, 22 insertions, 7 deletions
diff --git a/gui/src/AudioPlotter.h b/gui/src/AudioPlotter.h index 40e3fc9..716a1dd 100644 --- a/gui/src/AudioPlotter.h +++ b/gui/src/AudioPlotter.h @@ -20,6 +20,7 @@ class Chaos{ vector <AChaosplugin> plugins; vector <vector <REAL>> params; int whichplugin; + ofParameter <string> name; Chaos(){ plugins.push_back(AChaosplugin(new AChaosBaker(),"Baker")); plugins.push_back(AChaosplugin(new AChaosClifford(),"Clifford")); @@ -28,15 +29,21 @@ class Chaos{ plugins.push_back(AChaosplugin(new AChaosGinger(),"Ginger")); plugins.push_back(AChaosplugin(new AChaosHenon(),"Henon")); whichplugin=0; + update_name(); } void next(){ whichplugin=(whichplugin+1)%plugins.size(); + update_name(); } void previous(){ whichplugin=whichplugin-1; if (whichplugin<0){ whichplugin=plugins.size()-1; } + update_name(); + } + void update_name(){ + name=plugins[whichplugin].name; } std::string &get_name(){ return plugins[whichplugin].name; diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index a2196c5..caa9195 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -73,7 +73,7 @@ void ofApp::setup(){ onset_frame=0; chaosgui.setup("chaos","",460,820); - chaosgui.add(plugin_label.setup(plotter.chaosloader.get_name())); + chaosgui.add(plugin_label.setup(chaosgui.chaosloader.name)); chaosgui.add(plotter.usechaos.set("use",false)); chaosgui.add(plotter.chaosamount.set("amount", 0.0f, -0.1f, 0.1f)); chaosgui.add(plotter.chaosscale.set("scale", 100.0f, 1.0f, 1000.0f)); diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h index 29c6929..4d766e9 100644 --- a/gui/src/ofApp.h +++ b/gui/src/ofApp.h @@ -37,9 +37,9 @@ enum Source{ }; -class mouseSelectPanel : public ofxPanel { +class chaosPanel : public ofxPanel { public: - mouseSelectPanel(){ + chaosPanel(){ ofRegisterKeyEvents(this, defaultEventsPriority); } bool isSelected; @@ -67,11 +67,14 @@ class mouseSelectPanel : public ofxPanel { //ofLog()<<"KEY> "<<args.key; switch(args.key){ case 3812:{ - //previous + chaosloader.previous(); + update_sliders(); break; } case 3814:{ - //next + chaosloader.next(); + update_sliders(); + break; } } } @@ -79,7 +82,12 @@ class mouseSelectPanel : public ofxPanel { bool keyReleased(ofKeyEventArgs & args){ //required in order to call ofRegisterKeyEvents } - + void update_sliders(){ + //delete sliders + //get number of params + //create sliders with stored values, names + } + Chaos chaosloader; }; @@ -176,7 +184,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener { //======== chaos gui - mouseSelectPanel chaosgui; + chaosPanel chaosgui; ofxLabel plugin_label; ofParameter<string> plugin_name; |
