view src/testApp.h @ 55:2eca10a31ae2

improving printing of information, looking at how tempo is modelled
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 10 Dec 2012 17:07:21 +0000
parents 0d66ecd1f4d3
children 4394c9490716
line wrap: on
line source
#ifndef _TEST_APP
#define _TEST_APP


#include "ofMain.h"
#include "sndfile.h"
#include "ofxFileDialogOSX.h"
#include "LoadedAudioHolder.h"
//#include "ofxSoundFileLoader.h"
#include "AudioEventMatcher.h"

#include "LoadedAudioHolder.h"

#include "OutputDataWriter.h"

#include "ofxOsc.h"
#define PORT 10874


//note the dependency on sndfile (libsndfile library needs to be accessible)
//also the file dialogue addon

//main commands:
//O: open a new file
//see the key pressed function for other bits - e.g. can view spectral difference

//TO DO
//Move all the soundfile stuff to the ofxSoundFileLoader
//can hold the player, the audio samples and the onset class there

//length in terms of frames (at 512 samples per frame - there are 90 per second) => 900: 10 seconds

class testApp : public ofBaseApp{

	public:


		void setup();
		void update();
		void draw();

		void keyPressed  (int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);

		void audioRequested 	(float * input, int bufferSize, int nChannels);

	//void loadTestAudio();
	
	void checkForOSCmessages();
	
	bool getFilenameFromDialogBox(string* fileNameToSave);
	void openNewAudioFileWithdialogBox();		
	void loadNewAudio(string soundFileName);


	AudioEventMatcher eventMatcher;


	
	ofxOscReceiver	receiver;
	
	
//live audio input	
		float 	pan;
		int		sampleRate;
		bool 	bNoise;
		float 	volume;
		float 	* lAudio;
		float   * rAudio;

	OutputDataWriter outputWriter;
	
	bool writeKickEvents;
};

#endif