diff options
Diffstat (limited to 'lasertext/src/ofApp.cpp')
| -rw-r--r-- | lasertext/src/ofApp.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/lasertext/src/ofApp.cpp b/lasertext/src/ofApp.cpp index b0442bb..636aaa0 100644 --- a/lasertext/src/ofApp.cpp +++ b/lasertext/src/ofApp.cpp @@ -26,7 +26,8 @@ void ofApp::setup(){ //banner.loadFont("fonts/EMSDecorousScript.svg"); //2022 banner.loadFont("fonts/EMSQwandry.svg"); //2023 //banner.init("Everything Is Going To Be Alright"); - banner.init("No Pleasure is Too Guilty"); + //banner.init("No Pleasure is Too Guilty"); + banner.init("Éalú Le Grá"); override_banner.loadFont("fonts/EMSQwandry.svg"); @@ -103,6 +104,10 @@ void ofApp::setup(){ //stars.init(ofVec2f(2000.0f,2000.0f),100.0f,1.0,5.0,4.0,1.0); + // listen on the given port + ofLog() << "listening for osc messages on port " << PORT; + receiver.setup(PORT); + } //====================== settings @@ -173,6 +178,25 @@ void ofApp::update(){ stars1.update(); stars2.update(); + + // check for waiting messages + while(receiver.hasWaitingMessages()){ + + // get the next message + ofxOscMessage m; + receiver.getNextMessage(m); + + // check for mouse moved message + if(m.getAddress() == "/message"){ + + if(m.getArgType(0) == OFXOSC_TYPE_STRING){ + string msgString = m.getArgAsString(0); + override_banner.init(msgString); + ofLog()<<"OSC received message "<<msgString; + + } + } + } } //-------------------------------------------------------------- @@ -300,17 +324,18 @@ void ofApp::keyReleased(int key){ case OF_KEY_UP:{ currentFont=(currentFont+1)%fonts.size(); banner.loadFont(fonts.getPath(currentFont)); + override_banner.loadFont(fonts.getPath(currentFont)); break; } case OF_KEY_DOWN:{ currentFont--; if (currentFont<0) currentFont=fonts.size()-1; - banner.loadFont(fonts.getPath(currentFont)); + override_banner.loadFont(fonts.getPath(currentFont)); break; } case '1':{ ofLog()<<"sending test phrase 1"; - override_banner.init("This is my new phrase"); + override_banner.init("The latin quarter"); break; } case 's':{ |
