summaryrefslogtreecommitdiff
path: root/gui/src/ofApp.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-07-04 09:29:52 +0100
committerTim Redfern <tim@getdrop.com>2018-07-04 09:29:52 +0100
commitb720d6d730a0d23425ca4c3ef7c156e1c7760ea1 (patch)
treea3f60eef23a131ce53bf1f35fa9ce75beffa56cc /gui/src/ofApp.h
parentefda4fd446da89ccd3909c988b6c1e932efa24bb (diff)
plugin architecture
Diffstat (limited to 'gui/src/ofApp.h')
-rw-r--r--gui/src/ofApp.h64
1 files changed, 60 insertions, 4 deletions
diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h
index 4d766e9..ddc54d7 100644
--- a/gui/src/ofApp.h
+++ b/gui/src/ofApp.h
@@ -43,6 +43,9 @@ class chaosPanel : public ofxPanel {
ofRegisterKeyEvents(this, defaultEventsPriority);
}
bool isSelected;
+ ofParameter<bool> active;
+ ofParameter<float> amount;
+ ofParameter<float> scale; //?per plugin??
bool mouseMoved(ofMouseEventArgs & args){
if (args.x>getPosition().x&&
args.x-getPosition().x<getWidth()&&
@@ -82,12 +85,66 @@ class chaosPanel : public ofxPanel {
bool keyReleased(ofKeyEventArgs & args){
//required in order to call ofRegisterKeyEvents
}
+ //this is a bit tangled
+ /*
+ audioplotter stores drawings that it extracts from audio
+ chaosloader manages a set of plugins that affect polylines
+ audio plotter calls chaosloader a set of lines and it affects them
+ chaosloader should own it's own params (use,scale,amount)
+ should expose compute(vector polyline)
+
+ so we could have
+
+ audio source
+ <>
+ transformer
+ <>
+ chaos
+ <>
+ drawing
+
+ */
+
+ int shown=0;
+
void update_sliders(){
- //delete sliders
+ clear();
+ add(plugin_label.setup(chaosloader.name));
+ add(active.set("use",false));
+ add(amount.set("amount", 0.0f, -0.1f, 0.1f));
+ add(scale.set("scale", 100.0f, 1.0f, 1000.0f));
+ //delete variable sliders, is this even possible?
+
//get number of params
- //create sliders with stored values, names
+ //create sliders with stored values
+ //how to ignore the nx & ny params? I think nx & ny can be moved to the end
+ //I think nx & ny (or value) can be removed and use ov[0] & ov[1] / ov[0]
+ //add(plotter.chaos_a.set("a", 0.85f, 0.0f, 10.0f));
+ //add(plotter.chaos_b.set("b", 0.9f, 0.0f, 10.0f));
+ //add(plotter.chaos_k.set("k", 0.4f, 0.0f, 10.0f));
+ //add(plotter.chaos_p.set("p", 7.7f, 0.0f, 10.0f));
+
+ //can the float sliders be dynamically generated?
+ //get the number of parameters in the selected plugin - iv.size()
+ //create the parameters when the object is initialised
+ //when switching to the plugin, add sliders for the parameters
+ //if we reorder the params will the plugns function the same?
+
+ int size=chaosloader.get().params.size();
+
+ if (shown!=size) {
+ ofLog()<<size<<" items";
+ shown=size;
+ }
+
+ for (auto p:chaosloader.get().params){
+ add(p);
+ }
}
+private:
Chaos chaosloader;
+ ofxLabel plugin_label;
+ ofParameter<string> plugin_name;
};
@@ -185,8 +242,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
//======== chaos gui
chaosPanel chaosgui;
- ofxLabel plugin_label;
- ofParameter<string> plugin_name;
+
// best architecture for the chaos plugin?
// how to use it on an arbitrary set of data