diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 06:20:46 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-10-10 06:20:46 +0200 |
commit | e60a68ede522e56b3a52ddad25ab1704b587e9c2 (patch) | |
tree | be96ce85eb659ca06b1e464e8b11885c63e9a074 /apps/osc.c | |
parent | osc know has an own stuct too (diff) |
midi is now using a thread as well
Diffstat (limited to 'apps/osc.c')
-rw-r--r-- | apps/osc.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> +#include <assert.h> #include "osc.h" @@ -51,27 +52,31 @@ static int generic_handler(const char *path, const char *types, lo_arg ** argv, int osc_init(osc_t* o, const char* port) { - if(!o) - return -1; + assert(o != NULL); - o->st_ = lo_server_thread_new(port, print_error); // TODO: what happends when this fails? + // TODO: what happends when this fails? + o->st_ = lo_server_thread_new(port, print_error); lo_server_thread_add_method(o->st_, NULL, NULL, generic_handler, NULL); return 0; } -void osc_start(osc_t* o) +int osc_start(osc_t* o) { - if(!o) - return; + assert(o != NULL); + // TODO: what happends when this fails? lo_server_thread_start(o->st_); + + return 0; } -void osc_stop(osc_t* o) +int osc_stop(osc_t* o) { - if(!o) - return; + assert(o != NULL); + // TODO: what happends when this fails? lo_server_thread_free(o->st_); + + return 0; } |