From 9a6afb879b41110e8ae58cdb2898a6c3a6e3ad3f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 17 Dec 2006 16:56:21 +0000 Subject: fixed crasher, I forgot to include init in the Pd end of things svn path=/trunk/externals/io/; revision=6928 --- wiiremote/aka.wiiremote.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'wiiremote/aka.wiiremote.c') diff --git a/wiiremote/aka.wiiremote.c b/wiiremote/aka.wiiremote.c index 6ad24d9..89e6248 100644 --- a/wiiremote/aka.wiiremote.c +++ b/wiiremote/aka.wiiremote.c @@ -115,9 +115,12 @@ void main() void akawiiremote_bang(t_akawiiremote *x) { t_atom list[4]; - - if (x->wiiremote->device == nil) + + if (x->wiiremote->device == nil) + { + post("warning: your WiiRemote is not connected"); return; // do nothing + } #ifdef PD outlet_float(x->buttonsOut, (t_float) x->wiiremote->buttonData); @@ -319,6 +322,8 @@ void *akawiiremote_new(t_symbol *s, short ac, t_atom *av) { #ifdef PD t_akawiiremote *x = (t_akawiiremote *)pd_new(wiiremote_class); + + x->wiiremote = wiiremote_init(); x->clock = clock_new(x, (t_method)akawiiremote_clock); -- cgit v1.2.1