diff options
| author | Tim Redfern <tim@getdrop.com> | 2023-04-17 20:35:00 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2023-04-17 20:35:00 +0100 |
| commit | 6bc87ce4acd393071a4c8a43499be7978528e3eb (patch) | |
| tree | c6d7385e8b74b290e66a97c241ed7e01d373c137 | |
| parent | 19be92e0aff674b95bdae72fe7a2e409fd1bf77a (diff) | |
making nextus panels
| -rw-r--r-- | nextus/src/ofApp.cpp | 13 | ||||
| -rw-r--r-- | nextus/src/ofApp.h | 22 |
2 files changed, 27 insertions, 8 deletions
diff --git a/nextus/src/ofApp.cpp b/nextus/src/ofApp.cpp index 0db8149..3ace079 100644 --- a/nextus/src/ofApp.cpp +++ b/nextus/src/ofApp.cpp @@ -7,11 +7,12 @@ const ofPoint outputWindowSize=ofPoint(1200,900); //-------------------------------------------------------------- void ofApp::setup(){ -/* midiIn.listInPorts(); - midiIn.openPort(0); - midiIn.addListener(this); -*/ + //midiIn.openPort(1); + //midiIn.addListener(this); + + //TODO make a midi chooser + load_settings(); ofSetFrameRate(60); @@ -151,7 +152,7 @@ void ofApp::dragEvent(ofDragInfo dragInfo){ string filename= *dragInfo.files.begin(); string extension= filename.substr(filename.find_last_of(".") + 1); if (extension == "svg") { - ofLog()<<"loading SVG "<<filename; + svginput.load(filename); } else { ofLog()<<"cannot load "<<filename; } @@ -160,7 +161,7 @@ void ofApp::dragEvent(ofDragInfo dragInfo){ void ofApp::newMidiMessage(ofxMidiMessage& msg) { //column 0 for general controls - //printf("Midi: %i %i %i\n",msg.channel,msg.control,msg.value); + printf("Midi: %i %i %i\n",msg.channel,msg.control,msg.value); int offset; diff --git a/nextus/src/ofApp.h b/nextus/src/ofApp.h index 839ad36..6312cfb 100644 --- a/nextus/src/ofApp.h +++ b/nextus/src/ofApp.h @@ -43,6 +43,20 @@ class vectorPanel { ofxPanel panel; }; +class svgPanel: public vectorPanel{ + public: + svgPanel( + string _title="", + ofVec2f _size=DISPLAYSIZE, + ofVec2f _pos=ofPoint(5,5) + ) : vectorPanel(_title,_size,_pos){} + void load(string filename){ + ofLog()<<"loading SVG "<<filename; + } + + private: +}; + class ofApp: public ofBaseApp, public ofxMidiListener { public: @@ -69,7 +83,11 @@ class ofApp: public ofBaseApp, public ofxMidiListener { void dragEvent(ofDragInfo dragInfo); void newMidiMessage(ofxMidiMessage& eventArgs); - + + //======================================= //MIDI + + ofxMidiIn midiIn; + ofxMidiMessage midiMessage; //======================================= //saving settings @@ -82,7 +100,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener { //======================================= //inputs vectorPanel networkinput; - vectorPanel svginput; + svgPanel svginput; vectorPanel textinput; }; |
