Mercurial > hg > beaglert
changeset 494:5779ed0562ac prerelease
Typo, OSC example.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Tue, 21 Jun 2016 19:33:17 +0100 |
parents | a23d74e2f6cb |
children | 37f10f61433a |
files | examples/05-Communication/OSC/render.cpp |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/05-Communication/OSC/render.cpp Tue Jun 21 18:50:03 2016 +0100 +++ b/examples/05-Communication/OSC/render.cpp Tue Jun 21 19:33:17 2016 +0100 @@ -31,40 +31,40 @@ // this example is designed to be run alongside resources/osc/osc.js -// parse messages recieved by OSC Server +// parse messages received by OSC Server // msg is Message class of oscpkt: http://gruntthepeon.free.fr/oscpkt/ void parseMessage(oscpkt::Message msg){ - rt_printf("recieved message to: %s\n", msg.addressPattern().c_str()); + rt_printf("received message to: %s\n", msg.addressPattern().c_str()); int intArg; float floatArg; if (msg.match("/osc-test").popInt32(intArg).popFloat(floatArg).isOkNoMoreArgs()){ - rt_printf("recieved int %i and float %f\n", intArg, floatArg); + rt_printf("received int %i and float %f\n", intArg, floatArg); } } bool setup(BelaContext *context, void *userData) { - // setup the OSC server to recieve on port 7562 + // setup the OSC server to receive on port 7562 oscServer.setup(7562); // setup the OSC client to send on port 7563 oscClient.setup(7563); // the following code sends an OSC message to address /osc-setup // then waits 1 second for a reply on /osc-setup-reply - bool handshakeRecieved = false; + bool handshakeReceived = false; oscClient.sendMessageNow(oscClient.newMessage.to("/osc-setup").end()); - oscServer.recieveMessageNow(1000); + oscServer.receiveMessageNow(1000); while (oscServer.messageWaiting()){ if (oscServer.popMessage().match("/osc-setup-reply")){ - handshakeRecieved = true; + handshakeReceived = true; } } - if (handshakeRecieved){ - rt_printf("handshake recieved!\n"); + if (handshakeReceived){ + rt_printf("handshake received!\n"); } else { rt_printf("timeout!\n"); } @@ -74,10 +74,10 @@ void render(BelaContext *context, void *userData) { - // recieve OSC messages, parse them, and send back an acknowledgment + // receive OSC messages, parse them, and send back an acknowledgment while (oscServer.messageWaiting()){ parseMessage(oscServer.popMessage()); - oscClient.queueMessage(oscClient.newMessage.to("/osc-acknowledge").add(5).add(4.2f).add(std::string("OSC message recieved")).end()); + oscClient.queueMessage(oscClient.newMessage.to("/osc-acknowledge").add(5).add(4.2f).add(std::string("OSC message received")).end()); } }