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