From efda4fd446da89ccd3909c988b6c1e932efa24bb Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 26 Jun 2018 11:11:35 +0100 Subject: multi chaos panel WIP --- gui/src/AudioPlotter.h | 7 +++++++ gui/src/ofApp.cpp | 2 +- gui/src/ofApp.h | 20 ++++++++++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) (limited to 'gui/src') 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 plugins; vector > params; int whichplugin; + ofParameter 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> "< plugin_name; -- cgit v1.2.3