From 5a746fd8994e2601e14b8e186c25acd571685792 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 14 Sep 2023 21:11:07 +0100 Subject: osc options --- lasertext/addons.make | 3 ++- lasertext/src/ofApp.cpp | 31 ++++++++++++++++++++++++++++--- lasertext/src/ofApp.h | 7 +++++++ 3 files changed, 37 insertions(+), 4 deletions(-) (limited to 'lasertext') diff --git a/lasertext/addons.make b/lasertext/addons.make index aa9be02..638686e 100644 --- a/lasertext/addons.make +++ b/lasertext/addons.make @@ -1,4 +1,5 @@ ofxSvg ofxGui ofxXmlSettings -ofxHelios \ No newline at end of file +ofxHelios +ofxOsc 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 "<