annotate testApp.h @ 8:e2c6cfe8c6b7

JSON logs and presets.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Thu, 10 Jan 2013 18:24:26 +0000
parents 34eba1046890
children fb2ef16dd013
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@8 20 #import "iViewController.h"
rt300@8 21
rt300@0 22 #define HOST "169.254.1.1"
rt300@0 23 #define PORT 12345
rt300@0 24
rt300@0 25 class testApp : public ofxiPhoneApp {
rt300@0 26
rt300@3 27
rt300@3 28 public:
rt300@0 29
rt300@3 30
rt300@0 31 int prevTouchX;
rt300@0 32 int prevTouchY;
rt300@0 33 double prevDist;
rt300@8 34
rt300@0 35 // not many so dont bother with vectors/arrays?
rt300@0 36 TwoVector touch0;
rt300@0 37 TwoVector touch1;
rt300@0 38 TwoVector prevTouch0;
rt300@0 39 TwoVector prevTouch1;
rt300@5 40
rt300@0 41 bool xLocked, yLocked;
rt300@6 42 unsigned int lastMoveTime;
rt300@0 43
rt300@0 44 TwoVector moveVel; // velocity at which we were moving the grid
rt300@0 45
rt300@0 46 vector <ofxUISlider *> sliders;
rt300@0 47
rt300@0 48 double slowFactor;
rt300@0 49 double zoomVel; // do the same
rt300@0 50 double prevZoom, prevZoom2;
rt300@5 51 TwoVector move, prevMove, prevMove2;
rt300@0 52
rt300@0 53 vector<int> sliderVals;
rt300@3 54 vector<int> freqIndexes;
rt300@0 55
rt300@0 56 int numActiveTouches;
rt300@0 57
rt300@0 58 ofxiPhoneKeyboard * keyboard;
rt300@0 59 //
rt300@0 60
rt300@0 61 void setup();
rt300@0 62 void update();
rt300@0 63 void draw();
rt300@0 64 void exit();
rt300@0 65
rt300@0 66 void touchDown(ofTouchEventArgs &touch);
rt300@0 67 void touchMoved(ofTouchEventArgs &touch);
rt300@0 68 void touchUp(ofTouchEventArgs &touch);
rt300@0 69 void touchDoubleTap(ofTouchEventArgs &touch);
rt300@0 70 void touchCancelled(ofTouchEventArgs &touch);
rt300@0 71
rt300@1 72 void handleScroll();
rt300@1 73 void handleZoom();
rt300@1 74
rt300@0 75 vector<float> vectorFilter(vector<float> newVec);
rt300@0 76
rt300@0 77 void lostFocus();
rt300@0 78 void gotFocus();
rt300@0 79 void gotMemoryWarning();
rt300@0 80 void deviceOrientationChanged(int newOrientation);
rt300@0 81
rt300@0 82 ofxOscSender sender;
rt300@0 83 void sendOSCParams();
rt300@0 84
rt300@0 85 // stardard GUI - knbs and sliders - hides zoomer
rt300@0 86 bool standardGUIShowing;
rt300@0 87 void standardGUIEvent(ofxUIEventArgs &e);
rt300@0 88 void setupStandardGui();
rt300@0 89 ofxUICanvas *standardGUI;
rt300@0 90
rt300@0 91 // zoom gui - the swap view button and save preset button
rt300@0 92 void zoomGUIEvent(ofxUIEventArgs &e);
rt300@0 93 void setupZoomGui();
rt300@0 94
rt300@3 95 void sliderMoved(int which, float value);
rt300@3 96 void setAllGUISliders(vector<int> vals);
rt300@3 97 void sendParametersToPD();
rt300@3 98 void sendOscShape(int ctrlin);
rt300@3 99 void sendFiltShape(int ctrlin);
rt300@3 100 void sendFiltType(int ctrlin);
rt300@3 101 void sendFiltFreq(int ctrlin);
rt300@3 102 void sendEnvShape(int ctrlin);
rt300@3 103 void sendModFreq(int ctrlin);
rt300@0 104
rt300@0 105 ofxUICanvas *zoomGUI;
rt300@0 106
rt300@2 107 // audio callbacks
rt300@2 108 void audioReceived(float * input, int bufferSize, int nChannels);
rt300@2 109 void audioRequested(float * output, int bufferSize, int nChannels);
rt300@2 110
rt300@2 111 AppCore core;
rt300@2 112
rt300@0 113 };
rt300@0 114