rt300@0: #pragma once rt300@0: rt300@0: #include "ofMain.h" rt300@0: rt300@0: //#include "ofxiPhone.h" rt300@0: //#include "ofxiPhoneExtras.h" rt300@0: // #include "ofxiPhoneExternalDisplay.h" rt300@0: rt300@0: #include "ofxiOS.h" rt300@0: #include "ofxiOSExtras.h" rt300@0: rt300@0: #include "ofxOsc.h" rt300@0: #include "ofxMidi.h" rt300@0: #include "2dvector.h" rt300@0: #include "AppCore.h" rt300@0: #include "eventLogger.h" rt300@0: #include "ofxPd.h" rt300@0: #include "json.h" rt300@0: #import "QuestionnaireViewController.h" rt300@0: #import "HelpViewController.h" rt300@0: #import "UsernameAlertViewController.h" rt300@0: #import "IntroViewController.h" rt300@0: #include "sliderPanel.h" rt300@0: #include "UIElement.h" rt300@0: #include "UIElementContainer.h" rt300@0: #include "buttron.h" rt300@0: #include "ButtronSlider.h" rt300@0: #include "buttronXY.h" rt300@0: #include "UIGrid.h" rt300@0: #include "MessageOrganiser.h" rt300@8: #include "SearchMessageOrganiser.h" rt300@8: #include "TrainingMessageOrganiser.h" rt300@16: #include "ExpMessageOrganiser.h" rt300@0: #include "timeController.h" rt300@0: #include rt300@0: #include "targetSymbol.h" rt300@0: #include "3Dbox.h" rt300@24: #include "6Dbox.h" rt300@0: #include "TextPanel.h" rt300@0: //#define OSC_HOST "169.254.1.1" rt300@0: //#define OSC_PORT 12345 rt300@0: rt300@0: #define SLIDER_GUI_WIDTH 256 rt300@0: #define SLIDER_HEIGHT 256 rt300@0: #define NUM_PARAMS 10 rt300@0: rt300@0: rt300@0: rt300@0: class testApp : public ofxiOSApp , public ofxMidiListener, public ofxMidiConnectionListener { rt300@0: rt300@0: rt300@0: public: rt300@7: rt300@9: testStages currentStage; rt300@9: rt300@0: ofTrueTypeFont verdBig; rt300@0: bool sendMIDIAndOSC; rt300@0: bool paused; rt300@0: rt300@0: int midiChannel; rt300@0: int midiOffset; rt300@0: double tx,ty; rt300@0: ofColor generalBackground; rt300@0: // rt300@0: void initialiseGUIs(); rt300@0: void initialiseVariables(); rt300@0: void initialiseMIDI(); rt300@0: void setupUIElements(); rt300@6: void setupExpressViewPanels(); rt300@6: void setupTrainingViewPanels(); rt300@6: void setupSearchViewPanels(); rt300@7: void setupSliderPanel(); rt300@0: void setup(); rt300@0: void update(); rt300@0: void draw(); rt300@0: void drawUIElements(); rt300@0: void exit(); rt300@38: void backToMainMenu(); rt300@0: HelpViewController *helpViewController; rt300@0: QuestionnaireViewController *questionnaireViewController; rt300@0: UsernameAlertViewController *usernameAlertViewController; rt300@0: IntroViewController * introViewController; rt300@0: rt300@8: SearchMessageOrganiser searchMessageOrganiser; rt300@8: TrainingMessageOrganiser trainingMessageOrganiser; rt300@16: ExpMessageOrganiser expMessageOrganiser; rt300@8: rt300@8: PDSynthWrapper targetSynth; rt300@8: PDSynthWrapper candidateSynth; rt300@9: rt300@0: //TimeController timeController; rt300@0: interfaceType whichInterfaceShowing, previousInterface; rt300@0: rt300@7: // various views rt300@0: vector UIElements; rt300@28: vector AnimatedUIElements; rt300@0: rt300@0: void touchToUIElements(int x, int y, touchType ttype, int tid); rt300@0: void touchDown(ofTouchEventArgs &touch); rt300@0: void touchMoved(ofTouchEventArgs &touch); rt300@0: void touchUp(ofTouchEventArgs &touch); rt300@0: void touchDoubleTap(ofTouchEventArgs &touch); rt300@0: void touchCancelled(ofTouchEventArgs &touch); rt300@0: double ofFixGetWidth(); rt300@0: double ofFixGetHeight(); rt300@0: ofTouchEventArgs transformTouchCoords(ofTouchEventArgs &point); rt300@0: ofLight light; rt300@14: UIProps* props; rt300@0: void lostFocus(); rt300@0: void gotFocus(); rt300@0: void gotMemoryWarning(); rt300@0: void deviceOrientationChanged(int newOrientation); rt300@0: rt300@0: // ofxOscSender sender; rt300@0: // void sendOSCParams(); rt300@0: rt300@0: void showQuestionnaire(); rt300@0: void questionnaireHidden(vector answers, const char* userComments); rt300@0: rt300@0: void showIntro(); rt300@20: void introHidden(int mode); rt300@2: void usernameEntered(); rt300@9: void startTheSearchTests(); rt300@9: void startTheTrainingTests(); rt300@16: void startTheExpTests(); rt300@32: void startThePerformanceTests(); rt300@45: void startTheTrainingDemo(); rt300@0: void showHelp(); rt300@0: void helpHidden(); rt300@0: void setupNewUser(); rt300@0: void appModeChange(interfaceType mode); rt300@27: void interfaceSelected(int interfaceSelection); rt300@0: void sendParametersToPD(); rt300@0: rt300@0: void sendMidiParams(); rt300@0: void sendMidiParam(int which); rt300@0: rt300@0: // audio callbacks rt300@0: float * wavetableNew; rt300@0: int bufSize; rt300@0: void drawWaveform(); rt300@0: void drawScore(); rt300@0: void audioReceived(float * input, int bufferSize, int nChannels); rt300@0: void audioRequested(float * output, int bufferSize, int nChannels); rt300@0: rt300@0: AppCore core; rt300@0: rt300@0: // message rt300@0: void addMessage(string msg); rt300@0: rt300@0: // midi message callback rt300@0: void newMidiMessage(ofxMidiMessage& msg); rt300@0: rt300@0: // midi device (dis)connection event callbacks rt300@0: void midiInputAdded(string name, bool isNetwork); rt300@0: void midiInputRemoved(string name, bool isNetwork); rt300@0: rt300@0: void midiOutputAdded(string nam, bool isNetwork); rt300@0: void midiOutputRemoved(string name, bool isNetwork); rt300@38: void mapButtonToAction(UIElement* control, int mappingID); rt300@38: void buttonPressCallback(int mappingID, int value); rt300@0: rt300@0: vector inputs; rt300@0: vector outputs; rt300@0: rt300@0: deque messages; rt300@0: int maxMessages; rt300@0: rt300@0: int note, ctl; rt300@0: vector bytes; rt300@0: rt300@0: // in the h file: rt300@0: ofTrueTypeFont myfont; rt300@0: rt300@0: void windowResized(int w, int h){}; rt300@0: rt300@0: void rotateToPortrait(){}; rt300@0: void rotateToPortraitUpSideDown(){}; rt300@0: void rotateToLandscapeLeft(){}; rt300@0: void rotateToLandscapeRight(){}; rt300@0: void toggleAutoRotation(){}; rt300@16: rt300@27: controlPanelType whichInterfaceAreWeUsing; rt300@45: int screenWidth, screenHeight; rt300@50: rt300@50: string midiPorts; rt300@0: }; rt300@0: rt300@0: // should be off split into rt300@0: // GUI controller rt300@0: // parameter converter rt300@0: // MIDI stuff(?) rt300@0: rt300@0: