rt300@0
|
1 #pragma once
|
rt300@0
|
2
|
rt300@0
|
3 #include "ofMain.h"
|
rt300@0
|
4
|
rt300@0
|
5 //#include "ofxiPhone.h"
|
rt300@0
|
6 //#include "ofxiPhoneExtras.h"
|
rt300@0
|
7 // #include "ofxiPhoneExternalDisplay.h"
|
rt300@0
|
8
|
rt300@0
|
9 #include "ofxiOS.h"
|
rt300@0
|
10 #include "ofxiOSExtras.h"
|
rt300@0
|
11
|
rt300@0
|
12 #include "ofxOsc.h"
|
rt300@0
|
13 #include "ofxMidi.h"
|
rt300@0
|
14 #include "2dvector.h"
|
rt300@0
|
15 #include "AppCore.h"
|
rt300@0
|
16 #include "eventLogger.h"
|
rt300@0
|
17 #include "ofxPd.h"
|
rt300@0
|
18 #include "json.h"
|
rt300@0
|
19 #import "QuestionnaireViewController.h"
|
rt300@0
|
20 #import "HelpViewController.h"
|
rt300@0
|
21 #import "UsernameAlertViewController.h"
|
rt300@0
|
22 #import "IntroViewController.h"
|
rt300@0
|
23 #include "sliderPanel.h"
|
rt300@0
|
24 #include "UIElement.h"
|
rt300@0
|
25 #include "UIElementContainer.h"
|
rt300@0
|
26 #include "buttron.h"
|
rt300@0
|
27 #include "ButtronSlider.h"
|
rt300@0
|
28 #include "buttronXY.h"
|
rt300@0
|
29 #include "UIGrid.h"
|
rt300@0
|
30 #include "MessageOrganiser.h"
|
rt300@8
|
31 #include "SearchMessageOrganiser.h"
|
rt300@8
|
32 #include "TrainingMessageOrganiser.h"
|
rt300@16
|
33 #include "ExpMessageOrganiser.h"
|
rt300@0
|
34 #include "timeController.h"
|
rt300@0
|
35 #include <buttonPanel.h>
|
rt300@0
|
36 #include "targetSymbol.h"
|
rt300@0
|
37 #include "3Dbox.h"
|
rt300@24
|
38 #include "6Dbox.h"
|
rt300@0
|
39 #include "TextPanel.h"
|
rt300@0
|
40 //#define OSC_HOST "169.254.1.1"
|
rt300@0
|
41 //#define OSC_PORT 12345
|
rt300@0
|
42
|
rt300@0
|
43 #define SLIDER_GUI_WIDTH 256
|
rt300@0
|
44 #define SLIDER_HEIGHT 256
|
rt300@0
|
45 #define NUM_PARAMS 10
|
rt300@0
|
46
|
rt300@0
|
47
|
rt300@0
|
48
|
rt300@0
|
49 class testApp : public ofxiOSApp , public ofxMidiListener, public ofxMidiConnectionListener {
|
rt300@0
|
50
|
rt300@0
|
51
|
rt300@0
|
52 public:
|
rt300@7
|
53
|
rt300@9
|
54 testStages currentStage;
|
rt300@9
|
55
|
rt300@0
|
56 ofTrueTypeFont verdBig;
|
rt300@0
|
57 bool sendMIDIAndOSC;
|
rt300@0
|
58 bool paused;
|
rt300@0
|
59
|
rt300@0
|
60 int midiChannel;
|
rt300@0
|
61 int midiOffset;
|
rt300@0
|
62 double tx,ty;
|
rt300@0
|
63 ofColor generalBackground;
|
rt300@0
|
64 //
|
rt300@0
|
65 void initialiseGUIs();
|
rt300@0
|
66 void initialiseVariables();
|
rt300@0
|
67 void initialiseMIDI();
|
rt300@0
|
68 void setupUIElements();
|
rt300@6
|
69 void setupExpressViewPanels();
|
rt300@6
|
70 void setupTrainingViewPanels();
|
rt300@6
|
71 void setupSearchViewPanels();
|
rt300@7
|
72 void setupSliderPanel();
|
rt300@0
|
73 void setup();
|
rt300@0
|
74 void update();
|
rt300@0
|
75 void draw();
|
rt300@0
|
76 void drawUIElements();
|
rt300@0
|
77 void exit();
|
rt300@38
|
78 void backToMainMenu();
|
rt300@0
|
79 HelpViewController *helpViewController;
|
rt300@0
|
80 QuestionnaireViewController *questionnaireViewController;
|
rt300@0
|
81 UsernameAlertViewController *usernameAlertViewController;
|
rt300@0
|
82 IntroViewController * introViewController;
|
rt300@0
|
83
|
rt300@8
|
84 SearchMessageOrganiser searchMessageOrganiser;
|
rt300@8
|
85 TrainingMessageOrganiser trainingMessageOrganiser;
|
rt300@16
|
86 ExpMessageOrganiser expMessageOrganiser;
|
rt300@8
|
87
|
rt300@8
|
88 PDSynthWrapper targetSynth;
|
rt300@8
|
89 PDSynthWrapper candidateSynth;
|
rt300@9
|
90
|
rt300@0
|
91 //TimeController timeController;
|
rt300@0
|
92 interfaceType whichInterfaceShowing, previousInterface;
|
rt300@0
|
93
|
rt300@7
|
94 // various views
|
rt300@0
|
95 vector<UIElement *> UIElements;
|
rt300@28
|
96 vector<UIElement *> AnimatedUIElements;
|
rt300@0
|
97
|
rt300@0
|
98 void touchToUIElements(int x, int y, touchType ttype, int tid);
|
rt300@0
|
99 void touchDown(ofTouchEventArgs &touch);
|
rt300@0
|
100 void touchMoved(ofTouchEventArgs &touch);
|
rt300@0
|
101 void touchUp(ofTouchEventArgs &touch);
|
rt300@0
|
102 void touchDoubleTap(ofTouchEventArgs &touch);
|
rt300@0
|
103 void touchCancelled(ofTouchEventArgs &touch);
|
rt300@0
|
104 double ofFixGetWidth();
|
rt300@0
|
105 double ofFixGetHeight();
|
rt300@0
|
106 ofTouchEventArgs transformTouchCoords(ofTouchEventArgs &point);
|
rt300@0
|
107 ofLight light;
|
rt300@14
|
108 UIProps* props;
|
rt300@0
|
109 void lostFocus();
|
rt300@0
|
110 void gotFocus();
|
rt300@0
|
111 void gotMemoryWarning();
|
rt300@0
|
112 void deviceOrientationChanged(int newOrientation);
|
rt300@0
|
113
|
rt300@0
|
114 // ofxOscSender sender;
|
rt300@0
|
115 // void sendOSCParams();
|
rt300@0
|
116
|
rt300@0
|
117 void showQuestionnaire();
|
rt300@0
|
118 void questionnaireHidden(vector<int> answers, const char* userComments);
|
rt300@0
|
119
|
rt300@0
|
120 void showIntro();
|
rt300@20
|
121 void introHidden(int mode);
|
rt300@2
|
122 void usernameEntered();
|
rt300@9
|
123 void startTheSearchTests();
|
rt300@9
|
124 void startTheTrainingTests();
|
rt300@16
|
125 void startTheExpTests();
|
rt300@32
|
126 void startThePerformanceTests();
|
rt300@45
|
127 void startTheTrainingDemo();
|
rt300@0
|
128 void showHelp();
|
rt300@0
|
129 void helpHidden();
|
rt300@0
|
130 void setupNewUser();
|
rt300@0
|
131 void appModeChange(interfaceType mode);
|
rt300@27
|
132 void interfaceSelected(int interfaceSelection);
|
rt300@0
|
133 void sendParametersToPD();
|
rt300@0
|
134
|
rt300@0
|
135 void sendMidiParams();
|
rt300@0
|
136 void sendMidiParam(int which);
|
rt300@0
|
137
|
rt300@0
|
138 // audio callbacks
|
rt300@0
|
139 float * wavetableNew;
|
rt300@0
|
140 int bufSize;
|
rt300@0
|
141 void drawWaveform();
|
rt300@0
|
142 void drawScore();
|
rt300@0
|
143 void audioReceived(float * input, int bufferSize, int nChannels);
|
rt300@0
|
144 void audioRequested(float * output, int bufferSize, int nChannels);
|
rt300@0
|
145
|
rt300@0
|
146 AppCore core;
|
rt300@0
|
147
|
rt300@0
|
148 // message
|
rt300@0
|
149 void addMessage(string msg);
|
rt300@0
|
150
|
rt300@0
|
151 // midi message callback
|
rt300@0
|
152 void newMidiMessage(ofxMidiMessage& msg);
|
rt300@0
|
153
|
rt300@0
|
154 // midi device (dis)connection event callbacks
|
rt300@0
|
155 void midiInputAdded(string name, bool isNetwork);
|
rt300@0
|
156 void midiInputRemoved(string name, bool isNetwork);
|
rt300@0
|
157
|
rt300@0
|
158 void midiOutputAdded(string nam, bool isNetwork);
|
rt300@0
|
159 void midiOutputRemoved(string name, bool isNetwork);
|
rt300@38
|
160 void mapButtonToAction(UIElement* control, int mappingID);
|
rt300@38
|
161 void buttonPressCallback(int mappingID, int value);
|
rt300@0
|
162
|
rt300@0
|
163 vector<ofxMidiIn*> inputs;
|
rt300@0
|
164 vector<ofxMidiOut*> outputs;
|
rt300@0
|
165
|
rt300@0
|
166 deque<string> messages;
|
rt300@0
|
167 int maxMessages;
|
rt300@0
|
168
|
rt300@0
|
169 int note, ctl;
|
rt300@0
|
170 vector<unsigned char> bytes;
|
rt300@0
|
171
|
rt300@0
|
172 // in the h file:
|
rt300@0
|
173 ofTrueTypeFont myfont;
|
rt300@0
|
174
|
rt300@0
|
175 void windowResized(int w, int h){};
|
rt300@0
|
176
|
rt300@0
|
177 void rotateToPortrait(){};
|
rt300@0
|
178 void rotateToPortraitUpSideDown(){};
|
rt300@0
|
179 void rotateToLandscapeLeft(){};
|
rt300@0
|
180 void rotateToLandscapeRight(){};
|
rt300@0
|
181 void toggleAutoRotation(){};
|
rt300@16
|
182
|
rt300@27
|
183 controlPanelType whichInterfaceAreWeUsing;
|
rt300@45
|
184 int screenWidth, screenHeight;
|
rt300@50
|
185
|
rt300@50
|
186 string midiPorts;
|
rt300@0
|
187 };
|
rt300@0
|
188
|
rt300@0
|
189 // should be off split into
|
rt300@0
|
190 // GUI controller
|
rt300@0
|
191 // parameter converter
|
rt300@0
|
192 // MIDI stuff(?)
|
rt300@0
|
193
|
rt300@0
|
194
|