annotate testApp.h @ 25:f42a00e3f22d

Logs condensed slightly. Questionnaire button enable. double precision location!!!
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 01 Feb 2013 17:39:19 +0000
parents a4908ad8c78e
children 2e1fdac115af
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@0 41 int prevTouchX;
rt300@0 42 int prevTouchY;
rt300@0 43 double prevDist;
rt300@16 44 bool paused;
rt300@0 45 // not many so dont bother with vectors/arrays?
rt300@0 46 TwoVector touch0;
rt300@0 47 TwoVector touch1;
rt300@0 48 TwoVector prevTouch0;
rt300@0 49 TwoVector prevTouch1;
rt300@5 50
rt300@0 51 bool xLocked, yLocked;
rt300@6 52 unsigned int lastMoveTime;
rt300@0 53
rt300@0 54 TwoVector moveVel; // velocity at which we were moving the grid
rt300@0 55
rt300@0 56 vector <ofxUISlider *> sliders;
rt300@0 57
rt300@0 58 double slowFactor;
rt300@0 59 double zoomVel; // do the same
rt300@0 60 double prevZoom, prevZoom2;
rt300@5 61 TwoVector move, prevMove, prevMove2;
rt300@0 62
rt300@0 63 vector<int> sliderVals;
rt300@3 64 vector<int> freqIndexes;
rt300@0 65
rt300@0 66 int numActiveTouches;
rt300@0 67
rt300@16 68 QuestionnaireViewController * questionnaireViewController;
rt300@24 69 IntroViewController * introViewController;
rt300@24 70 TopButtonViewController * topButtonViewController;
rt300@25 71 SliderViewController * sliderViewController;
rt300@0 72 //
rt300@0 73
rt300@16 74 void setup();
rt300@16 75 void update();
rt300@16 76 void draw();
rt300@16 77 void exit();
rt300@16 78
rt300@16 79 float getWidth();
rt300@16 80 float getHeight();
rt300@16 81
rt300@16 82 void touchDown(ofTouchEventArgs &touch);
rt300@16 83 void touchMoved(ofTouchEventArgs &touch);
rt300@16 84 void touchUp(ofTouchEventArgs &touch);
rt300@16 85 void touchDoubleTap(ofTouchEventArgs &touch);
rt300@16 86 void touchCancelled(ofTouchEventArgs &touch);
rt300@0 87
rt300@1 88 void handleScroll();
rt300@1 89 void handleZoom();
rt300@1 90
rt300@0 91 vector<float> vectorFilter(vector<float> newVec);
rt300@16 92
rt300@16 93 void lostFocus();
rt300@16 94 void gotFocus();
rt300@16 95 void gotMemoryWarning();
rt300@16 96 void deviceOrientationChanged(int newOrientation);
rt300@16 97
rt300@16 98 ofxOscSender sender;
rt300@0 99 void sendOSCParams();
rt300@0 100
rt300@24 101 void lockSynthPressed(bool locked);
rt300@24 102 void lockSequencerPressed(bool locked);
rt300@24 103
rt300@16 104 void showQuestionnaire();
rt300@22 105 void questionnaireHidden(vector<int> answers);
rt300@24 106 void showIntro();
rt300@24 107 void introHidden(bool OK);
rt300@24 108 void interfaceSelected(int which);
rt300@24 109 void seqStartStop(bool go);
rt300@24 110
rt300@24 111 void setupBottomGui();
rt300@24 112 void bottomGuiEvent();
rt300@24 113 void setupTopGui();
rt300@24 114 void topGuiEvent();
rt300@16 115
rt300@0 116 // stardard GUI - knbs and sliders - hides zoomer
rt300@24 117 void sliderGUIEvent(ofxUIEventArgs &e);
rt300@24 118 void setupSliderGui();
rt300@24 119 ofxUICanvas *sliderGUI;
rt300@24 120
rt300@22 121 void sliderMoved(int which, float value);
rt300@22 122 void setAllGUISliders(vector<int> vals);
rt300@25 123 void randomise();
rt300@0 124
rt300@0 125 // zoom gui - the swap view button and save preset button
rt300@0 126 void zoomGUIEvent(ofxUIEventArgs &e);
rt300@0 127 void setupZoomGui();
rt300@0 128
rt300@22 129
rt300@3 130 void sendParametersToPD();
rt300@3 131 void sendOscShape(int ctrlin);
rt300@3 132 void sendFiltShape(int ctrlin);
rt300@3 133 void sendFiltType(int ctrlin);
rt300@3 134 void sendFiltFreq(int ctrlin);
rt300@3 135 void sendEnvShape(int ctrlin);
rt300@3 136 void sendModFreq(int ctrlin);
rt300@0 137
rt300@0 138 ofxUICanvas *zoomGUI;
rt300@0 139
rt300@2 140 // audio callbacks
rt300@2 141 void audioReceived(float * input, int bufferSize, int nChannels);
rt300@2 142 void audioRequested(float * output, int bufferSize, int nChannels);
rt300@2 143
rt300@2 144 AppCore core;
rt300@2 145
rt300@0 146 };
rt300@0 147
rt300@22 148 // should be off split into
rt300@22 149 // GUI controller
rt300@22 150 // parameter converter
rt300@22 151 //