Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added first draft of OSC messaging

  • Loading branch information...
commit dd39ff27dc692f613d72419f85d2a32efa9d933e 1 parent 99a218d
@hvfrancesco authored
View
1  addons.make
@@ -4,3 +4,4 @@ ofxNetwork
ofxMostPixelsEver
ofxMSAInteractiveObject
ofxSimpleGuiToo
+ofxOsc
View
148 lpmt.cbp
@@ -6,13 +6,13 @@
<Option makefile_is_custom="1"/>
<Option pch_mode="2"/>
<Option compiler="gcc"/>
- <Option virtualFolders="addons/;src/;"/>
+ <Option virtualFolders="addons/;src/;build config/;"/>
<Build>
<Target title="Debug">
<Option output="bin/$(PROJECT_NAME)_debug" prefix_auto="1" extension_auto="1"/>
<Option working_dir="bin"/>
<Option object_output="obj/Debug/"/>
- <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux/libopenFrameworksDebug.a;"/>
+ <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a;"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Option projectLinkerOptionsRelation="2"/>
@@ -21,12 +21,15 @@
<Option output="bin/$(PROJECT_NAME)" prefix_auto="1" extension_auto="1"/>
<Option working_dir="bin"/>
<Option object_output="obj/Release/"/>
- <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux/libopenFrameworks.a;"/>
+ <Option external_deps="../../../libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a;"/>
<Option type="1"/>
<Option compiler="gcc"/>
<Option projectLinkerOptionsRelation="2"/>
</Target>
</Build>
+ <Unit filename="config.make">
+ <Option virtualFolder="build config"/>
+ </Unit>
<Unit filename="src/main.cpp">
<Option virtualFolder="src/"/>
</Unit>
@@ -36,81 +39,78 @@
<Unit filename="src/testApp.h">
<Option virtualFolder="src/"/>
</Unit>
- <Unit filename="config.make">
- <Option virtualFolder="build config"/>
- </Unit>
<Extensions>
<code_completion/>
<envvars/>
<debugger/>
</Extensions>
- <Unit filename="src/ball.h">
+ <Unit filename="src/quad.h">
<Option virtualFolder="src"/>
</Unit>
- <Unit filename="src/quad.cpp">
+ <Unit filename="src/ball.h">
<Option virtualFolder="src"/>
</Unit>
- <Unit filename="src/quad.h">
+ <Unit filename="src/quad.cpp">
<Option virtualFolder="src"/>
</Unit>
- <Unit filename="../../../addons/ofxXmlSettings/src/ofxXmlSettings.cpp">
+ <Unit filename="../../../addons/ofxXmlSettings/src/ofxXmlSettings.h">
<Option virtualFolder="addons/ofxXmlSettings/src"/>
</Unit>
- <Unit filename="../../../addons/ofxXmlSettings/src/ofxXmlSettings.h">
+ <Unit filename="../../../addons/ofxXmlSettings/src/ofxXmlSettings.cpp">
<Option virtualFolder="addons/ofxXmlSettings/src"/>
</Unit>
<Unit filename="../../../addons/ofxThread/src/ofxThread.h">
<Option virtualFolder="addons/ofxThread/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxNetwork.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPClient.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxNetworkUtils.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxNetwork.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPClient.cpp">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxUDPManager.cpp">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPClient.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxNetworkUtils.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPManager.cpp">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPServer.cpp">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPManager.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPManager.cpp">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPServer.cpp">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPClient.cpp">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxTCPServer.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPManager.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxUDPManager.cpp">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxUDPManager.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxNetwork/src/ofxUDPManager.h">
+ <Unit filename="../../../addons/ofxNetwork/src/ofxTCPServer.h">
<Option virtualFolder="addons/ofxNetwork/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeClientTCP.cpp">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeServerTCP.cpp">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeClientTCP.h">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/ofxMostPixelsEver.h">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeEvents.cpp">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeEvents.h">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeEvents.h">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeServerTCP.h">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeServerTCP.cpp">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeClientTCP.h">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeServerTCP.h">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeClientTCP.cpp">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
- <Unit filename="../../../addons/ofxMostPixelsEver/src/ofxMostPixelsEver.h">
+ <Unit filename="../../../addons/ofxMostPixelsEver/src/mpeEvents.cpp">
<Option virtualFolder="addons/ofxMostPixelsEver/src"/>
</Unit>
<Unit filename="../../../addons/ofxMSAInteractiveObject/src/ofxMSAInteractiveObject.cpp">
@@ -119,107 +119,137 @@
<Unit filename="../../../addons/ofxMSAInteractiveObject/src/ofxMSAInteractiveObject.h">
<Option virtualFolder="addons/ofxMSAInteractiveObject/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiConfig.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiIncludes.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiConfig.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiConfig.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiControl.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiPage.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiControl.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiValueControl.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiIncludes.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiValueControl.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiPage.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiControl.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiPage.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiPage.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiToo.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiConfig.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
<Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiToo.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiValueControl.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiToo.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiValueControl.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/ofxSimpleGuiControl.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiButton.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiComboBox.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiButton.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiContent.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiColorPicker.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiQuadWarp.cpp">
+ <Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiButton.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
<Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiColorPicker.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiComboBox.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiMovieSlider.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiComboBox.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiToggle.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiContent.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiTitle.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiContent.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSlider2d.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiFPSCounter.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSliderFloat.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiFPSCounter.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiFPSCounter.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiMovieSlider.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSliderInt.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiMovieSlider.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiFPSCounter.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiQuadWarp.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiButton.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiQuadWarp.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiContent.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
<Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSlider2d.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSlider2d.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiToggle.h">
+ <Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiColorPicker.cpp">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
<Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSliderBase.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSliderFloat.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiQuadWarp.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiSliderInt.h">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiMovieSlider.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiTitle.cpp">
+ <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiComboBox.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
<Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiTitle.h">
<Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiToggle.cpp">
- <Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOsc.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
</Unit>
- <Unit filename="../../../addons/ofxSimpleGuiToo/src/Controls/ofxSimpleGuiToggle.h">
- <Option virtualFolder="addons/ofxSimpleGuiToo/src/Controls"/>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscBundle.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscMessage.cpp">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscReceiver.cpp">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscSender.cpp">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscSender.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscArg.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscReceiver.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscMessage.h">
+ <Option virtualFolder="addons/ofxOsc/src"/>
+ </Unit>
+ <Unit filename="../../../addons/ofxOsc/src/ofxOscBundle.cpp">
+ <Option virtualFolder="addons/ofxOsc/src"/>
</Unit>
</Project>
</CodeBlocks_project_file>
View
4 lpmt.workspace
@@ -2,8 +2,8 @@
<CodeBlocks_workspace_file>
<Workspace title="lpmt">
<Project filename="lpmt.cbp" active="1">
- <Depends filename="../../../libs/openFrameworksCompiled/project/linux/libopenFrameworks.cbp"/>
+ <Depends filename="../../../libs/openFrameworksCompiled/project/linux64/libopenFrameworks.cbp"/>
</Project>
- <Project filename="../../../libs/openFrameworksCompiled/project/linux/libopenFrameworks.cbp"/>
+ <Project filename="../../../libs/openFrameworksCompiled/project/linux64/libopenFrameworks.cbp"/>
</Workspace>
</CodeBlocks_workspace_file>
View
86 src/testApp.cpp
@@ -48,6 +48,10 @@ void testApp::setup()
splashImg.loadImage("lpmt_splash.png");
splashTime = ofGetElapsedTimef();
+ // OSC setup
+ receiver.setup( PORT );
+ current_msg_string = 0;
+
// we scan the video dir for videos
//string videoDir = string("./data/video");
string videoDir = ofToDataPath("video",true);
@@ -244,6 +248,13 @@ void testApp::prepare()
if (bStarted)
{
+ // check for waiting OSC messages
+ while( receiver.hasWaitingMessages() )
+ {
+ parseOsc();
+ }
+
+ // check if image load button on GUI is pressed
if(bImageLoad) {
bImageLoad = false;
openImageFile();
@@ -375,6 +386,81 @@ void testApp::draw()
}
+//--------------------------------------------------------------
+void testApp::parseOsc()
+{
+ // get the next message
+ ofxOscMessage m;
+ receiver.getNextMessage( &m );
+
+ // check for quads corner x movements
+ if ( m.getAddress() == "/corners/x" )
+ {
+ // arguments are iif
+ int osc_quad = m.getArgAsInt32( 0 );
+ int osc_corner = m.getArgAsInt32( 1 );
+ float osc_coord = m.getArgAsFloat( 2 );
+ quads[osc_quad].corners[osc_corner].x = osc_coord;
+ }
+ // check for quads corner y movements
+ else if ( m.getAddress() == "/corners/y" )
+ {
+ // arguments are iif
+ int osc_quad = m.getArgAsInt32( 0 );
+ int osc_corner = m.getArgAsInt32( 1 );
+ float osc_coord = m.getArgAsFloat( 2 );
+ quads[osc_quad].corners[osc_corner].y = osc_coord;
+ }
+
+ // change active quad
+ else if ( m.getAddress() == "/active" )
+ {
+ // argument is int32
+ int osc_activequad = m.getArgAsInt32( 0 );
+ if (osc_activequad <= nOfQuads-1)
+ {
+ activeQuad = osc_activequad;
+ gui.setPage((activeQuad*3)+2);
+ }
+ }
+
+ // check for mouse button message
+ else if ( m.getAddress() == "/mouse/button" )
+ {
+ // the single argument is a string
+
+ }
+ else
+ {
+ // unrecognized message: display on the bottom of the screen
+ string msg_string;
+ msg_string = m.getAddress();
+ msg_string += ": ";
+ for ( int i=0; i<m.getNumArgs(); i++ )
+ {
+ // get the argument type
+ msg_string += m.getArgTypeName( i );
+ msg_string += ":";
+ // display the argument - make sure we get the right type
+ if( m.getArgType( i ) == OFXOSC_TYPE_INT32 )
+ msg_string += ofToString( m.getArgAsInt32( i ) );
+ else if( m.getArgType( i ) == OFXOSC_TYPE_FLOAT )
+ msg_string += ofToString( m.getArgAsFloat( i ) );
+ else if( m.getArgType( i ) == OFXOSC_TYPE_STRING )
+ msg_string += m.getArgAsString( i );
+ else
+ msg_string += "unknown";
+ }
+ // add to the list of strings to display
+ msg_strings[current_msg_string] = msg_string;
+ timers[current_msg_string] = ofGetElapsedTimef() + 5.0f;
+ current_msg_string = ( current_msg_string + 1 ) % NUM_MSG_STRINGS;
+ // clear the next line
+ msg_strings[current_msg_string] = "";
+ }
+}
+
+
//--------------------------------------------------------------
void testApp::mpeFrameEvent(ofxMPEEventArgs& event)
View
12 src/testApp.h
@@ -2,13 +2,16 @@
#define _TEST_APP
#define OF_ADDON_USING_OFXXMLSETTINGS
+// OSC stuff - listen on port 12345
+#define PORT 12345
+#define NUM_MSG_STRINGS 20
#include "ofMain.h"
-#include "ball.h"
#include "quad.h"
#include "ofxXmlSettings.h"
#include "ofxMostPixelsEver.h"
+#include "ofxOsc.h"
class testApp : public ofSimpleApp
{
@@ -61,6 +64,13 @@ class testApp : public ofSimpleApp
void mpeResetEvent(ofxMPEEventArgs& event);
float lastFrameTime;
+ // OSC stuff
+ ofxOscReceiver receiver;
+ int current_msg_string;
+ string msg_strings[NUM_MSG_STRINGS];
+ float timers[NUM_MSG_STRINGS];
+ void parseOsc();
+
// gui elements
bool showGui;
void openImageFile();
Please sign in to comment.
Something went wrong with that request. Please try again.