annotate testApp.h @ 5:5ee5ef99e117

presets have "icons" and save OK. Snapping works. move velocity still frustrating.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 05 Dec 2012 18:42:02 +0000
parents 43df75088d85
children 34eba1046890
rev   line source
rt300@0 1 #pragma once
rt300@0 2
rt300@0 3 #include "ofMain.h"
rt300@0 4 #include "ofxiPhone.h"
rt300@0 5 #include "ofxiPhoneExtras.h"
rt300@0 6 #include "ofxOsc.h"
rt300@0 7 #include "grid.h"
rt300@0 8 #include "2dvector.h"
rt300@0 9 #include "ofxUI.h"
rt300@0 10 #include "eventLogger.h"
rt300@2 11 #include "AppCore.h"
rt300@1 12
rt300@3 13 #include "presetManager.h"
rt300@3 14 #include "eventLogger.h"
rt300@3 15 #include "ofxPd.h"
rt300@3 16 #include "frequencer.h"
rt300@3 17
rt300@0 18 #define HOST "169.254.1.1"
rt300@0 19 #define PORT 12345
rt300@0 20
rt300@0 21 class testApp : public ofxiPhoneApp {
rt300@0 22
rt300@3 23
rt300@3 24 public:
rt300@0 25
rt300@3 26
rt300@0 27 int prevTouchX;
rt300@0 28 int prevTouchY;
rt300@0 29 double prevDist;
rt300@0 30 // not many so dont bother with vectors/arrays?
rt300@0 31 TwoVector touch0;
rt300@0 32 TwoVector touch1;
rt300@0 33 TwoVector prevTouch0;
rt300@0 34 TwoVector prevTouch1;
rt300@5 35
rt300@0 36 bool xLocked, yLocked;
rt300@5 37 int framesSinceLastScroll;
rt300@0 38
rt300@0 39 TwoVector moveVel; // velocity at which we were moving the grid
rt300@0 40
rt300@0 41 vector <ofxUISlider *> sliders;
rt300@0 42
rt300@0 43 double slowFactor;
rt300@0 44 double zoomVel; // do the same
rt300@0 45 double prevZoom, prevZoom2;
rt300@5 46 TwoVector move, prevMove, prevMove2;
rt300@0 47
rt300@0 48 vector<int> sliderVals;
rt300@3 49 vector<int> freqIndexes;
rt300@0 50
rt300@0 51 int numActiveTouches;
rt300@0 52
rt300@0 53 ofxiPhoneKeyboard * keyboard;
rt300@0 54 //
rt300@0 55
rt300@0 56 void setup();
rt300@0 57 void update();
rt300@0 58 void draw();
rt300@0 59 void exit();
rt300@0 60
rt300@0 61 void touchDown(ofTouchEventArgs &touch);
rt300@0 62 void touchMoved(ofTouchEventArgs &touch);
rt300@0 63 void touchUp(ofTouchEventArgs &touch);
rt300@0 64 void touchDoubleTap(ofTouchEventArgs &touch);
rt300@0 65 void touchCancelled(ofTouchEventArgs &touch);
rt300@0 66
rt300@1 67 void handleScroll();
rt300@1 68 void handleZoom();
rt300@1 69
rt300@0 70 vector<float> vectorFilter(vector<float> newVec);
rt300@0 71
rt300@0 72 void lostFocus();
rt300@0 73 void gotFocus();
rt300@0 74 void gotMemoryWarning();
rt300@0 75 void deviceOrientationChanged(int newOrientation);
rt300@0 76
rt300@0 77 ofxOscSender sender;
rt300@0 78 void sendOSCParams();
rt300@0 79
rt300@0 80 // stardard GUI - knbs and sliders - hides zoomer
rt300@0 81 bool standardGUIShowing;
rt300@0 82 void standardGUIEvent(ofxUIEventArgs &e);
rt300@0 83 void setupStandardGui();
rt300@0 84 ofxUICanvas *standardGUI;
rt300@0 85
rt300@0 86 // zoom gui - the swap view button and save preset button
rt300@0 87 void zoomGUIEvent(ofxUIEventArgs &e);
rt300@0 88 void setupZoomGui();
rt300@0 89
rt300@3 90 void sliderMoved(int which, float value);
rt300@3 91 void setAllGUISliders(vector<int> vals);
rt300@3 92 void sendParametersToPD();
rt300@3 93 void sendOscShape(int ctrlin);
rt300@3 94 void sendFiltShape(int ctrlin);
rt300@3 95 void sendFiltType(int ctrlin);
rt300@3 96 void sendFiltFreq(int ctrlin);
rt300@3 97 void sendEnvShape(int ctrlin);
rt300@3 98 void sendModFreq(int ctrlin);
rt300@0 99
rt300@0 100 ofxUICanvas *zoomGUI;
rt300@0 101
rt300@2 102 // audio callbacks
rt300@2 103 void audioReceived(float * input, int bufferSize, int nChannels);
rt300@2 104 void audioRequested(float * output, int bufferSize, int nChannels);
rt300@2 105
rt300@2 106 AppCore core;
rt300@2 107
rt300@0 108 };
rt300@0 109