summaryrefslogtreecommitdiff
path: root/le_new/src/ofApp.h
diff options
context:
space:
mode:
Diffstat (limited to 'le_new/src/ofApp.h')
-rw-r--r--le_new/src/ofApp.h198
1 files changed, 198 insertions, 0 deletions
diff --git a/le_new/src/ofApp.h b/le_new/src/ofApp.h
new file mode 100644
index 0000000..fc07f9b
--- /dev/null
+++ b/le_new/src/ofApp.h
@@ -0,0 +1,198 @@
+#pragma once
+
+#include "ofMain.h"
+#include "ofxXmlSettings.h"
+#include "ofxFensterManager.h"
+
+#define OF_ADDON_USING_OFXMIDIIN
+#include "ofxMidi.h"
+
+#include "ofxGui.h"
+#include "viewport.h"
+
+//converting to new fenster
+//
+
+class previewWindow;
+class guiWindow;
+
+class ofApp : public ofxMidiListener{
+
+ public:
+
+ void setup();
+ void update();
+ void draw();
+
+ void keyPressed(int key, ofxFenster* win);
+ 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 gotMessage(ofMessage msg);
+ void dragEvent(ofDragInfo dragInfo);
+ void dragEvent(ofDragInfo dragInfo,ofxFenster* win);
+
+ void mousePressedEvent(ofMouseEventArgs &args);
+ void keyPressedEvent(ofKeyEventArgs &args);
+ void windowEvent(ofResizeEventArgs &args);
+
+ void nmidiMessage(int event,int data1, int data2);
+
+ void makeColours();
+
+ void toggleFPS();
+ bool showFPS;
+
+ ofxXmlSettings XML;
+
+ unsigned char* controllers;
+ int note, mode;
+
+ //to be moved into svg object gui
+
+ bool debug;
+
+ bool fullscreenoutput;
+
+ float lastnoteTime;
+
+ int fadetime;
+ int rotate;
+ float scale,fscale;
+
+ int xshift,yshift;
+
+ ofColor* controller_colours;
+
+ float colShift;
+
+ viewport vp1,vp2;
+ vector<viewport*> viewports;
+
+ previewWindow *prevWin;
+ guiWindow *guiWin;
+
+ int midiChannel;
+
+ ofxMidiIn midiIn;
+
+ void newMidiMessage(ofxMidiMessage& eventArgs);
+
+ playlist list;
+
+
+ ofxPanel gui;
+ ofxToggle reverse;
+ ofxToggle reversemain;
+ ofxToggle controlColours;
+ ofxToggle noteRandomiseColours;
+ ofxToggle transparentBlack;
+ ofxButton resetDrawscale;
+ ofxButton resetFBscale;
+ ofxIntSlider fS;
+ ofxParameter<int> fadeScale;
+ ofxIntSlider fB;
+ ofxParameter<int> fadeBackground;
+ ofxFloatSlider dT;
+ ofxParameter<float> decayTime;
+ ofxToggle oscScale;
+ ofxToggle breakOsc;
+ ofxToggle randomOsc;
+ ofxFloatSlider sA;
+ ofxParameter<float> scaleAmplitude;
+ ofxFloatSlider sF;
+ ofxParameter<float> scaleFrequency;
+
+ float randOffs;
+
+ void resetDrawscalePressed(bool & pressed);
+ void resetFBscalePressed(bool & pressed);
+
+
+};
+
+
+class previewWindow: public ofxFenster{
+public:
+ ~previewWindow();
+ ofFbo *rb;
+ ofApp *parent;
+ void setParent(ofApp *p);
+ void setup();
+ void setBuffer(ofFbo *buffer);
+ void draw();
+ void keyPressed(int key, ofxFenster* win);
+};
+
+class guiWindow: public ofxFenster{
+public:
+ ~guiWindow();
+ ofApp *parent;
+ void setup();
+ void setParent(ofApp *p);
+ void draw();
+ void dragEvent(ofDragInfo dragInfo,ofxFenster* win);
+ void windowMoved(int x, int y);
+};
+
+/*
+class CustomWindow : public ofxFenster{
+public:
+ void setup(){
+ setWindowShape(1280, 720);
+ setWindowPosition(310, 0);
+ setWindowTitle("SECOND WINDOW");
+ }
+
+ void update(){
+ radius = sin(ofGetFrameNum()*.06)*100;
+ }
+
+ void draw(){
+ ofBackground(0);
+
+ ofNoFill();
+
+ ofSetColor(100);
+ ofLine(mouseX, 0, mouseX, getHeight());
+ ofLine(0, mouseY, getWidth(), mouseY);
+
+ ofSetColor(255);
+ ofCircle(getWidth()*.5, getHeight()*.5, radius);
+ }
+
+ void keyPressed(int key){
+ cout << "KEY PRESSED " << (char)key << endl;
+ }
+
+ void keyReleased(int key){
+ cout << "KEY RELEASED " << (char)key << endl;
+ }
+
+ float radius;
+};
+
+class ofApp : 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 dragEvent(ofDragInfo dragInfo);
+ void gotMessage(ofMessage msg);
+
+ CustomWindow window;
+};
+*/ \ No newline at end of file