diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/bin/data/settings.xml | 22 | ||||
| -rw-r--r-- | gui/src/AudioPlotter.h | 55 | ||||
| -rw-r--r-- | gui/src/main.cpp | 2 | ||||
| -rw-r--r-- | gui/src/ofApp.cpp | 15 | ||||
| -rw-r--r-- | gui/src/ofApp.h | 38 |
5 files changed, 117 insertions, 15 deletions
diff --git a/gui/bin/data/settings.xml b/gui/bin/data/settings.xml index 7fe2fc2..8e5315f 100644 --- a/gui/bin/data/settings.xml +++ b/gui/bin/data/settings.xml @@ -1,27 +1,27 @@ <?xml version="1.0" ?> <WARP> <p0> - <X>0.367187500</X> - <Y>899.445312500</Y> + <X>48.753906250</X> + <Y>798.679687500</Y> </p0> <p1> - <X>1199.296875000</X> - <Y>897.746093750</Y> + <X>1169.832031250</X> + <Y>836.375000000</Y> </p1> <p2> - <X>1199.996093750</X> - <Y>1.593750000</Y> + <X>1179.113281250</X> + <Y>188.660156250</Y> </p2> <p3> - <X>-4.125000000</X> - <Y>1.101562500</Y> + <X>10.117187500</X> + <Y>150.164062500</Y> </p3> </WARP> <POSITION> - <X>43.828575134</X> - <Y>817.771545410</Y> + <X>-88.657150269</X> + <Y>400.085754395</Y> </POSITION> -<SCALE>2.177917004</SCALE> +<SCALE>3.055415154</SCALE> <laser> <power>0</power> <intensity>30</intensity> 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 <REAL> params; + string name; + AChaosplugin(AChaosBase* _plugin,string _name,vector <REAL> _params={0,0,0,0,0,0}){ + plugin=_plugin; + params=_params; + name=_name; + } +}; + +class Chaos{ + public: + vector <AChaosplugin> plugins; + vector <vector <REAL>> 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 <string> 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().x<chaosgui.getWidth()&& + //(y>chaosgui.getPosition().y)&& + //((y-chaosgui.getPosition().y)<chaosgui.getHeight())){ + chaosgui.setFillColor(ofColor(128,64,0)); + ofLog()<<args.x<<","<<args.y<<" :"<<chaosgui.getPosition().x<<","<<chaosgui.getPosition().y<<" :"<<chaosgui.getWidth()<<","<<chaosgui.getHeight()<<" IN"; + } + else { + chaosgui.setFillColor(ofColor(0,0,0)); + ofLog()<<args.x<<","<<args.y<<" :"<<chaosgui.getPosition().x<<","<<chaosgui.getPosition().y<<" :"<<chaosgui.getWidth()<<","<<chaosgui.getHeight()<<" OUT"; + } } //-------------------------------------------------------------- diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h index 24ab46e..41418b3 100644 --- a/gui/src/ofApp.h +++ b/gui/src/ofApp.h @@ -37,6 +37,31 @@ enum Source{ }; +class mouseSelectPanel : public ofxPanel { + public: + bool isSelected; + bool mouseMoved(ofMouseEventArgs & args){ + if (args.x>getPosition().x&& + args.x-getPosition().x<getWidth()&& + args.y>getPosition().y&& + args.y-getPosition().y<getHeight()){ + if (!isSelected){ + isSelected=true; + setBorderColor(ofColor(128,64,0)); + //ofLog()<<"IN> "<<args.x<<","<<args.y; + } + } + else { + if (isSelected){ + isSelected=false; + setBorderColor(ofColor(0,0,0)); + //ofLog()<<"OUT> "<<args.x<<","<<args.y; + } + } + } +}; + + class ofApp: public ofBaseApp, public ofxMidiListener { public: @@ -56,6 +81,8 @@ class ofApp: public ofBaseApp, public ofxMidiListener { void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); + void lMouseMoved(ofMouseEventArgs & args); //mouseMoved listener + void newMidiMessage(ofxMidiMessage& eventArgs); void updateOutput(ofEventArgs & args); @@ -110,7 +137,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener { //======== audio gui ofxPanel audiogui; - ofParameter<bool> useMic; + ofParameter<bool> useMic; ofParameter<bool> useFft; ofParameter<float> scalePlot; ofParameter<float> decayPlot; @@ -129,8 +156,13 @@ class ofApp: public ofBaseApp, public ofxMidiListener { //======== chaos gui - ofxPanel chaosgui; - + mouseSelectPanel chaosgui; + ofxLabel plugin_label; + ofParameter<string> 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 |
