annotate src/testApp.h @ 1:852173ca8365

Added class to hold recorded mulitracks
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 31 Jan 2012 17:35:30 +0000
parents c4f9e49226eb
children 0d66ecd1f4d3
rev   line source
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@1 50 //void loadTestAudio();
andrew@1 51
andrew@0 52 void checkForOSCmessages();
andrew@0 53
andrew@0 54 bool getFilenameFromDialogBox(string* fileNameToSave);
andrew@0 55 void openNewAudioFileWithdialogBox();
andrew@0 56 void loadNewAudio(string soundFileName);
andrew@1 57
andrew@0 58
andrew@0 59 AudioEventMatcher eventMatcher;
andrew@1 60
andrew@1 61
andrew@0 62
andrew@0 63 ofxOscReceiver receiver;
andrew@0 64
andrew@0 65
andrew@0 66 //live audio input
andrew@0 67 float pan;
andrew@0 68 int sampleRate;
andrew@0 69 bool bNoise;
andrew@0 70 float volume;
andrew@0 71 float * lAudio;
andrew@0 72 float * rAudio;
andrew@0 73
andrew@0 74
andrew@0 75 };
andrew@0 76
andrew@0 77 #endif