andrew@0
|
1 #ifndef _TEST_APP
|
andrew@0
|
2 #define _TEST_APP
|
andrew@0
|
3
|
andrew@0
|
4
|
andrew@0
|
5 #include "ofMain.h"
|
andrew@0
|
6 #include "sndfile.h"
|
andrew@0
|
7 #include "ofxFileDialogOSX.h"
|
andrew@0
|
8 #include "LoadedAudioHolder.h"
|
andrew@0
|
9 //#include "ofxSoundFileLoader.h"
|
andrew@0
|
10 #include "AudioEventMatcher.h"
|
andrew@0
|
11
|
andrew@56
|
12 //#include "LoadedAudioHolder.h"
|
andrew@0
|
13
|
andrew@40
|
14 #include "OutputDataWriter.h"
|
andrew@40
|
15
|
andrew@0
|
16 #include "ofxOsc.h"
|
andrew@0
|
17 #define PORT 10874
|
andrew@0
|
18
|
andrew@0
|
19
|
andrew@0
|
20 //note the dependency on sndfile (libsndfile library needs to be accessible)
|
andrew@0
|
21 //also the file dialogue addon
|
andrew@0
|
22
|
andrew@0
|
23 //main commands:
|
andrew@0
|
24 //O: open a new file
|
andrew@0
|
25 //see the key pressed function for other bits - e.g. can view spectral difference
|
andrew@0
|
26
|
andrew@0
|
27 //TO DO
|
andrew@0
|
28 //Move all the soundfile stuff to the ofxSoundFileLoader
|
andrew@0
|
29 //can hold the player, the audio samples and the onset class there
|
andrew@0
|
30
|
andrew@0
|
31 //length in terms of frames (at 512 samples per frame - there are 90 per second) => 900: 10 seconds
|
andrew@0
|
32
|
andrew@0
|
33 class testApp : public ofBaseApp{
|
andrew@0
|
34
|
andrew@0
|
35 public:
|
andrew@0
|
36
|
andrew@0
|
37
|
andrew@0
|
38 void setup();
|
andrew@0
|
39 void update();
|
andrew@0
|
40 void draw();
|
andrew@0
|
41
|
andrew@0
|
42 void keyPressed (int key);
|
andrew@0
|
43 void keyReleased(int key);
|
andrew@0
|
44 void mouseMoved(int x, int y );
|
andrew@0
|
45 void mouseDragged(int x, int y, int button);
|
andrew@0
|
46 void mousePressed(int x, int y, int button);
|
andrew@0
|
47 void mouseReleased(int x, int y, int button);
|
andrew@0
|
48 void windowResized(int w, int h);
|
andrew@0
|
49
|
andrew@0
|
50 void audioRequested (float * input, int bufferSize, int nChannels);
|
andrew@0
|
51
|
andrew@1
|
52 //void loadTestAudio();
|
andrew@1
|
53
|
andrew@0
|
54 void checkForOSCmessages();
|
andrew@0
|
55
|
andrew@0
|
56 bool getFilenameFromDialogBox(string* fileNameToSave);
|
andrew@0
|
57 void openNewAudioFileWithdialogBox();
|
andrew@0
|
58 void loadNewAudio(string soundFileName);
|
andrew@1
|
59
|
andrew@0
|
60
|
andrew@0
|
61 AudioEventMatcher eventMatcher;
|
andrew@1
|
62
|
andrew@1
|
63
|
andrew@0
|
64
|
andrew@0
|
65 ofxOscReceiver receiver;
|
andrew@0
|
66
|
andrew@0
|
67
|
andrew@0
|
68 //live audio input
|
andrew@0
|
69 float pan;
|
andrew@0
|
70 int sampleRate;
|
andrew@0
|
71 bool bNoise;
|
andrew@0
|
72 float volume;
|
andrew@0
|
73 float * lAudio;
|
andrew@0
|
74 float * rAudio;
|
andrew@0
|
75
|
andrew@40
|
76 OutputDataWriter outputWriter;
|
andrew@40
|
77
|
andrew@55
|
78 bool writeKickEvents;
|
andrew@0
|
79 };
|
andrew@0
|
80
|
andrew@0
|
81 #endif
|