andrew@0: #ifndef _TEST_APP andrew@0: #define _TEST_APP andrew@0: andrew@0: andrew@0: #include "ofMain.h" andrew@0: #include "sndfile.h" andrew@0: #include "ofxFileDialogOSX.h" andrew@0: #include "LoadedAudioHolder.h" andrew@0: //#include "ofxSoundFileLoader.h" andrew@0: #include "AudioEventMatcher.h" andrew@0: andrew@56: //#include "LoadedAudioHolder.h" andrew@0: andrew@40: #include "OutputDataWriter.h" andrew@40: andrew@0: #include "ofxOsc.h" andrew@0: #define PORT 10874 andrew@0: andrew@0: andrew@0: //note the dependency on sndfile (libsndfile library needs to be accessible) andrew@0: //also the file dialogue addon andrew@0: andrew@0: //main commands: andrew@0: //O: open a new file andrew@0: //see the key pressed function for other bits - e.g. can view spectral difference andrew@0: andrew@0: //TO DO andrew@0: //Move all the soundfile stuff to the ofxSoundFileLoader andrew@0: //can hold the player, the audio samples and the onset class there andrew@0: andrew@0: //length in terms of frames (at 512 samples per frame - there are 90 per second) => 900: 10 seconds andrew@0: andrew@0: class testApp : public ofBaseApp{ andrew@0: andrew@0: public: andrew@0: andrew@0: andrew@0: void setup(); andrew@0: void update(); andrew@0: void draw(); andrew@0: andrew@0: void keyPressed (int key); andrew@0: void keyReleased(int key); andrew@0: void mouseMoved(int x, int y ); andrew@0: void mouseDragged(int x, int y, int button); andrew@0: void mousePressed(int x, int y, int button); andrew@0: void mouseReleased(int x, int y, int button); andrew@0: void windowResized(int w, int h); andrew@0: andrew@0: void audioRequested (float * input, int bufferSize, int nChannels); andrew@0: andrew@1: //void loadTestAudio(); andrew@1: andrew@0: void checkForOSCmessages(); andrew@0: andrew@0: bool getFilenameFromDialogBox(string* fileNameToSave); andrew@0: void openNewAudioFileWithdialogBox(); andrew@0: void loadNewAudio(string soundFileName); andrew@1: andrew@0: andrew@0: AudioEventMatcher eventMatcher; andrew@1: andrew@1: andrew@0: andrew@0: ofxOscReceiver receiver; andrew@0: andrew@0: andrew@0: //live audio input andrew@0: float pan; andrew@0: int sampleRate; andrew@0: bool bNoise; andrew@0: float volume; andrew@0: float * lAudio; andrew@0: float * rAudio; andrew@0: andrew@40: OutputDataWriter outputWriter; andrew@40: andrew@55: bool writeKickEvents; andrew@0: }; andrew@0: andrew@0: #endif