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