#ifndef _TEST_APP
#define _TEST_APP

#include "ofMain.h"
#include "ofAddons.h"

#include "movieScrubber.h"
#include "fft.h"

#define BUFFER_SIZE 256
#define NUM_WINDOWS 80

class testApp : public ofSimpleApp{

	public:

		testApp();
		void setup();
		void update();
		void exit();
		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();

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

    private:
        movieScrubber *movie;

        ofTrueTypeFont	franklinBook_big;
		ofTrueTypeFont	franklinBook;
		float * left;
		float * right;
		int 	bufferCounter;
		fft		myfft;

		float magnitude[BUFFER_SIZE];
		float phase[BUFFER_SIZE];
		float power[BUFFER_SIZE];

		float freq[NUM_WINDOWS][BUFFER_SIZE/2];
		float freq_phase[NUM_WINDOWS][BUFFER_SIZE/2];

		ofImage baby[16];
		ofImage line;

		int maxframe;
		int minframe;
		int frame;
};

#endif
