aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2007-07-05 19:08:53 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2007-07-05 19:08:53 +0000
commitb46366d420af97d820fb72a0e7cf34b38ca9edc0 (patch)
tree0e1c3bdfcdef8d8e804c509292d15dd78c916f07
parent3d1201c91b1c9c93691df073ff238b29332cb05b (diff)
Added some support for time tags: immediate or current time plus optional offset.
svn path=/trunk/externals/mrpeach/; revision=7901
-rwxr-xr-xosc/packOSC-help.pd78
-rwxr-xr-xosc/packOSC.c66
-rwxr-xr-xosc/routeOSC-help.pd74
-rwxr-xr-xosc/unpackOSC.c168
4 files changed, 219 insertions, 167 deletions
diff --git a/osc/packOSC-help.pd b/osc/packOSC-help.pd
index e6d92ff..1747f30 100755
--- a/osc/packOSC-help.pd
+++ b/osc/packOSC-help.pd
@@ -1,47 +1,60 @@
-#N canvas 306 39 997 661 12;
-#X obj 72 541 udpsend;
-#X msg 136 486 disconnect;
-#X msg 136 457 connect 127.0.0.1 9997;
+#N canvas 0 366 1064 453 12;
+#X obj 72 393 udpsend;
+#X msg 373 359 disconnect;
+#X msg 161 359 connect 127.0.0.1 9997;
#X obj 72 296 packOSC;
-#X obj 72 576 tgl 15 0 empty empty 1=connected 20 8 0 8 -262144 -1
+#X obj 72 428 tgl 15 0 empty empty 1=connected 20 8 0 8 -262144 -1
-1 1 1;
#X msg 3 3 send /test/one/two/three zz 88 T;
#X msg 54 54 send /test 1 2 3;
-#X msg 31 29 send /west 35;
-#X msg 72 82 send /*/left 22;
-#X msg 87 109 send /?est/ 1;
+#X msg 30 27 send /west 35;
+#X msg 212 54 send /*/left 22;
+#X msg 360 54 send /?est/ 1;
#X text 140 288 packOSC is like sendOSC except that it outputs a list
of floats instead of directly connecting to the network;
#X text 299 2 send a type-guessed message;
-#X text 381 183 send a type-forced message;
-#X obj 420 69 routeOSC;
-#X text 341 69 see also:;
+#X text 596 201 send a type-forced message;
+#X obj 652 417 routeOSC;
+#X text 573 417 see also:;
#X msg 121 264 typetags \$1;
#X obj 121 247 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 228 264 typetags are on by default;
-#X text 638 135 Useable types are:;
-#X text 638 153 i: 32 bit integer;
-#X text 638 171 f: 32-bit float;
-#X text 638 189 s: string;
-#X text 539 28 send a type-forced message;
+#X text 670 223 Useable types are:;
+#X text 670 241 i: 32 bit integer;
+#X text 670 259 f: 32-bit float;
+#X text 670 277 s: string;
+#X text 539 26 send a type-forced message;
#X msg 164 27 sendtyped /test/one/two/three sis zz 88 T;
#X msg 112 202 sendtyped /left/right TTiTIFNfisf 1.1 2.1 3.1 4.1 5.1
;
-#X text 638 207 T: true (no argument);
-#X text 638 225 F: false (no argument);
-#X text 638 243 I: infinitum (no argument);
-#X obj 72 408 list prepend send;
-#X obj 72 434 list trim;
-#X text 638 260 N: Nil (no argument);
+#X text 670 295 T: true (no argument);
+#X text 670 313 F: false (no argument);
+#X text 670 331 I: infinitum (no argument);
+#X obj 72 323 list prepend send;
+#X obj 72 349 list trim;
+#X text 670 348 N: Nil (no argument);
#X msg 115 225 bufsize 100;
#X text 221 226 set buffer size (default is 64000 bytes);
-#X msg 267 105 prefix /test;
-#X text 384 106 set the OSC path prefix for subsequent messages;
-#X msg 112 161 /left one two;
-#X msg 100 135 /right 88;
-#X text 191 136 'send' prefix is not required;
-#X text 462 529 2007/06/20 Martin Peach;
+#X msg 83 84 prefix /test;
+#X text 200 83 set the OSC path prefix for subsequent messages;
+#X msg 106 178 /left one two;
+#X msg 98 157 /right 88;
+#X text 189 156 'send' prefix is not required;
+#X msg -37 105 [;
+#X msg -95 129 ];
+#X text 270 421 2007/07/05 Martin Peach;
+#X text 8 104 open a bundle;
+#X text -55 128 close bundle;
+#X msg 457 111 timetagoffset 0;
+#X msg 464 130 timetagoffset -1;
+#X text 602 110 send current time as timetag;
+#X msg 472 149 timetagoffset 1e+07;
+#X text 494 169 (timetags are sent in bundle messages only);
+#X text 680 148 current time plus 10 seconds;
+#X obj -95 71 t b a b;
+#X msg -95 48 /test 5 6 7;
+#X text 615 129 immediate time tag (default);
#X connect 0 0 4 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
@@ -61,3 +74,12 @@ of floats instead of directly connecting to the network;
#X connect 33 0 3 0;
#X connect 35 0 3 0;
#X connect 36 0 3 0;
+#X connect 38 0 3 0;
+#X connect 39 0 3 0;
+#X connect 43 0 3 0;
+#X connect 44 0 3 0;
+#X connect 46 0 3 0;
+#X connect 49 0 39 0;
+#X connect 49 1 3 0;
+#X connect 49 2 38 0;
+#X connect 50 0 49 0;
diff --git a/osc/packOSC.c b/osc/packOSC.c
index 6880850..f609d64 100755
--- a/osc/packOSC.c
+++ b/osc/packOSC.c
@@ -37,6 +37,7 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <sys/time.h>
#ifdef MSW
#include <winsock2.h>
@@ -102,6 +103,9 @@ typedef struct
/* Return the time tag 0x0000000000000001, indicating to the receiving device
that it should process the message immediately. */
static OSCTimeTag OSCTT_Immediately(void);
+static OSCTimeTag OSCTT_Infinite(void);
+
+static OSCTimeTag OSCTT_CurrentTimePlusOffset(uint4 offset);
/* The int4byte type has to be a 4-byte integer. You may have to
change this to long or something else on your system. */
@@ -239,6 +243,7 @@ typedef struct _packOSC
{
t_object x_obj;
t_int x_typetags; /* typetag flag */
+ t_int x_timeTagOffset;
int x_bundle; /* bundle open flag */
OSCbuf x_oscbuf[1]; /* OSCbuffer */
t_outlet *x_bdpthout; /* bundle-depth floatoutlet */
@@ -249,12 +254,13 @@ typedef struct _packOSC
char *x_prefix;
} t_packOSC;
-static void *packOSC_new(t_floatarg udpflag);
+static void *packOSC_new(void);
static void packOSC_path(t_packOSC *x, t_symbol*s);
static void packOSC_openbundle(t_packOSC *x);
static void packOSC_closebundle(t_packOSC *x);
static void packOSC_settypetags(t_packOSC *x, t_floatarg f);
static void packOSC_setbufsize(t_packOSC *x, t_floatarg f);
+static void packOSC_setTimeTagOffset(t_packOSC *x, t_floatarg f);
static void packOSC_sendtyped(t_packOSC *x, t_symbol *s, int argc, t_atom *argv);
static void packOSC_send_type_forced(t_packOSC *x, t_symbol *s, int argc, t_atom *argv);
static void packOSC_send(t_packOSC *x, t_symbol *s, int argc, t_atom *argv);
@@ -267,7 +273,7 @@ static int packOSC_writetypedmessage(t_packOSC *x, OSCbuf *buf, char *messageNam
static int packOSC_writemessage(t_packOSC *x, OSCbuf *buf, char *messageName, int numArgs, typedArg *args);
static void packOSC_sendbuffer(t_packOSC *x);
-static void *packOSC_new(t_floatarg udpflag)
+static void *packOSC_new(void)
{
t_packOSC *x = (t_packOSC *)pd_new(packOSC_class);
x->x_typetags = 1; /* set typetags to 1 by default */
@@ -283,6 +289,7 @@ static void *packOSC_new(t_floatarg udpflag)
OSC_initBuffer(x->x_oscbuf, x->x_buflength, x->x_bufferForOSCbuf);
x->x_listout = outlet_new(&x->x_obj, &s_list);
x->x_bdpthout = outlet_new(&x->x_obj, &s_float);
+ x->x_timeTagOffset = -1; /* immediately */
return (x);
}
@@ -304,12 +311,12 @@ static void packOSC_path(t_packOSC *x, t_symbol*s)
static void packOSC_openbundle(t_packOSC *x)
{
- if (x->x_oscbuf->bundleDepth + 1 >= MAX_BUNDLE_NESTING ||
- OSC_openBundle(x->x_oscbuf, OSCTT_Immediately()))
- {
- post("packOSC: Problem opening bundle.");
- return;
- }
+ int result;
+ if (x->x_timeTagOffset == -1)
+ result = OSC_openBundle(x->x_oscbuf, OSCTT_Immediately());
+ else
+ result = OSC_openBundle(x->x_oscbuf, OSCTT_CurrentTimePlusOffset((uint4)x->x_timeTagOffset));
+ if (result != 0) return;
x->x_bundle = 1;
outlet_float(x->x_bdpthout, (float)x->x_oscbuf->bundleDepth);
}
@@ -355,6 +362,10 @@ static void packOSC_setbufsize(t_packOSC *x, t_floatarg f)
}
+static void packOSC_setTimeTagOffset(t_packOSC *x, t_floatarg f)
+{
+ x->x_timeTagOffset = (t_int)f;
+}
/* this is the real and only sending routine now, for both typed and */
/* undtyped mode. */
@@ -530,6 +541,8 @@ void packOSC_setup(void)
gensym("typetags"), A_DEFFLOAT, 0);
class_addmethod(packOSC_class, (t_method)packOSC_setbufsize,
gensym("bufsize"), A_DEFFLOAT, 0);
+ class_addmethod(packOSC_class, (t_method)packOSC_setTimeTagOffset,
+ gensym("timetagoffset"), A_DEFFLOAT, 0);
class_addmethod(packOSC_class, (t_method)packOSC_send,
gensym("send"), A_GIMME, 0);
class_addmethod(packOSC_class, (t_method)packOSC_send,
@@ -1240,4 +1253,41 @@ static OSCTimeTag OSCTT_Immediately(void)
tt.seconds = 0;
return tt;
}
+
+static OSCTimeTag OSCTT_Infinite(void)
+{
+ OSCTimeTag tt;
+ tt.fraction = 0xffffffffL;
+ tt.seconds = 0xffffffffL;
+ return tt;
+}
+
+#define SECONDS_FROM_1900_to_1970 2208988800LL /* 17 leap years */
+#define TWO_TO_THE_32_OVER_ONE_MILLION 4295LL
+
+static OSCTimeTag OSCTT_CurrentTimePlusOffset(uint4 offset)
+{ /* offset is in microseconds */
+ OSCTimeTag tt;
+ struct timeval tv;
+ struct timezone tz;
+ static unsigned int onemillion = 1000000;
+
+ gettimeofday(&tv, &tz);
+
+ /* First get the seconds right */
+ tt.seconds = (unsigned) SECONDS_FROM_1900_to_1970 +
+ (unsigned) tv.tv_sec -
+ (unsigned) 60 * tz.tz_minuteswest +
+ (unsigned) (tz.tz_dsttime ? 3600 : 0)+
+ (unsigned) offset/onemillion;
+ /* Now get the fractional part. */
+ tt.fraction = ((unsigned) tv.tv_usec + (unsigned)(offset%onemillion)) * (unsigned) TWO_TO_THE_32_OVER_ONE_MILLION;
+ if (tt.fraction > onemillion)
+ {
+ tt.fraction -= onemillion;
+ tt.seconds++;
+ }
+ return tt;
+}
+
/* end packOSC.c*/
diff --git a/osc/routeOSC-help.pd b/osc/routeOSC-help.pd
index 080ce50..53aec8a 100755
--- a/osc/routeOSC-help.pd
+++ b/osc/routeOSC-help.pd
@@ -1,35 +1,39 @@
-#N canvas 0 0 574 322 12;
-#X obj 58 82 udpreceive 9997;
-#X obj 173 106 unpack 0 0 0 0;
-#X floatatom 173 129 3 0 0 0 - - -;
-#X floatatom 208 129 3 0 0 0 - - -;
-#X floatatom 244 129 3 0 0 0 - - -;
-#X floatatom 280 129 3 0 0 0 - - -;
-#X text 137 128 from;
-#X obj 58 114 unpackOSC;
-#X obj 56 158 print;
-#X obj 70 206 routeOSC /test /west;
-#X obj 70 241 print a;
-#X obj 147 241 print b;
-#X obj 225 241 print c;
-#X msg 203 171 set /left;
-#X msg 294 171 set /left /right;
-#X text 10 7 routeOSC;
-#X text 10 25 accepts lists of floats that are interpreted as OSC packets
-;
-#X text 10 43 set message reassigns outputs;
-#X text 244 206 arguments are OSC addresses to route;
-#X text 296 284 2006/04/25 Martin Peach;
-#X connect 0 0 7 0;
-#X connect 0 1 1 0;
-#X connect 1 0 2 0;
-#X connect 1 1 3 0;
-#X connect 1 2 4 0;
-#X connect 1 3 5 0;
-#X connect 7 0 8 0;
-#X connect 7 0 9 0;
-#X connect 9 0 10 0;
-#X connect 9 1 11 0;
-#X connect 9 2 12 0;
-#X connect 13 0 9 0;
-#X connect 14 0 9 0;
+#N canvas 0 0 623 272 12;
+#X obj 58 69 udpreceive 9997;
+#X obj 188 97 unpack 0 0 0 0;
+#X floatatom 188 128 3 0 0 0 - - -;
+#X floatatom 228 128 3 0 0 0 - - -;
+#X floatatom 268 128 3 0 0 0 - - -;
+#X floatatom 309 128 3 0 0 0 - - -;
+#X text 148 127 from;
+#X obj 58 97 unpackOSC;
+#X obj 58 147 print;
+#X obj 70 206 routeOSC /test /west;
+#X obj 70 241 print a;
+#X obj 157 241 print b;
+#X obj 245 241 print c;
+#X msg 76 175 set /left;
+#X msg 193 175 set /left /right;
+#X text 10 7 routeOSC;
+#X text 10 25 accepts lists of floats that are interpreted as OSC packets
+;
+#X text 10 43 set message reassigns outputs;
+#X text 258 205 arguments are OSC addresses to route;
+#X obj 134 147 print timetag;
+#X text 329 244 2007/07/05 Martin Peach;
+#X text 423 121 see also:;
+#X obj 502 121 packOSC;
+#X connect 0 0 7 0;
+#X connect 0 1 1 0;
+#X connect 1 0 2 0;
+#X connect 1 1 3 0;
+#X connect 1 2 4 0;
+#X connect 1 3 5 0;
+#X connect 7 0 8 0;
+#X connect 7 0 9 0;
+#X connect 7 1 19 0;
+#X connect 9 0 10 0;
+#X connect 9 1 11 0;
+#X connect 9 2 12 0;
+#X connect 13 0 9 0;
+#X connect 14 0 9 0;
diff --git a/osc/unpackOSC.c b/osc/unpackOSC.c
index 191414b..e84bf97 100755
--- a/osc/unpackOSC.c
+++ b/osc/unpackOSC.c
@@ -4,6 +4,7 @@
/* Started by Martin Peach 20060420 */
/* This version tries to be standalone from LIBOSC MP 20060425 */
/* MP 20060505 fixed a bug (line 209) where bytes are wrongly interpreted as negative */
+/* MP 20070705 added timestamp outlet */
/* dumpOSC.c header follows: */
/*
Written by Matt Wright and Adrian Freed, The Center for New Music and
@@ -33,44 +34,39 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
*/
- /*
-
- dumpOSC.c
- server that displays OpenSoundControl messages sent to it
- for debugging client udp and UNIX protocol
+/*
- by Matt Wright, 6/3/97
- modified from dumpSC.c, by Matt Wright and Adrian Freed
+ dumpOSC.c
+ server that displays OpenSoundControl messages sent to it
+ for debugging client udp and UNIX protocol
- version 0.2: Added "-silent" option a.k.a. "-quiet"
+ by Matt Wright, 6/3/97
+ modified from dumpSC.c, by Matt Wright and Adrian Freed
- version 0.3: Incorporated patches from Nicola Bernardini to make
- things Linux-friendly. Also added ntohl() in the right places
- to support little-endian architectures.
-
+ version 0.2: Added "-silent" option a.k.a. "-quiet"
+ version 0.3: Incorporated patches from Nicola Bernardini to make
+ things Linux-friendly. Also added ntohl() in the right places
+ to support little-endian architectures.
- compile:
- cc -o dumpOSC dumpOSC.c
+ to-do:
- to-do:
+ More robustness in saying exactly what's wrong with ill-formed
+ messages. (If they don't make sense, show exactly what was
+ received.)
- More robustness in saying exactly what's wrong with ill-formed
- messages. (If they don't make sense, show exactly what was
- received.)
+ Time-based features: print time-received for each packet
- Time-based features: print time-received for each packet
+ Clean up to separate OSC parsing code from socket/select stuff
- Clean up to separate OSC parsing code from socket/select stuff
+ pd: branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/dumpOSC/dumpOSC.c
+ -------------
+ -- added pd functions
+ -- socket is made differently than original via pd mechanisms
+ -- tweaks for Win32 www.zeggz.com/raf 13-April-2002
+ -- the OSX changes from cnmat didnt make it here yet but this compiles
+ on OSX anyway.
- pd: branched from http://www.cnmat.berkeley.edu/OpenSoundControl/src/dumpOSC/dumpOSC.c
- -------------
- -- added pd functions
- -- socket is made differently than original via pd mechanisms
- -- tweaks for Win32 www.zeggz.com/raf 13-April-2002
- -- the OSX changes from cnmat didnt make it here yet but this compiles
- on OSX anyway.
-
*/
#if HAVE_CONFIG_H
@@ -79,46 +75,18 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
#include "m_pd.h"
-/* declarations */
-
-
#ifdef _WIN32
- #ifdef _MSC_VER
-// #include "OSC-common.h"
- #endif /* _MSC_VER */
#include <string.h>
#include <stdlib.h>
#include <winsock2.h>
#include <stdio.h>
#else
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
-// #include <unistd.h>
-// #include <fcntl.h>
- #include <sys/types.h>
-// #include <sys/stat.h>
- #include <netinet/in.h>
-// #include <rpc/rpc.h>
-// #include <sys/socket.h>
-// #include <sys/un.h>
-// #include <sys/times.h>
-// #include <sys/param.h>
-// #include <sys/time.h>
-// #include <sys/ioctl.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <netinet/in.h>
#include <ctype.h>
-// #include <arpa/inet.h>
-// #include <netdb.h>
-// #include <pwd.h>
-// #include <signal.h>
-// #include <grp.h>
-// #include <sys/file.h>
- //#include <sys/prctl.h>
-
-// #ifdef NEED_SCHEDCTL_AND_LOCK
-// #include <sys/schedctl.h>
-// #include <sys/lock.h>
-// #endif
#endif /* _WIN32 */
/* Declarations */
@@ -140,15 +108,14 @@ typedef struct _unpackOSC
{
t_object x_obj;
t_outlet *x_data_out;
+ t_outlet *x_timetag_out;
+ t_atom x_timetag[4];// timetag as four floats
t_atom x_data_at[MAX_MESG];// symbols making up the path + payload
int x_data_atc;// number of symbols to be output
- char x_raw[MAX_MESG];// bytes making up the entire OSC message
- int x_raw_c;// number of bytes in OSC message
+ char x_raw[MAX_MESG];// bytes making up the entire OSC message
+ int x_raw_c;// number of bytes in OSC message
} t_unpackOSC;
-#ifdef MSW
-__declspec(dllexport)
-#endif
void unpackOSC_setup(void);
static void *unpackOSC_new(void);
static void unpackOSC_free(t_unpackOSC *x);
@@ -167,7 +134,8 @@ static void *unpackOSC_new(void)
x = (t_unpackOSC *)pd_new(unpackOSC_class);
x->x_data_out = outlet_new(&x->x_obj, &s_list);
- x->x_raw_c = x->x_data_atc = 0;
+ x->x_timetag_out = outlet_new(&x->x_obj, &s_list);
+ x->x_raw_c = x->x_data_atc = 0;
return (x);
}
@@ -175,9 +143,6 @@ static void unpackOSC_free(t_unpackOSC *x)
{
}
-#ifdef MSW
-__declspec(dllexport)
-#endif
void unpackOSC_setup(void)
{
unpackOSC_class = class_new(gensym("unpackOSC"),
@@ -191,10 +156,13 @@ static void unpackOSC_list(t_unpackOSC *x, t_symbol *s, int argc, t_atom *argv)
{
int size, messageLen, i, j;
char *messageName, *args, *buf;
-
+ unsigned long timetag_s;
+ unsigned long timetag_ms;
+ unsigned short timetag[4];
+
if ((argc%4) != 0)
{
- post("unpackOSC: packet size (%d) not a multiple of 4 bytes: dropping packet", argc);
+ post("unpackOSC: packet size (%d) not a multiple of 4 bytes: dropping packet", argc);
return;
}
/* copy the list to a byte buffer, checking for bytes only */
@@ -202,28 +170,28 @@ static void unpackOSC_list(t_unpackOSC *x, t_symbol *s, int argc, t_atom *argv)
{
if (argv[i].a_type == A_FLOAT)
{
- j = (int)argv[i].a_w.w_float;
-// if ((j == argv[i].a_w.w_float) && (j >= 0) && (j <= 255))
+ j = (int)argv[i].a_w.w_float;
+// if ((j == argv[i].a_w.w_float) && (j >= 0) && (j <= 255))
// this can miss bytes between 128 and 255 because they are interpreted somewhere as negative
// , so change to this:
- if ((j == argv[i].a_w.w_float) && (j >= -128) && (j <= 255))
- {
+ if ((j == argv[i].a_w.w_float) && (j >= -128) && (j <= 255))
+ {
x->x_raw[i] = (char)j;
- }
+ }
else
{
- post("unpackOSC: data out of range (%d), dropping packet", argv[i].a_w.w_float);
+ post("unpackOSC: data out of range (%d), dropping packet", argv[i].a_w.w_float);
return;
}
}
else
- {
+ {
post("unpackOSC: data not float, dropping packet");
return;
}
}
x->x_raw_c = argc;
- buf = x->x_raw;
+ buf = x->x_raw;
if ((argc >= 8) && (strncmp(buf, "#bundle", 8) == 0))
{ /* This is a bundle message. */
@@ -242,7 +210,15 @@ static void unpackOSC_list(t_unpackOSC *x, t_symbol *s, int argc, t_atom *argv)
printf("unpackOSC: [ %lx%08lx\n", ntohl(*((unsigned long *)(buf+8))),
ntohl(*((unsigned long *)(buf+12))));
#endif
-
+/* split the timetag into 4 16-bit fragments so we can output them as floats */
+ timetag_s = ntohl(*((unsigned long *)(buf+8)));
+ timetag_ms = ntohl(*((unsigned long *)(buf+12)));
+ timetag[0] = (short)(timetag_s>>8);
+ timetag[1] = (short)(timetag_s & 0xFFFF);
+ timetag[2] = (short)(timetag_ms>>8);
+ timetag[3] = (short)(timetag_ms & 0xFFFF);
+ for (i = 0; i < 4; ++i) SETFLOAT(&x->x_timetag[i], (float)timetag[i]);
+ outlet_list(x->x_timetag_out, &s_list, 4, x->x_timetag);
/* Note: if we wanted to actually use the time tag as a little-endian
64-bit int, we'd have to word-swap the two 32-bit halves of it */
@@ -270,8 +246,8 @@ static void unpackOSC_list(t_unpackOSC *x, t_symbol *s, int argc, t_atom *argv)
if (i != argc)
{
- post("unpackOSC: This can't happen");
- }
+ post("unpackOSC: This can't happen");
+ }
#ifdef DEBUG
printf("]\n");
#endif
@@ -309,9 +285,9 @@ static int unpackOSC_path(t_unpackOSC *x, char *path)
{
int i;
- if (path[0] != '/')
+ if (path[0] != '/')
{
- post("unpackOSC: bad path (%s)", path);
+ post("unpackOSC: bad path (%s)", path);
return 0;
}
for (i = 1; i < MAX_MESG; ++i)
@@ -356,8 +332,8 @@ static void unpackOSC_Smessage(t_unpackOSC *x, void *v, int n)
static void unpackOSC_PrintTypeTaggedArgs(t_unpackOSC *x, void *v, int n)
{
char *typeTags, *thisType, *p;
- int myargc = x->x_data_atc;
- t_atom *mya = x->x_data_at;
+ int myargc = x->x_data_atc;
+ t_atom *mya = x->x_data_at;
typeTags = v;
@@ -459,7 +435,7 @@ static void unpackOSC_PrintTypeTaggedArgs(t_unpackOSC *x, void *v, int n)
myargc++;
}
}
- x->x_data_atc = myargc;
+ x->x_data_atc = myargc;
}
static void unpackOSC_PrintHeuristicallyTypeGuessedArgs(t_unpackOSC *x, void *v, int n, int skipComma)
@@ -468,8 +444,8 @@ static void unpackOSC_PrintHeuristicallyTypeGuessedArgs(t_unpackOSC *x, void *v,
int *ints;
float thisf;
char *chars, *string, *nextString;
- int myargc= x->x_data_atc;
- t_atom* mya = x->x_data_at;
+ int myargc= x->x_data_atc;
+ t_atom* mya = x->x_data_at;
/* Go through the arguments 32 bits at a time */
@@ -493,7 +469,7 @@ static void unpackOSC_PrintHeuristicallyTypeGuessedArgs(t_unpackOSC *x, void *v,
i++;
}
else if (thisf >= -1000.f && thisf <= 1000000.f &&
- (thisf <=0.0f || thisf >= SMALLEST_POSITIVE_FLOAT))
+ (thisf <=0.0f || thisf >= SMALLEST_POSITIVE_FLOAT))
{
#ifdef DEBUG
printf("%f ", thisf);
@@ -516,11 +492,11 @@ static void unpackOSC_PrintHeuristicallyTypeGuessedArgs(t_unpackOSC *x, void *v,
{
// unhandled .. ;)
#ifdef DEBUG
- post("unpackOSC: indeterminate type: 0x%x xx", ints[i]);
+ post("unpackOSC: indeterminate type: 0x%x xx", ints[i]);
#endif
i++;
}
- x->x_data_atc = myargc;
+ x->x_data_atc = myargc;
}
}
@@ -550,7 +526,7 @@ static char *unpackOSC_DataAfterAlignedString(char *string, char *boundary)
{
if (string + i >= boundary)
{
- post("unpackOSC: DataAfterAlignedString: Unreasonably long string");
+ post("unpackOSC: DataAfterAlignedString: Unreasonably long string");
return 0;
}
}
@@ -562,12 +538,12 @@ static char *unpackOSC_DataAfterAlignedString(char *string, char *boundary)
{
if (string + i >= boundary)
{
- post("unpackOSC: DataAfterAlignedString: Unreasonably long string");
+ post("unpackOSC: DataAfterAlignedString: Unreasonably long string");
return 0;
}
if (string[i] != '\0')
{
- post("unpackOSC:DataAfterAlignedString: Incorrectly padded string");
+ post("unpackOSC:DataAfterAlignedString: Incorrectly padded string");
return 0;
}
}