From 643442a18323f563f75c20f32ef3488f68b74570 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 20 Dec 2011 14:32:48 +0000 Subject: initial show version --- src/testApp.h | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 src/testApp.h (limited to 'src/testApp.h') diff --git a/src/testApp.h b/src/testApp.h new file mode 100644 index 0000000..43540c6 --- /dev/null +++ b/src/testApp.h @@ -0,0 +1,158 @@ +#ifndef _TEST_APP +#define _TEST_APP + +#include "ofMain.h" +#include "fft.h" +#include "FFTOctaveAnalyzer.h" + +#define BUFFER_SIZE 1024 +#define BUFFER_FRAMES 512 + +/* +ok seriously lets make this good + +recording - storage for a bunch of fft + +average them on the fly? seems likely + +*/ + +#define OF_ADDON_USING_OFXMIDIIN + +#include "ofxMidi.h" + +#define FFT_AVG 1 +#define FFT_RAW 2 +#define WAVEFORM 3 + +#define PICTURE 1 +#define GRABBER 2 + + +class testApp : public ofBaseApp, public ofxMidiListener{ + + public: + + void setup(); + void update(); + void draw(); + + void keyPressed (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 audioIn(float * input, int bufferSize, int nChannels); + + FFTOctaveAnalyzer lFFTanalyzer; + FFTOctaveAnalyzer rFFTanalyzer; + + ofxMidiIn midiIn; + ofxMidiOut midiOut; + void newMidiMessage(ofxMidiEventArgs& eventArgs); + + void setMidiState(); + + + private: + + float * left; + float * right; + int bufferCounter; + fft myfft; + + float FFTbuffer[2][BUFFER_SIZE][BUFFER_FRAMES]; + + int thisFFTbuffer; + + float lmagnitude[BUFFER_SIZE]; + float lphase[BUFFER_SIZE]; + float lpower[BUFFER_SIZE]; + float lfreq[BUFFER_SIZE/2]; + + float rmagnitude[BUFFER_SIZE]; + float rphase[BUFFER_SIZE]; + float rpower[BUFFER_SIZE]; + float rfreq[BUFFER_SIZE/2]; + + ofSoundStream soundStream; + + ofImage fbImage; + + //ofImage blendImage; + + ofVideoPlayer blendImage; + + ofFbo renderImage; + ofShader maskShader; + + bool showFPS; + + ofImage testImage; + + //controllable variables + float F_scale; + float F_drawFrames; + float F_drawStep; + + float F_drawDecay; + float F_lineWidth; + float F_drawAxis; + + float F_xRotation; + float F_yRotation; + float F_zRotation; + + float F_xRotate; + float F_yRotate; + float F_zRotate; + + float lastFrameTime; + + bool draworder; + bool B_vSync; + bool B_fill; + + int visMode; + int inputMode; + + int I_fade1; + int I_fade2; + + int I_movieSource; + int I_moviePlaying; + + bool B_glitch; + + + + ofVideoGrabber grabber; + + unsigned char *gammamap; + unsigned char *line1; + unsigned char *line2; + unsigned char *outBuffer; + + int camWidth,camHeight; + + float whitePt; + float blackPt; + float gamma; + + bool field2; //flag that there is a 2nd field waiting to be processed + bool use2fields; + int frameTime,grabTime; //keep track of field timing + + + bool deInterlace; + ofTexture outTexture; + + float F_movieSpeed; + + + ofImage blanker; +}; + +#endif + -- cgit v1.2.3