annotate testApp.h @ 2:fcb512cef986

ofxPD working.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 27 Nov 2012 15:34:51 +0000
parents 23efe1f0cd8a
children 43df75088d85
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@0 13 #define HOST "169.254.1.1"
rt300@0 14 #define PORT 12345
rt300@0 15
rt300@0 16 class testApp : public ofxiPhoneApp {
rt300@0 17
rt300@0 18 public:
rt300@0 19
rt300@0 20
rt300@0 21 int prevTouchX;
rt300@0 22 int prevTouchY;
rt300@0 23 double prevDist;
rt300@0 24 // not many so dont bother with vectors/arrays?
rt300@0 25 TwoVector touch0;
rt300@0 26 TwoVector touch1;
rt300@0 27 TwoVector prevTouch0;
rt300@0 28 TwoVector prevTouch1;
rt300@0 29
rt300@0 30 bool xLocked, yLocked;
rt300@0 31
rt300@0 32
rt300@0 33 TwoVector moveVel; // velocity at which we were moving the grid
rt300@0 34
rt300@0 35 vector <ofxUISlider *> sliders;
rt300@0 36
rt300@0 37 double slowFactor;
rt300@0 38 double zoomVel; // do the same
rt300@0 39 double prevZoom, prevZoom2;
rt300@0 40 TwoVector prevMove, prevMove2;
rt300@0 41
rt300@0 42 vector<int> sliderVals;
rt300@0 43
rt300@0 44 int numActiveTouches;
rt300@0 45
rt300@0 46 ofxiPhoneKeyboard * keyboard;
rt300@0 47 //
rt300@0 48
rt300@0 49 void setup();
rt300@0 50 void update();
rt300@0 51 void draw();
rt300@0 52 void exit();
rt300@0 53
rt300@0 54 void touchDown(ofTouchEventArgs &touch);
rt300@0 55 void touchMoved(ofTouchEventArgs &touch);
rt300@0 56 void touchUp(ofTouchEventArgs &touch);
rt300@0 57 void touchDoubleTap(ofTouchEventArgs &touch);
rt300@0 58 void touchCancelled(ofTouchEventArgs &touch);
rt300@0 59
rt300@1 60 void handleScroll();
rt300@1 61 void handleZoom();
rt300@1 62
rt300@0 63 vector<float> vectorFilter(vector<float> newVec);
rt300@0 64
rt300@0 65 void lostFocus();
rt300@0 66 void gotFocus();
rt300@0 67 void gotMemoryWarning();
rt300@0 68 void deviceOrientationChanged(int newOrientation);
rt300@0 69
rt300@0 70 ofxOscSender sender;
rt300@0 71 void sendOSCParams();
rt300@0 72
rt300@0 73 // stardard GUI - knbs and sliders - hides zoomer
rt300@0 74 bool standardGUIShowing;
rt300@0 75 void standardGUIEvent(ofxUIEventArgs &e);
rt300@0 76 void setupStandardGui();
rt300@0 77 ofxUICanvas *standardGUI;
rt300@0 78
rt300@0 79 // zoom gui - the swap view button and save preset button
rt300@0 80 void zoomGUIEvent(ofxUIEventArgs &e);
rt300@0 81 void setupZoomGui();
rt300@0 82
rt300@0 83 void updateSliderValue(int which, float value);
rt300@0 84 void setGUISliders(vector<int> vals);
rt300@0 85
rt300@0 86 ofxUICanvas *zoomGUI;
rt300@0 87
rt300@2 88 // audio callbacks
rt300@2 89 void audioReceived(float * input, int bufferSize, int nChannels);
rt300@2 90 void audioRequested(float * output, int bufferSize, int nChannels);
rt300@2 91
rt300@2 92 AppCore core;
rt300@2 93
rt300@0 94 };
rt300@0 95