Skip to content

Commit

Permalink
Osc fixes + test example
Browse files Browse the repository at this point in the history
  • Loading branch information
spencersalazar committed May 16, 2014
1 parent faef6fe commit f27c82b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/test/03-Modules/osc01.ck
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

OscIn oin;
OscMsg msg;

6449 => oin.port;
oin.addAddress( "/test" );

spork ~ send();

oin => now;

oin.recv(msg);

if(msg.getString(0) == "hello!")
<<< "success" >>>;
else
<<< "failure" >>>;

fun void send()
{
1::second => now;

OscOut xmit;
xmit.dest( "localhost", 6449 );
xmit.start( "/test" ).add("hello!").send();
}


3 changes: 2 additions & 1 deletion src/ulib_opsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class OscIn
{
case 'i': arg.i = argv[i]->i; break;
case 'f': arg.f = argv[i]->f; break;
case 's': arg.s = argv[i]->s; break;
case 's': arg.s = &(argv[i]->s); break;
default:
EM_log(CK_LOG_WARNING, "OscIn: unhandled OSC type '%c'", types[i]);
}
Expand Down Expand Up @@ -911,6 +911,7 @@ CK_DLL_CTOR(oscmsg_ctor)

Chuck_Array4 *args = new Chuck_Array4(TRUE);
initialize_object(args, &t_array);
args->clear();
SAFE_ADD_REF(args);
OBJ_MEMBER_OBJECT(SELF, oscmsg_offset_args) = args;
}
Expand Down

0 comments on commit f27c82b

Please sign in to comment.