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