annotate testApp.h @ 26:2e1fdac115af

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