6 #include <lo/lo_throw.h> 12 #include <unordered_map> 15 #include <initializer_list> 40 #define LO_ADD_METHOD_RT(ht, argtypes, args, rt, r, r1, r2) \ 41 template <typename H> \ 42 Method add_method(const string_type path, const string_type types, \ 43 H&& h, rt* _unused=0) \ 45 std::string key(path.s() + "," + types.s()); \ 46 _handlers[key].push_front( \ 47 std::unique_ptr<handler>(new handler_type<r ht>(h))); \ 48 lo_method m = _add_method(path, types, \ 49 [](const char *path, const char *types, \ 50 lo_arg **argv, int argc, void *msg, \ 53 r1 (*static_cast<handler_type<r ht>*>(data)) args; \ 55 }, _handlers[key].front().get()); \ 56 _handlers[key].front()->method = m; \ 60 #define RT_INT(argtypes) \ 61 typename std::enable_if<std::is_same<decltype(h argtypes), int>::value, void>::type 62 #define RT_VOID(argtypes) \ 63 typename std::enable_if<std::is_same<decltype(h argtypes), void>::value, void>::type 65 #define LO_ADD_METHOD(ht, argtypes, args) \ 66 LO_ADD_METHOD_RT(ht, argtypes, args, \ 67 RT_INT(argtypes), int, return,); \ 68 LO_ADD_METHOD_RT(ht, argtypes, args, \ 69 RT_VOID(argtypes), void, , return 0) 77 string_type(
const char *s=0) { _s = s; }
78 string_type(
const std::string &s) { _s = s.c_str(); }
79 operator const char*()
const {
return _s; }
80 std::string s()
const {
return _s?_s:
""; }
84 class num_string_type :
public string_type {
86 num_string_type(
const char *s) : string_type(s) {}
87 num_string_type(
const std::string &s) : string_type(s) {}
88 num_string_type(
int n) { std::ostringstream ss; ss << n;
89 _p.reset(
new std::string(ss.str())); _s = _p->c_str(); }
90 std::unique_ptr<std::string> _p;
111 Address(
const string_type &host,
const num_string_type &port,
115 Address(
const string_type &url)
119 { address = a; owned=_owned; }
125 void swap(
Address& b)
throw () { std::swap(this->address, b.address); }
130 void set_ttl(
int ttl)
133 int send(
const string_type &path)
const 134 {
return lo_send(address, path,
""); }
139 int send(
const string_type &path,
const string_type type, ...)
const 144 std::string t = type.s() +
"$$";
151 int send(
lo_timetag ts,
const string_type &path,
152 const string_type type, ...)
const 157 std::string t = std::string(type) +
"$$";
166 int send(
const string_type &path,
lo_message m)
const 173 const string_type type, ...)
const;
175 int send_from(
lo_server from,
const string_type &path,
176 const string_type type, ...)
const 181 std::string t = std::string(type) +
"$$";
189 const string_type &path,
190 const string_type type, ...)
const 195 std::string t = std::string(type) +
"$$";
212 int get_errno()
const 215 std::string errstr()
const 218 std::string hostname()
const 221 std::string port()
const 227 std::string url()
const 230 std::string iface()
const 233 void set_iface(
const string_type &iface,
const string_type &ip)
236 int set_tcp_nodelay(
int enable)
239 int set_stream_slip(
int enable)
261 : message(m.message) {
if (m.message)
264 Message(
const string_type types, ...)
270 std::string t(std::string(types)+
"$$");
271 add_varargs(t.c_str(), q);
278 void swap(
Message& m)
throw () { std::swap(this->message, m.message); }
280 int add(
const string_type types, ...)
284 std::string t(std::string(types)+
"$$");
285 return add_varargs(t.c_str(), q);
288 int add_varargs(
const string_type &types, va_list ap)
291 int add_int32(int32_t a)
294 int add_float(
float a)
297 int add_string(
const string_type &a)
303 int add_int64(int64_t a)
309 int add_double(
double a)
312 int add_symbol(
const string_type &a)
318 int add_midi(uint8_t a[4])
364 int add(uint8_t a[4])
379 std::string types()
const 388 size_t length(
const string_type &path)
const 391 void *serialise(
const string_type &path,
void *to,
size_t *size)
const 394 typedef std::pair<int, Message> maybe;
397 maybe deserialise(
void *data,
size_t size)
400 return maybe(result, m); }
423 template <
typename E>
424 Server(
const num_string_type &port, E&& e)
426 [](int num, const char *msg, const char *where){
427 auto h =
static_cast<handler_error*
>(lo_error_get_context());
428 if (h) (*h)(num, msg, where);
432 lo_server_set_error_context(server,
433 (_error_handler = std::unique_ptr<handler>(
434 new handler_error(e))).
get());
439 template <
typename E>
440 Server(
const num_string_type &port,
int proto, E&& e=0)
442 [](int num, const char *msg, const char *where){
443 auto h =
static_cast<handler_error*
>(lo_error_get_context());
444 (*h)(num, msg, where);
448 lo_server_set_error_context(server,
449 (_error_handler = std::unique_ptr<handler>(
450 new handler_error(e))).
get());
456 template <
typename E>
457 Server(
const string_type &group,
const num_string_type &port,
458 const string_type &iface=0,
const string_type &ip=0, E&& e=0)
459 :
Server((!iface._s || !ip._s)
461 [](int num, const char *msg, const char *where){
462 auto h =
static_cast<handler_error*
>(lo_error_get_context());
463 (*h)(num, msg, where);
466 [](
int num,
const char *msg,
const char *where){
467 auto h =
static_cast<handler_error*
>(lo_error_get_context());
468 (*h)(num, msg, where);
472 lo_server_set_error_context(server,
473 (_error_handler = std::unique_ptr<handler>(
474 new handler_error(e))).
get());
488 Server(
const string_type &group,
const num_string_type &port,
489 const string_type &iface=
"",
const string_type &ip=
"",
lo_err_handler err_h=0)
490 :
Server((iface._s || ip._s)
499 bool is_valid()
const {
return server!=
nullptr; }
507 {
return _add_method(path, types, h, data); }
513 LO_ADD_METHOD( (
const char*,
const char*,
lo_arg**,
int),
514 ((
char*)0, (
char*)0, (
lo_arg**)0, (
int)0),
515 (path, types, argv, argc) );
519 LO_ADD_METHOD( (
const char*,
lo_arg**,
int),
520 ((
char*)0, (
lo_arg**)0, (
int)0),
521 (types, argv, argc) );
524 (types, argv, argc,
Message(msg)) );
525 LO_ADD_METHOD( (
const char*,
const Message&),
528 LO_ADD_METHOD( (
lo_arg**,
int), ((
lo_arg**)0, (
int)0), (argv, argc) )
532 LO_ADD_METHOD( (
const Message&),
535 LO_ADD_METHOD( (), (), () );
537 int del_method(
const string_type &path,
const string_type &typespec)
539 _handlers.erase(path.s() +
"," + typespec.s());
546 for (
auto &i : _handlers) {
547 std::remove_if(i.second.begin(), i.second.end(),
548 [&](std::unique_ptr<handler>& h){
return h->method == m;});
553 int dispatch_data(
void *data,
size_t size)
556 int wait(
int timeout)
562 int recv(
int timeout)
572 template <
typename S,
typename E>
573 int add_bundle_handlers(S&& s, E&& e)
575 _bundle_handlers.reset(
new std::pair<handler_bundle_start,
577 handler_bundle_start(s),
578 handler_bundle_end(e)));
582 auto h = (std::pair<handler_bundle_start,
583 handler_bundle_end>*) user_data;
587 [](
void *user_data)->
int{
588 auto h = (std::pair<handler_bundle_start,
589 handler_bundle_end>*) user_data;
593 _bundle_handlers.get());
596 int socket_fd()
const 605 std::string url()
const 608 int enable_queue(
int queue_enabled,
609 int dispatch_remaining=1)
612 dispatch_remaining); }
614 int events_pending()
const 617 double next_event_delay()
const 628 struct handler {
Method method; handler(
Method m):method(m){} };
629 template <
typename T>
630 class handler_type :
public handler,
public std::function<T> {
631 public:
template<
typename H>handler_type(H&& h,
Method m=0)
632 : handler(m), std::function<T>(h) {}
634 typedef handler_type<void(int, const char *, const char *)> handler_error;
635 typedef handler_type<void(int, const std::string&, const std::string&)> handler_error_s;
636 typedef handler_type<void(lo_timetag)> handler_bundle_start;
637 typedef handler_type<void()> handler_bundle_end;
640 std::unordered_map<std::string,
641 std::list<std::unique_ptr<handler>>> _handlers;
642 std::unique_ptr<handler> _error_handler;
643 std::unique_ptr<std::pair<handler_bundle_start,
644 handler_bundle_end>> _bundle_handlers;
646 virtual Method _add_method(
const char *path,
const char *types,
663 template <
typename E>
668 [](
int num,
const char *msg,
const char *where){
669 auto h =
static_cast<handler_error*
>(lo_error_get_context());
672 if (h) (*h)(num, msg, where);});
675 auto h =
new handler_error(e);
676 _error_handler.reset(h);
677 lo_server_thread_set_error_context(server_thread, h);
678 lo_server_set_error_context(server,
679 (_error_handler = std::unique_ptr<handler>(
680 new handler_error(e))).
get());
690 template <
typename E>
691 ServerThread(
const num_string_type &port,
int proto, E&& e)
695 [](
int num,
const char *msg,
const char *where){
696 auto h =
static_cast<handler_error*
>(lo_error_get_context());
699 if (h) (*h)(num, msg, where);});
702 auto h =
new handler_error(e);
703 _error_handler.reset(h);
704 lo_server_thread_set_error_context(server_thread, h);
705 lo_server_set_error_context(server,
706 (_error_handler = std::unique_ptr<handler>(
707 new handler_error(e))).
get());
715 template <
typename I,
typename C>
716 auto set_callbacks(I&& init, C&& cleanup)
717 ->
typename std::enable_if<
718 std::is_same<decltype(init()), int>::value,
void>::type
721 _cb_handlers.reset(
new handler_cb_pair(init, cleanup));
724 auto cb = (handler_cb_pair*)c;
725 return (cb->first)();
728 auto cb = (handler_cb_pair*)c;
730 }, _cb_handlers.get());
734 template <
typename I,
typename C>
735 auto set_callbacks(I&& init, C&& cleanup)
736 ->
typename std::enable_if<
737 std::is_same<decltype(init()), void>::value,
void>::type
741 (handler_cb_pair*)
new handler_cb_pair_void(init, cleanup));
744 auto cb = (handler_cb_pair_void*)c;
745 (cb->first)();
return 0;
748 auto cb = (handler_cb_pair_void*)c;
750 }, _cb_handlers.get());
758 {
return server_thread; }
763 typedef std::pair<handler_type<int()>,handler_type<void()>> handler_cb_pair;
764 typedef std::pair<handler_type<void()>,handler_type<void()>> handler_cb_pair_void;
765 std::unique_ptr<handler_cb_pair> _cb_handlers;
768 virtual Method _add_method(
const char *path,
const char *types,
780 const string_type type, ...)
const 785 std::string t = std::string(type) +
"$$";
804 Blob(int32_t size,
const void *data=0)
807 template <
typename T>
809 : blob(
lo_blob_new(t.size()*
sizeof(t[0]), &t[0])) {}
814 Blob& operator=(
Blob b) { b.swap(*
this);
return *
this; }
815 void swap(
Blob& b)
throw () { std::swap(this->blob, b.blob); }
817 uint32_t datasize()
const 820 void *dataptr()
const 823 uint32_t size()
const 838 : path(_path), msg(_msg) {}
847 template <
typename T>
852 ElementT(
const string_type _path,
const Message& _msg)
856 ElementT(
const T& _bundle)
862 typedef ElementT<Bundle> Element;
880 Bundle(
const std::initializer_list<Element> &elements,
885 for (
auto const &e : elements) {
901 Bundle& operator=(
Bundle b) { b.swap(*
this);
return *
this; }
902 void swap(
Bundle& b)
throw () { std::swap(this->bundle, b.bundle); }
904 int add(
const string_type &path,
lo_message m)
910 size_t length()
const 913 unsigned int count()
const 916 lo_message get_message(
int index,
const char **path=0)
const 919 Message get_message(
int index, std::string &path)
const 925 PathMsg get_message(
int index)
const 930 Bundle get_bundle(
int index)
const 933 Element get_element(
int index,
const char **path=0)
const 939 return Element(p, m);
951 void *serialise(
void *to,
size_t *size)
const 968 return std::string(str);
Class representing an OSC method, proxy for lo_method.
lo_server lo_server_new_multicast(const char *group, const char *port, lo_err_handler err_h)
Create a new server instance, and join a UDP multicast group.
lo_message lo_bundle_get_message(lo_bundle b, int index, const char **path)
Gets a message contained within a bundle.
Class representing an OSC message, proxy for lo_message.
void lo_bundle_free_messages(lo_bundle b)
Obsolete, use lo_bundle_free_recursive instead.
int lo_message_add_char(lo_message m, char a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
lo_timetag lo_bundle_get_timestamp(lo_bundle b)
Get the timestamp associated with a bundle.
lo_timetag lo_message_get_timestamp(lo_message m)
Returns the timestamp (lo_timetag *) of a bundled incoming message.
int lo_message_add_nil(lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
lo_server_thread lo_server_thread_new(const char *port, lo_err_handler err_h)
Create a new server thread to handle incoming OSC messages.
int lo_message_add_blob(lo_message m, lo_blob a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
lo_message lo_message_new()
Create a new lo_message object.
lo_message lo_message_clone(lo_message m)
Create a new lo_message object by cloning an already existing one.
lo_server lo_server_new(const char *port, lo_err_handler err_h)
Create a new server instance.
void lo_server_thread_set_callbacks(lo_server_thread st, lo_server_thread_init_callback init, lo_server_thread_cleanup_callback cleanup, void *user_data)
Set an init and/or a cleanup function to the specifed server thread.
Class representing an OSC blob, proxy for lo_blob.
int lo_message_get_argc(lo_message m)
Return the message argument count.
Union used to read values from incoming messages.
int lo_server_add_bundle_handlers(lo_server s, lo_bundle_start_handler sh, lo_bundle_end_handler eh, void *user_data)
Add bundle notification handlers to the specified server.
lo_element_type
An enumeration of bundle element types liblo can handle.
lo_element_type lo_bundle_get_type(lo_bundle b, int index)
Gets the element type contained within a bundle.
int lo_bundle_add_message(lo_bundle b, const char *path, lo_message m)
Adds an OSC message to an existing bundle.
void lo_bundle_incref(lo_bundle b)
Add one to a bundle's reference count.
const char * lo_address_errstr(lo_address a)
Return the error string from the last failed lo_send() or lo_address_new() call.
int lo_server_enable_queue(lo_server s, int queue_enabled, int dispatch_remaining)
Toggle event queue. If queueing is enabled, timetagged messages that are sent in advance of the curre...
int lo_send_bundle(lo_address targ, lo_bundle b)
Send a lo_bundle object to address targ.
int lo_message_add_timetag(lo_message m, lo_timetag a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
int lo_server_thread_start(lo_server_thread st)
Start the server thread.
int lo_message_add_string(lo_message m, const char *a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
int lo_message_add_infinitum(lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
void lo_server_del_method(lo_server s, const char *path, const char *typespec)
Delete an OSC method from the specified server.
Server(const num_string_type &port, int proto, E &&e=0)
Class representing a server thread, proxy for lo_server_thread.
lo_address lo_message_get_source(lo_message m)
Returns the source (lo_address) of an incoming message.
int lo_send_bundle_from(lo_address targ, lo_server serv, lo_bundle b)
Send a lo_bundle object to address targ from address of serv.
int lo_send_message_from(lo_address targ, lo_server serv, const char *path, lo_message msg)
Send a lo_message object to target targ from address of serv.
Method add_method(const string_type &path, const string_type &types, lo_method_handler h, void *data) const
void lo_blob_free(lo_blob b)
Free the memory taken by a blob.
void lo_message_free(lo_message m)
Free memory allocated by lo_message_new() and any subsequent lo_message_add_int32 lo_message_add*() c...
Server(const num_string_type &port, int proto, lo_err_handler err_h=0)
lo_bundle lo_bundle_new(lo_timetag tt)
Create a new bundle object.
int lo_message_add_double(lo_message m, double a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
void lo_server_free(lo_server s)
Free up memory used by the lo_server object.
lo_timetag now()
Return the current time in lo_timetag format.
Server(const num_string_type &port, lo_err_handler err_h=0)
int(* lo_bundle_start_handler)(lo_timetag time, void *user_data)
A callback function to receive notification of a bundle being dispatched by the server or server thre...
Server(const string_type &group, const num_string_type &port, const string_type &iface=0, const string_type &ip=0, E &&e=0)
lo_arg ** lo_message_get_argv(lo_message m)
Return the message arguments. Do not free the returned data.
lo_timetag immediate()
Return the OSC timetag representing "immediately".
lo_address lo_address_new_from_url(const char *url)
Create a lo_address object from an OSC URL.
#define LO_TT_IMMEDIATE
A timetag constant representing "now".
void lo_bundle_pp(lo_bundle b)
Pretty-print a lo_bundle object.
lo_address lo_address_new_with_proto(int proto, const char *host, const char *port)
Declare an OSC destination, given IP address and port number, specifying protocol.
Class representing an OSC destination address, proxy for lo_address.
const char * lo_address_get_port(lo_address a)
Return the port/service name of a lo_address object.
int lo_address_get_protocol(lo_address a)
Return the protocol of a lo_address object.
lo_method lo_server_thread_add_method(lo_server_thread st, const char *path, const char *typespec, lo_method_handler h, const void *user_data)
Add an OSC method to the specifed server thread.
size_t lo_message_length(lo_message m, const char *path)
Return the length of a message in bytes.
lo_server lo_server_new_multicast_iface(const char *group, const char *port, const char *iface, const char *ip, lo_err_handler err_h)
Create a new server instance, and join a UDP multicast group, optionally specifying which network int...
int lo_send_message(lo_address targ, const char *path, lo_message msg)
Send a lo_message object to target targ.
int lo_message_add_int64(lo_message m, int64_t a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
void * lo_bundle_serialise(lo_bundle b, void *to, size_t *size)
Serialise the bundle object to an area of memory and return a pointer to the serialised form...
int(* lo_method_handler)(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data)
A callback function to receive notification of matching message arriving in the server or server thre...
int lo_message_add_int32(lo_message m, int32_t a)
Append a data item and typechar of the specified type to a message.
int lo_address_set_stream_slip(lo_address t, int enable)
Set outgoing stream connections (e.g., TCP) to be transmitted using the SLIP packetizing protocol...
lo_bundle lo_bundle_get_bundle(lo_bundle b, int index)
Gets a nested bundle contained within a bundle.
const char * lo_address_get_iface(lo_address t)
Get the name of the network interface assigned to an OSC address.
int lo_address_set_tcp_nodelay(lo_address t, int enable)
Set the TCP_NODELAY flag on outgoing TCP connections.
lo_message lo_message_deserialise(void *data, size_t size, int *result)
Deserialise a raw OSC message and return a new lo_message object. Opposite of lo_message_serialise()...
Class representing an OSC path (std::string) and lo::Message pair.
int lo_address_get_ttl(lo_address t)
Get the Time-to-Live value for a given target address.
const char * lo_address_get_hostname(lo_address a)
Return the hostname of a lo_address object.
int lo_message_add_true(lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
int lo_server_recv_noblock(lo_server s, int timeout)
Look for an OSC message waiting to be received.
int lo_bundle_add_bundle(lo_bundle b, lo_bundle n)
Adds an OSC bundle to an existing bundle.
void * lo_blob
A object to store an opaque binary data object.
char * lo_server_get_url(lo_server s)
Return an OSC URL that can be used to contact the server.
void * lo_address
A reference to an OSC service.
lo_server lo_server_new_with_proto(const char *port, int proto, lo_err_handler err_h)
Create a new server instance, specifying protocol.
int lo_server_get_port(lo_server s)
Return the port number that the server has bound to.
Class representing a local OSC server, proxy for lo_server.
void lo_address_set_ttl(lo_address t, int ttl)
Set the Time-to-Live value for a given target address.
double lo_server_next_event_delay(lo_server s)
Return the time in seconds until the next scheduled event.
lo_server lo_server_thread_get_server(lo_server_thread st)
Return the lo_server for a lo_server_thread.
size_t lo_bundle_length(lo_bundle b)
Return the length of a bundle in bytes.
int lo_message_add_midi(lo_message m, uint8_t a[4])
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
int lo_message_add_varargs(lo_message m, const char *types, va_list ap)
Append a varargs list to a message.
char * lo_address_get_url(lo_address a)
Return a URL representing an OSC address.
Class representing an OSC bundle, proxy for lo_bundle.
int lo_server_get_socket_fd(lo_server s)
Return the file descriptor of the server socket.
lo_server_thread lo_server_thread_new_with_proto(const char *port, int proto, lo_err_handler err_h)
Create a new server thread to handle incoming OSC messages, specifying protocol.
int lo_server_dispatch_data(lo_server s, void *data, size_t size)
Dispatch a raw block of memory containing an OSC message.
void * lo_server_thread
An object representing a thread containing an OSC server.
void * lo_message
A low-level object used to represent messages passed over OSC.
void lo_address_free(lo_address t)
Free the memory used by the lo_address object.
int lo_server_del_lo_method(lo_server s, lo_method m)
Delete a specific OSC method from the specified server.
int lo_server_events_pending(lo_server s)
Return true if there are scheduled events (eg. from bundles) waiting to be dispatched by the server...
Server(const num_string_type &port, E &&e)
void lo_bundle_free_recursive(lo_bundle b)
Frees the memory taken by a bundle object and its messages and nested bundles recursively.
void(* lo_err_handler)(int num, const char *msg, const char *where)
A callback function to receive notification of an error in a server or server thread.
int lo_server_get_protocol(lo_server s)
Return the protocol that the server is using.
int lo_server_thread_stop(lo_server_thread st)
Stop the server thread.
lo_blob lo_blob_new(int32_t size, const void *data)
Create a new OSC blob type.
uint32_t lo_blob_datasize(lo_blob b)
Return the amount of valid data in a lo_blob object.
int lo_server_recv(lo_server s)
Block, waiting for an OSC message to be received.
Server(const string_type &group, const num_string_type &port, const string_type &iface="", const string_type &ip="", lo_err_handler err_h=0)
void * lo_server
An object representing an instance of an OSC server.
void lo_message_incref(lo_message m)
Add one to a message's reference count.
int(* lo_bundle_end_handler)(void *user_data)
A callback function to receive notification of a bundle dispatch being completed by the server or ser...
void lo_timetag_now(lo_timetag *t)
Return a timetag for the current time.
int lo_address_set_iface(lo_address t, const char *iface, const char *ip)
Set the network interface to use for a given target address.
int lo_message_add_symbol(lo_message m, const char *a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
char * lo_message_get_types(lo_message m)
Return the message type tag string.
void lo_version(char *verstr, int verstr_size, int *major, int *minor, char *extra, int extra_size, int *lt_major, int *lt_minor, int *lt_bug)
Get information on the version of liblo current in use.
lo_method lo_server_add_method(lo_server s, const char *path, const char *typespec, lo_method_handler h, const void *user_data)
Add an OSC method to the specifed server.
void * lo_message_serialise(lo_message m, const char *path, void *to, size_t *size)
Serialise the lo_message object to an area of memory and return a pointer to the serialised form...
unsigned int lo_bundle_count(lo_bundle b)
Return the number of top-level elements in a bundle.
int lo_message_add_false(lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
int lo_server_wait(lo_server s, int timeout)
Wait for an OSC message to be received.
int lo_address_errno(lo_address a)
Return the error number from the last failed lo_send() or lo_address_new() call.
int lo_send(lo_address targ, const char *path, const char *type,...)
Send a OSC formatted message to the address specified.
void * lo_blob_dataptr(lo_blob b)
Return a pointer to the start of the blob data to allow contents to be changed.
uint32_t lo_blobsize(lo_blob b)
A function to calculate the amount of OSC message space required by a lo_blob object.
void lo_server_thread_free(lo_server_thread st)
Free memory taken by a server thread.
void * lo_method
An object representing an method on a server.
void * lo_bundle
A low-level object used to represent bundles of messages passed over OSC.
int lo_message_add_float(lo_message m, float a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for de...
void lo_message_pp(lo_message m)
Pretty-print a lo_message object.
std::string version()
Return the library version as an std::string.