rt300@0: #pragma once rt300@0: rt300@0: #include "ofMain.h" rt300@0: #include "ofxiPhone.h" rt300@0: #include "ofxiPhoneExtras.h" rt300@0: #include "ofxOsc.h" rt300@0: #include "grid.h" rt300@0: #include "2dvector.h" rt300@0: #include "ofxUI.h" rt300@0: #include "eventLogger.h" rt300@2: #include "AppCore.h" rt300@1: rt300@3: #include "presetManager.h" rt300@3: #include "eventLogger.h" rt300@3: #include "ofxPd.h" rt300@3: #include "frequencer.h" rt300@3: rt300@0: #define HOST "169.254.1.1" rt300@0: #define PORT 12345 rt300@0: rt300@0: class testApp : public ofxiPhoneApp { rt300@0: rt300@3: rt300@3: public: rt300@0: rt300@3: rt300@0: int prevTouchX; rt300@0: int prevTouchY; rt300@0: double prevDist; rt300@0: // not many so dont bother with vectors/arrays? rt300@0: TwoVector touch0; rt300@0: TwoVector touch1; rt300@0: TwoVector prevTouch0; rt300@0: TwoVector prevTouch1; rt300@5: rt300@0: bool xLocked, yLocked; rt300@6: unsigned int lastMoveTime; rt300@0: rt300@0: TwoVector moveVel; // velocity at which we were moving the grid rt300@0: rt300@0: vector sliders; rt300@0: rt300@0: double slowFactor; rt300@0: double zoomVel; // do the same rt300@0: double prevZoom, prevZoom2; rt300@5: TwoVector move, prevMove, prevMove2; rt300@0: rt300@0: vector sliderVals; rt300@3: vector freqIndexes; rt300@0: rt300@0: int numActiveTouches; rt300@0: rt300@0: ofxiPhoneKeyboard * keyboard; rt300@0: // rt300@0: rt300@0: void setup(); rt300@0: void update(); rt300@0: void draw(); rt300@0: void exit(); rt300@0: rt300@0: void touchDown(ofTouchEventArgs &touch); rt300@0: void touchMoved(ofTouchEventArgs &touch); rt300@0: void touchUp(ofTouchEventArgs &touch); rt300@0: void touchDoubleTap(ofTouchEventArgs &touch); rt300@0: void touchCancelled(ofTouchEventArgs &touch); rt300@0: rt300@1: void handleScroll(); rt300@1: void handleZoom(); rt300@1: rt300@0: vector vectorFilter(vector newVec); rt300@0: rt300@0: void lostFocus(); rt300@0: void gotFocus(); rt300@0: void gotMemoryWarning(); rt300@0: void deviceOrientationChanged(int newOrientation); rt300@0: rt300@0: ofxOscSender sender; rt300@0: void sendOSCParams(); rt300@0: rt300@0: // stardard GUI - knbs and sliders - hides zoomer rt300@0: bool standardGUIShowing; rt300@0: void standardGUIEvent(ofxUIEventArgs &e); rt300@0: void setupStandardGui(); rt300@0: ofxUICanvas *standardGUI; rt300@0: rt300@0: // zoom gui - the swap view button and save preset button rt300@0: void zoomGUIEvent(ofxUIEventArgs &e); rt300@0: void setupZoomGui(); rt300@0: rt300@3: void sliderMoved(int which, float value); rt300@3: void setAllGUISliders(vector vals); rt300@3: void sendParametersToPD(); rt300@3: void sendOscShape(int ctrlin); rt300@3: void sendFiltShape(int ctrlin); rt300@3: void sendFiltType(int ctrlin); rt300@3: void sendFiltFreq(int ctrlin); rt300@3: void sendEnvShape(int ctrlin); rt300@3: void sendModFreq(int ctrlin); rt300@0: rt300@0: ofxUICanvas *zoomGUI; rt300@0: rt300@2: // audio callbacks rt300@2: void audioReceived(float * input, int bufferSize, int nChannels); rt300@2: void audioRequested(float * output, int bufferSize, int nChannels); rt300@2: rt300@2: AppCore core; rt300@2: rt300@0: }; rt300@0: