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@32
|
6 #include "ofxiPhoneExternalDisplay.h"
|
rt300@0
|
7 #include "ofxOsc.h"
|
rt300@0
|
8 #include "grid.h"
|
rt300@0
|
9 #include "2dvector.h"
|
rt300@0
|
10 #include "ofxUI.h"
|
rt300@0
|
11 #include "eventLogger.h"
|
rt300@2
|
12 #include "AppCore.h"
|
rt300@1
|
13
|
rt300@3
|
14 #include "presetManager.h"
|
rt300@3
|
15 #include "eventLogger.h"
|
rt300@3
|
16 #include "ofxPd.h"
|
rt300@3
|
17 #include "frequencer.h"
|
rt300@3
|
18
|
rt300@8
|
19 #include "json.h"
|
rt300@8
|
20
|
rt300@16
|
21
|
rt300@16
|
22 #import "QuestionnaireViewController.h"
|
rt300@24
|
23 #import "BottomTabViewController.h"
|
rt300@24
|
24 #import "IntroViewController.h"
|
rt300@27
|
25 #import "HelpViewController.h"
|
rt300@24
|
26 #import "TopButtonViewController.h"
|
rt300@25
|
27 #import "SliderViewController.h"
|
rt300@25
|
28 #import "usernameAlertViewController.h"
|
rt300@29
|
29 #import "TimedSessionController.h"
|
rt300@29
|
30 #define OSC_HOST "169.254.1.1"
|
rt300@29
|
31 #define OSC_PORT 12345
|
rt300@8
|
32
|
rt300@29
|
33 typedef enum {SLIDERS,ZOOMER,BOTH,INTRO,QUESTIONNAIRE, HELP}interfaceType;
|
rt300@24
|
34
|
rt300@32
|
35 class testApp : public ofxiPhoneApp , public ofxiPhoneExternalDisplay{
|
rt300@0
|
36
|
rt300@3
|
37
|
rt300@3
|
38 public:
|
rt300@0
|
39
|
rt300@24
|
40 interfaceType whichInterfaceShowing;
|
rt300@24
|
41 BottomTabViewController *bottomTabViewController;
|
rt300@25
|
42 UsernameAlertViewController *usernameAlertViewController;
|
rt300@26
|
43 HelpViewController *helpViewController;
|
rt300@27
|
44 QuestionnaireViewController * questionnaireViewController;
|
rt300@27
|
45 IntroViewController * introViewController;
|
rt300@27
|
46 TopButtonViewController * topButtonViewController;
|
rt300@27
|
47 SliderViewController * sliderViewController;
|
rt300@29
|
48 TimedSessionController * tsc;
|
rt300@0
|
49 int prevTouchX;
|
rt300@0
|
50 int prevTouchY;
|
rt300@0
|
51 double prevDist;
|
rt300@16
|
52 bool paused;
|
rt300@0
|
53 // not many so dont bother with vectors/arrays?
|
rt300@0
|
54 TwoVector touch0;
|
rt300@0
|
55 TwoVector touch1;
|
rt300@0
|
56 TwoVector prevTouch0;
|
rt300@0
|
57 TwoVector prevTouch1;
|
rt300@5
|
58
|
rt300@0
|
59 bool xLocked, yLocked;
|
rt300@6
|
60 unsigned int lastMoveTime;
|
rt300@0
|
61
|
rt300@0
|
62 TwoVector moveVel; // velocity at which we were moving the grid
|
rt300@0
|
63
|
rt300@0
|
64 vector <ofxUISlider *> sliders;
|
rt300@0
|
65
|
rt300@0
|
66 double slowFactor;
|
rt300@0
|
67 double zoomVel; // do the same
|
rt300@0
|
68 double prevZoom, prevZoom2;
|
rt300@5
|
69 TwoVector move, prevMove, prevMove2;
|
rt300@0
|
70
|
rt300@0
|
71 vector<int> sliderVals;
|
rt300@3
|
72 vector<int> freqIndexes;
|
rt300@0
|
73
|
rt300@0
|
74 int numActiveTouches;
|
rt300@27
|
75 bool preventingMovePostScroll;
|
rt300@27
|
76
|
rt300@27
|
77
|
rt300@0
|
78 //
|
rt300@0
|
79
|
rt300@16
|
80 void setup();
|
rt300@16
|
81 void update();
|
rt300@16
|
82 void draw();
|
rt300@16
|
83 void exit();
|
rt300@16
|
84
|
rt300@16
|
85 float getWidth();
|
rt300@16
|
86 float getHeight();
|
rt300@16
|
87
|
rt300@16
|
88 void touchDown(ofTouchEventArgs &touch);
|
rt300@16
|
89 void touchMoved(ofTouchEventArgs &touch);
|
rt300@16
|
90 void touchUp(ofTouchEventArgs &touch);
|
rt300@16
|
91 void touchDoubleTap(ofTouchEventArgs &touch);
|
rt300@16
|
92 void touchCancelled(ofTouchEventArgs &touch);
|
rt300@0
|
93
|
rt300@1
|
94 void handleScroll();
|
rt300@1
|
95 void handleZoom();
|
rt300@1
|
96
|
rt300@0
|
97 vector<float> vectorFilter(vector<float> newVec);
|
rt300@16
|
98
|
rt300@16
|
99 void lostFocus();
|
rt300@16
|
100 void gotFocus();
|
rt300@16
|
101 void gotMemoryWarning();
|
rt300@16
|
102 void deviceOrientationChanged(int newOrientation);
|
rt300@16
|
103
|
rt300@16
|
104 ofxOscSender sender;
|
rt300@0
|
105 void sendOSCParams();
|
rt300@0
|
106
|
rt300@27
|
107 void setupNewUser();
|
rt300@27
|
108
|
rt300@24
|
109 void lockSynthPressed(bool locked);
|
rt300@24
|
110 void lockSequencerPressed(bool locked);
|
rt300@24
|
111
|
rt300@16
|
112 void showQuestionnaire();
|
rt300@28
|
113 void questionnaireHidden(vector<int> answers, const char* userComments);
|
rt300@24
|
114 void showIntro();
|
rt300@24
|
115 void introHidden(bool OK);
|
rt300@24
|
116 void interfaceSelected(int which);
|
rt300@24
|
117 void seqStartStop(bool go);
|
rt300@27
|
118 void showHelp();
|
rt300@27
|
119 void helpHidden();
|
rt300@24
|
120
|
rt300@24
|
121 void setupBottomGui();
|
rt300@24
|
122 void bottomGuiEvent();
|
rt300@24
|
123 void setupTopGui();
|
rt300@24
|
124 void topGuiEvent();
|
rt300@16
|
125
|
rt300@0
|
126 // stardard GUI - knbs and sliders - hides zoomer
|
rt300@24
|
127 void sliderGUIEvent(ofxUIEventArgs &e);
|
rt300@24
|
128 void setupSliderGui();
|
rt300@24
|
129 ofxUICanvas *sliderGUI;
|
rt300@24
|
130
|
rt300@22
|
131 void sliderMoved(int which, float value);
|
rt300@22
|
132 void setAllGUISliders(vector<int> vals);
|
rt300@25
|
133 void randomise();
|
rt300@0
|
134
|
rt300@0
|
135 // zoom gui - the swap view button and save preset button
|
rt300@0
|
136 void zoomGUIEvent(ofxUIEventArgs &e);
|
rt300@0
|
137 void setupZoomGui();
|
rt300@0
|
138
|
rt300@22
|
139
|
rt300@3
|
140 void sendParametersToPD();
|
rt300@3
|
141 void sendOscShape(int ctrlin);
|
rt300@3
|
142 void sendFiltShape(int ctrlin);
|
rt300@3
|
143 void sendFiltType(int ctrlin);
|
rt300@3
|
144 void sendFiltFreq(int ctrlin);
|
rt300@3
|
145 void sendEnvShape(int ctrlin);
|
rt300@3
|
146 void sendModFreq(int ctrlin);
|
rt300@0
|
147
|
rt300@0
|
148 ofxUICanvas *zoomGUI;
|
rt300@0
|
149
|
rt300@2
|
150 // audio callbacks
|
rt300@2
|
151 void audioReceived(float * input, int bufferSize, int nChannels);
|
rt300@2
|
152 void audioRequested(float * output, int bufferSize, int nChannels);
|
rt300@2
|
153
|
rt300@2
|
154 AppCore core;
|
rt300@2
|
155
|
rt300@0
|
156 };
|
rt300@0
|
157
|
rt300@22
|
158 // should be off split into
|
rt300@22
|
159 // GUI controller
|
rt300@22
|
160 // parameter converter
|
rt300@22
|
161 // |