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