From 1e6df0a45bde37e2174b4611438d2c1de5a2c17a Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Wed, 11 Jul 2007 20:38:37 +0000 Subject: Added handler for blob type. svn path=/trunk/externals/mrpeach/; revision=8027 --- osc/unpackOSC.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'osc/unpackOSC.c') diff --git a/osc/unpackOSC.c b/osc/unpackOSC.c index 6a6274d..0cf3258 100755 --- a/osc/unpackOSC.c +++ b/osc/unpackOSC.c @@ -352,6 +352,22 @@ static void unpackOSC_PrintTypeTaggedArgs(t_unpackOSC *x, void *v, int n) { switch (*thisType) { + case 'b': /* blob: an int32 size count followed by that many 8-bit bytes */ + { + int i, blob_bytes = ntohl(*((int *) p)); +#ifdef DEBUG + post("blob: %lu bytes", blob_bytes); +#endif + p += 4; + for (i = 0; i < blob_bytes; ++i, ++p, ++myargc) + SETFLOAT(mya+myargc,(*(unsigned char *)p)); + while (i%4) + { + ++i; + ++p; + } + break; + } case 'i': case 'r': case 'm': case 'c': #ifdef DEBUG post("integer: %d", ntohl(*((int *) p))); -- cgit v1.2.1