summaryrefslogtreecommitdiff
path: root/apps/osc.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-10-10 06:20:46 +0200
committerChristian Pointner <equinox@spreadspace.org>2015-10-10 06:20:46 +0200
commite60a68ede522e56b3a52ddad25ab1704b587e9c2 (patch)
treebe96ce85eb659ca06b1e464e8b11885c63e9a074 /apps/osc.c
parentosc 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.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/osc.c b/apps/osc.c
index 701481f..66b281a 100644
--- a/apps/osc.c
+++ b/apps/osc.c
@@ -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;
}