forked from sideb0ard/SoundB0ard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
osclient.cpp
34 lines (29 loc) · 874 Bytes
/
osclient.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <lo/lo.h>
#include <lo/lo_cpp.h>
#include <iostream>
int main() {
lo::Address a("localhost", "9000");
lo::Address ta("localhost", "12345");
/*
* An individual message
*/
a.send("pitch", "i", 7890987);
ta.send("pitch", "i", 7890987);
/*
* Initalizer lists and message constructors are supported, so
* that bundles can be created easily:
*/
a.send(lo::Bundle({{"pitch", lo::Message("i", 1234321)},
{"pitch", lo::Message("i", 4321234)}}));
ta.send(lo::Bundle({{"pitch", lo::Message("i", 1234321)},
{"pitch", lo::Message("i", 4321234)}}));
/*
* Polymorphic overloads on lo::Message::add() mean you don't need
* to specify the type explicitly. This is intended to be useful
* for templates.
*/
lo::Message m;
m.add(7654321);
a.send("pitch", m);
ta.send("pitch", m);
}