summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/src/AudioPlotter.h7
-rw-r--r--gui/src/ofApp.cpp2
-rw-r--r--gui/src/ofApp.h20
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;