From 54a6478fcdeaadc12c753adf73b171979808fd9e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 22 Jun 2018 07:58:04 +0100 Subject: working on gui --- gui/src/AudioPlotter.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ gui/src/main.cpp | 2 ++ gui/src/ofApp.cpp | 15 +++++++++++++- gui/src/ofApp.h | 38 +++++++++++++++++++++++++++++++--- 4 files changed, 106 insertions(+), 4 deletions(-) (limited to 'gui/src') diff --git a/gui/src/AudioPlotter.h b/gui/src/AudioPlotter.h index 9cd37ae..57f25ad 100644 --- a/gui/src/AudioPlotter.h +++ b/gui/src/AudioPlotter.h @@ -3,6 +3,61 @@ #include "lineTransformer.h" +class AChaosplugin{ + public: + AChaosBase* plugin; + vector params; + string name; + AChaosplugin(AChaosBase* _plugin,string _name,vector _params={0,0,0,0,0,0}){ + plugin=_plugin; + params=_params; + name=_name; + } +}; + +class Chaos{ + public: + vector plugins; + vector > params; + Chaos(){ + plugins.push_back(AChaosplugin(new AChaosBaker(),"Baker")); + plugins.push_back(AChaosplugin(new AChaosClifford(),"Clifford")); + plugins.push_back(AChaosplugin(new AChaosCollatz(),"Collatz")); + plugins.push_back(AChaosplugin(new AChaosDuffing(),"Duffing")); + plugins.push_back(AChaosplugin(new AChaosGinger(),"Ginger")); + plugins.push_back(AChaosplugin(new AChaosHenon(),"Henon")); + } +}; + +/* + vector names = { + "Baker", + "Clifford", + "Collatz", + "Duffing", + "Ginger", + "Henon", + "HenonF", + "HenonHeilles", + "HenonPhase", + "Ikeda", + "Jong", + "Logistic", + "Logistic1", + "Lorenz", + "LorenzEuler", + "Lyapunov", + "NavierStokes", + "NavierStokesEuler", + "Rossler", + "Stein", + "Stein1", + "Torus", + "Verhulst" + }; +} +*/ + class Audioplotter{ //store and draw a numbr of audio samples //how best to handle transforms - maybe pass in a transform to be added to 2nd and subsequent diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 0d2fa2d..5b68f90 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -44,6 +44,8 @@ int main(int argc, char *argv[]){ ofAddListener(mainWindow->events().mousePressed,mainApp.get(),&ofApp::outputMousePressed); ofAddListener(mainWindow->events().mouseReleased,mainApp.get(),&ofApp::outputMouseReleased); + //ofAddListener(guiWindow->events().mouseMoved,mainApp.get(),&ofApp::lMouseMoved); + ofRunApp(guiWindow, mainApp); ofRunMainLoop(); } diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp index 7d14996..642ad6c 100644 --- a/gui/src/ofApp.cpp +++ b/gui/src/ofApp.cpp @@ -73,6 +73,7 @@ void ofApp::setup(){ onset_frame=0; chaosgui.setup("chaos","",460,820); + chaosgui.add(plugin_label.setup(plugin_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)); @@ -979,7 +980,19 @@ void ofApp::keyReleased(ofKeyEventArgs &args){ //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ){ - +} +void ofApp::lMouseMoved(ofMouseEventArgs & args ){ + if (args.x>chaosgui.getPosition().x){ //&& + //x-chaosgui.getPosition().xchaosgui.getPosition().y)&& + //((y-chaosgui.getPosition().y)getPosition().x&& + args.x-getPosition().xgetPosition().y&& + args.y-getPosition().y "< "< useMic; + ofParameter useMic; ofParameter useFft; ofParameter scalePlot; ofParameter decayPlot; @@ -129,8 +156,13 @@ class ofApp: public ofBaseApp, public ofxMidiListener { //======== chaos gui - ofxPanel chaosgui; - + mouseSelectPanel chaosgui; + ofxLabel plugin_label; + ofParameter plugin_name; + + // best architecture for the chaos plugin? + // how to use it on an arbitrary set of data + // should it be a part of the audio plotter? //======================================== //thresholding -- cgit v1.2.3