26 void error(
int num,
const char *m,
const char *path);
28 int generic_handler(
const char *path,
const char *types,
lo_arg ** argv,
31 int foo_handler(
const char *path,
const char *types,
lo_arg ** argv,
34 int blobtest_handler(
const char *path,
const char *types,
lo_arg ** argv,
37 int pattern_handler(
const char *path,
const char *types,
lo_arg ** argv,
40 int quit_handler(
const char *path,
const char *types,
lo_arg ** argv,
83 void error(
int num,
const char *msg,
const char *path)
85 printf(
"liblo server error %d in path %s: %s\n", num, path, msg);
91 int generic_handler(
const char *path,
const char *types,
lo_arg ** argv,
96 printf(
"generic handler; path: <%s>\n", path);
97 for (i = 0; i < argc; i++) {
98 printf(
"arg %d '%c' ", i, types[i]);
108 int foo_handler(
const char *path,
const char *types,
lo_arg ** argv,
112 printf(
"foo: %s <- f:%f, i:%d\n\n", path, argv[0]->f, argv[1]->i);
118 int blobtest_handler(
const char *path,
const char *types,
lo_arg ** argv,
122 int i, size = argv[0]->
blob.size;
135 for (i=0; i<6 && i<blobsize; i++)
136 if (blobdata[i] >=
'A' && blobdata[i] <=
'Z')
137 mydata[i] = blobdata[i];
142 printf(
"%s <- length:%d '%s'\n", path, size, mydata);
148 int pattern_handler(
const char *path,
const char *types,
lo_arg ** argv,
151 printf(
"pattern handler matched: %s\n\n", path);
159 int quit_handler(
const char *path,
const char *types,
lo_arg ** argv,
163 printf(
"quiting\n\n");
void * lo_blob_dataptr(lo_blob b)
Return a pointer to the start of the blob data to allow contents to be changed.
lo_type
An enumeration of the OSC types liblo can send and receive.
uint32_t lo_blob_datasize(lo_blob b)
Return the amount of valid data in a lo_blob object.
void lo_arg_pp(lo_type type, void *data)
Pretty-print a set of typed arguments.
int lo_server_thread_start(lo_server_thread st)
Start the server thread.
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.
void lo_server_thread_free(lo_server_thread st)
Free memory taken by a server thread.
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.
struct lo_message_ * lo_message
A low-level object used to represent messages passed over OSC.
struct lo_blob_ * lo_blob
A object to store an opaque binary data object.
struct lo_server_thread_ * lo_server_thread
An object representing a thread containing an OSC server.
Union used to read values from incoming messages.