Mercurial > hg > beaglert
comparison examples/osc/render.cpp @ 301:e4392164b458 prerelease
RENAMED BeagleRT to Bela AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, scripts probably not working
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 14:34:41 +0100 |
parents | dbeed520b014 |
children | db2fe4e1b88e |
comparison
equal
deleted
inserted
replaced
300:dbeed520b014 | 301:e4392164b458 |
---|---|
1 #include <BeagleRT.h> | 1 #include <Bela.h> |
2 #include <OSCServer.h> | 2 #include <OSCServer.h> |
3 #include <OSCClient.h> | 3 #include <OSCClient.h> |
4 | 4 |
5 OSCServer oscServer; | 5 OSCServer oscServer; |
6 OSCClient oscClient; | 6 OSCClient oscClient; |
19 rt_printf("recieved int %i and float %f\n", intArg, floatArg); | 19 rt_printf("recieved int %i and float %f\n", intArg, floatArg); |
20 } | 20 } |
21 | 21 |
22 } | 22 } |
23 | 23 |
24 bool setup(BeagleRTContext *context, void *userData) | 24 bool setup(BelaContext *context, void *userData) |
25 { | 25 { |
26 // setup the OSC server to recieve on port 7562 | 26 // setup the OSC server to recieve on port 7562 |
27 oscServer.setup(7562); | 27 oscServer.setup(7562); |
28 // setup the OSC client to send on port 7563 | 28 // setup the OSC client to send on port 7563 |
29 oscClient.setup(7563); | 29 oscClient.setup(7563); |
46 } | 46 } |
47 | 47 |
48 return true; | 48 return true; |
49 } | 49 } |
50 | 50 |
51 void render(BeagleRTContext *context, void *userData) | 51 void render(BelaContext *context, void *userData) |
52 { | 52 { |
53 // recieve OSC messages, parse them, and send back an acknowledgment | 53 // recieve OSC messages, parse them, and send back an acknowledgment |
54 while (oscServer.messageWaiting()){ | 54 while (oscServer.messageWaiting()){ |
55 parseMessage(oscServer.popMessage()); | 55 parseMessage(oscServer.popMessage()); |
56 oscClient.queueMessage(oscClient.newMessage.to("/osc-acknowledge").add(5).add(4.2f).add(std::string("OSC message recieved")).end()); | 56 oscClient.queueMessage(oscClient.newMessage.to("/osc-acknowledge").add(5).add(4.2f).add(std::string("OSC message recieved")).end()); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 void cleanup(BeagleRTContext *context, void *userData) | 60 void cleanup(BelaContext *context, void *userData) |
61 { | 61 { |
62 | 62 |
63 } | 63 } |