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@8
|
18 #include "json.h"
|
rt300@8
|
19
|
rt300@16
|
20
|
rt300@16
|
21 #import "QuestionnaireViewController.h"
|
rt300@8
|
22
|
rt300@0
|
23 #define HOST "169.254.1.1"
|
rt300@0
|
24 #define PORT 12345
|
rt300@0
|
25
|
rt300@0
|
26 class testApp : public ofxiPhoneApp {
|
rt300@0
|
27
|
rt300@3
|
28
|
rt300@3
|
29 public:
|
rt300@0
|
30
|
rt300@3
|
31
|
rt300@0
|
32 int prevTouchX;
|
rt300@0
|
33 int prevTouchY;
|
rt300@0
|
34 double prevDist;
|
rt300@16
|
35 bool paused;
|
rt300@0
|
36 // not many so dont bother with vectors/arrays?
|
rt300@0
|
37 TwoVector touch0;
|
rt300@0
|
38 TwoVector touch1;
|
rt300@0
|
39 TwoVector prevTouch0;
|
rt300@0
|
40 TwoVector prevTouch1;
|
rt300@5
|
41
|
rt300@0
|
42 bool xLocked, yLocked;
|
rt300@6
|
43 unsigned int lastMoveTime;
|
rt300@0
|
44
|
rt300@0
|
45 TwoVector moveVel; // velocity at which we were moving the grid
|
rt300@0
|
46
|
rt300@0
|
47 vector <ofxUISlider *> sliders;
|
rt300@0
|
48
|
rt300@0
|
49 double slowFactor;
|
rt300@0
|
50 double zoomVel; // do the same
|
rt300@0
|
51 double prevZoom, prevZoom2;
|
rt300@5
|
52 TwoVector move, prevMove, prevMove2;
|
rt300@0
|
53
|
rt300@0
|
54 vector<int> sliderVals;
|
rt300@3
|
55 vector<int> freqIndexes;
|
rt300@0
|
56
|
rt300@0
|
57 int numActiveTouches;
|
rt300@0
|
58
|
rt300@16
|
59 QuestionnaireViewController * questionnaireViewController;
|
rt300@0
|
60 //
|
rt300@0
|
61
|
rt300@16
|
62 void setup();
|
rt300@16
|
63 void update();
|
rt300@16
|
64 void draw();
|
rt300@16
|
65 void exit();
|
rt300@16
|
66
|
rt300@16
|
67 float getWidth();
|
rt300@16
|
68 float getHeight();
|
rt300@16
|
69
|
rt300@16
|
70 void touchDown(ofTouchEventArgs &touch);
|
rt300@16
|
71 void touchMoved(ofTouchEventArgs &touch);
|
rt300@16
|
72 void touchUp(ofTouchEventArgs &touch);
|
rt300@16
|
73 void touchDoubleTap(ofTouchEventArgs &touch);
|
rt300@16
|
74 void touchCancelled(ofTouchEventArgs &touch);
|
rt300@0
|
75
|
rt300@1
|
76 void handleScroll();
|
rt300@1
|
77 void handleZoom();
|
rt300@1
|
78
|
rt300@0
|
79 vector<float> vectorFilter(vector<float> newVec);
|
rt300@16
|
80
|
rt300@16
|
81 void lostFocus();
|
rt300@16
|
82 void gotFocus();
|
rt300@16
|
83 void gotMemoryWarning();
|
rt300@16
|
84 void deviceOrientationChanged(int newOrientation);
|
rt300@16
|
85
|
rt300@16
|
86 ofxOscSender sender;
|
rt300@0
|
87 void sendOSCParams();
|
rt300@0
|
88
|
rt300@16
|
89 void showQuestionnaire();
|
rt300@16
|
90 void questionnaireHidden(NSArray * answers);
|
rt300@16
|
91
|
rt300@0
|
92 // stardard GUI - knbs and sliders - hides zoomer
|
rt300@0
|
93 bool standardGUIShowing;
|
rt300@0
|
94 void standardGUIEvent(ofxUIEventArgs &e);
|
rt300@0
|
95 void setupStandardGui();
|
rt300@0
|
96 ofxUICanvas *standardGUI;
|
rt300@0
|
97
|
rt300@0
|
98 // zoom gui - the swap view button and save preset button
|
rt300@0
|
99 void zoomGUIEvent(ofxUIEventArgs &e);
|
rt300@0
|
100 void setupZoomGui();
|
rt300@0
|
101
|
rt300@3
|
102 void sliderMoved(int which, float value);
|
rt300@3
|
103 void setAllGUISliders(vector<int> vals);
|
rt300@3
|
104 void sendParametersToPD();
|
rt300@3
|
105 void sendOscShape(int ctrlin);
|
rt300@3
|
106 void sendFiltShape(int ctrlin);
|
rt300@3
|
107 void sendFiltType(int ctrlin);
|
rt300@3
|
108 void sendFiltFreq(int ctrlin);
|
rt300@3
|
109 void sendEnvShape(int ctrlin);
|
rt300@3
|
110 void sendModFreq(int ctrlin);
|
rt300@0
|
111
|
rt300@0
|
112 ofxUICanvas *zoomGUI;
|
rt300@0
|
113
|
rt300@2
|
114 // audio callbacks
|
rt300@2
|
115 void audioReceived(float * input, int bufferSize, int nChannels);
|
rt300@2
|
116 void audioRequested(float * output, int bufferSize, int nChannels);
|
rt300@2
|
117
|
rt300@2
|
118 AppCore core;
|
rt300@2
|
119
|
rt300@0
|
120 };
|
rt300@0
|
121
|