#include "ofApp.h" #include "glew.h" const ofPoint outputWindowSize=ofPoint(1200,900); //-------------------------------------------------------------- void ofApp::setup(){ midiIn.listInPorts(); //midiIn.openPort(1); //midiIn.addListener(this); //TODO make a midi chooser load_settings(); madlaser.setup("madlaser",995,510); ofSetFrameRate(60); } //====================== settings void ofApp::default_settings(){ //outputScale=1.0f; } void ofApp::save_settings(){ //XML.setValue("SCALE", outputScale); XML.saveFile("settings.xml"); cout << "settings.xml saved!" < output=svginput.getLines(); ofPushMatrix(); ofTranslate(695,5); ofSetColor(255); ofNoFill(); ofDrawRectangle(0,0,500,500); ofTranslate(250,250); ofScale(250.0f); for (auto poly:output){ poly.draw(); } ofPopMatrix(); madlaser.panel.draw(); madlaser.draw(output); } //-------------------------------------------------------------- void ofApp::exit() { } //-------------------------------------------------------------- void ofApp::keyPressed(ofKeyEventArgs &args){ if (args.key==OF_KEY_COMMAND){ //commandPressed=true; } switch(args.key){ case 'a':{ load_settings(); break; } case 'd':{ default_settings(); break; } case 's':{ save_settings(); break; } } } //-------------------------------------------------------------- void ofApp::keyReleased(ofKeyEventArgs &args){ if (args.key==OF_KEY_COMMAND){ //commandPressed=false; } } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseExited(int x, int y){ } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ string filename= *dragInfo.files.begin(); string extension= filename.substr(filename.find_last_of(".") + 1); if (extension == "svg") { svginput.load(filename); } else { ofLog()<<"cannot load "<