Mercurial > hg > soniczoomios
view testApp.h @ 33:92dba082d957
Added trail and EVALUATION_POINT event type.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 26 Mar 2013 18:41:42 +0000 |
parents | ab7c86d0f3d8 |
children | a42903c61558 |
line wrap: on
line source
#pragma once #include "ofMain.h" #include "ofxiPhone.h" #include "ofxiPhoneExtras.h" #include "ofxiPhoneExternalDisplay.h" #include "ofxOsc.h" #include "grid.h" #include "2dvector.h" #include "ofxUI.h" #include "eventLogger.h" #include "AppCore.h" #include "presetManager.h" #include "eventLogger.h" #include "ofxPd.h" #include "frequencer.h" #include "json.h" #import "QuestionnaireViewController.h" #import "BottomTabViewController.h" #import "IntroViewController.h" #import "HelpViewController.h" #import "TopButtonViewController.h" #import "SliderViewController.h" #import "usernameAlertViewController.h" #import "TimedSessionController.h" #define OSC_HOST "169.254.1.1" #define OSC_PORT 12345 typedef enum {SLIDERS,ZOOMER,BOTH,INTRO,QUESTIONNAIRE, HELP}interfaceType; class testApp : public ofxiPhoneApp , public ofxiPhoneExternalDisplay{ public: interfaceType whichInterfaceShowing; BottomTabViewController *bottomTabViewController; UsernameAlertViewController *usernameAlertViewController; HelpViewController *helpViewController; QuestionnaireViewController * questionnaireViewController; IntroViewController * introViewController; TopButtonViewController * topButtonViewController; SliderViewController * sliderViewController; TimedSessionController * tsc; int prevTouchX; int prevTouchY; double prevDist; bool paused; // not many so dont bother with vectors/arrays? TwoVector touch0; TwoVector touch1; TwoVector prevTouch0; TwoVector prevTouch1; bool xLocked, yLocked; unsigned int lastMoveTime; TwoVector moveVel; // velocity at which we were moving the grid vector <ofxUISlider *> sliders; double slowFactor; double zoomVel; // do the same double prevZoom, prevZoom2; TwoVector move, prevMove, prevMove2; vector<int> sliderVals; vector<int> freqIndexes; int numActiveTouches; bool preventingMovePostScroll; // void setup(); void update(); void draw(); void exit(); float getWidth(); float getHeight(); void touchDown(ofTouchEventArgs &touch); void touchMoved(ofTouchEventArgs &touch); void touchUp(ofTouchEventArgs &touch); void touchDoubleTap(ofTouchEventArgs &touch); void touchCancelled(ofTouchEventArgs &touch); void handleScroll(); void handleZoom(); vector<float> vectorFilter(vector<float> newVec); void lostFocus(); void gotFocus(); void gotMemoryWarning(); void deviceOrientationChanged(int newOrientation); ofxOscSender sender; void sendOSCParams(); void setupNewUser(); void lockSynthPressed(bool locked); void lockSequencerPressed(bool locked); void showQuestionnaire(); void questionnaireHidden(vector<int> answers, const char* userComments); void showIntro(); void introHidden(bool OK); void interfaceSelected(int which); void seqStartStop(bool go); void showHelp(); void helpHidden(); // shortcut function for testing void justStart(); void setupBottomGui(); void bottomGuiEvent(); void setupTopGui(); void topGuiEvent(); // stardard GUI - knbs and sliders - hides zoomer void sliderGUIEvent(ofxUIEventArgs &e); void setupSliderGui(); ofxUICanvas *sliderGUI; void sliderMoved(int which, float value); void setAllGUISliders(vector<int> vals); void randomise(); // zoom gui - the swap view button and save preset button void zoomGUIEvent(ofxUIEventArgs &e); void setupZoomGui(); void sendParametersToPD(); void sendOscShape(int ctrlin); void sendFiltShape(int ctrlin); void sendFiltType(int ctrlin); void sendFiltFreq(int ctrlin); void sendEnvShape(int ctrlin); void sendModFreq(int ctrlin); ofxUICanvas *zoomGUI; // audio callbacks void audioReceived(float * input, int bufferSize, int nChannels); void audioRequested(float * output, int bufferSize, int nChannels); AppCore core; }; // should be off split into // GUI controller // parameter converter //