aboutsummaryrefslogtreecommitdiff
path: root/slipdec
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2010-08-26 20:30:16 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2010-08-26 20:30:16 +0000
commit58ab0883540b6ccf682e410a78c4bb3c4f187de1 (patch)
treefc7041c855528025441a56bf2cd156d7ab5f3eaa /slipdec
parent3873fa04a49eaf8a240951c12f965fc9a4f891b9 (diff)
Applied zmoelnig's patch 3051663 to handle intermixed floats and lists as input.
svn path=/trunk/externals/mrpeach/; revision=13945
Diffstat (limited to 'slipdec')
-rw-r--r--slipdec/slipdec.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/slipdec/slipdec.c b/slipdec/slipdec.c
index 1a6cad2..49a8c94 100644
--- a/slipdec/slipdec.c
+++ b/slipdec/slipdec.c
@@ -29,6 +29,7 @@ typedef struct _slipdec
} t_slipdec;
static void *slipdec_new(t_symbol *s, int argc, t_atom *argv);
+static void slipdec_dump(t_slipdec *x, int dosend);
static void slipdec_list(t_slipdec *x, t_symbol *s, int ac, t_atom *av);
static void slipdec_float(t_slipdec *x, t_float f);
static void slipdec_verbosity(t_slipdec *x, t_float f);
@@ -53,6 +54,18 @@ static void *slipdec_new(t_symbol *s, int argc, t_atom *argv)
x->x_valid_SLIP = 1;
return (x);
}
+
+static void slipdec_dump(t_slipdec *x, int dosend)
+{
+ if(dosend)
+ {
+ if ((0 != x->x_valid_SLIP) && (x->x_slip_length > 0))
+ outlet_list(x->x_slipdec_out, &s_list, x->x_slip_length, x->x_slip_buf);
+ }
+
+ x->x_slip_length = x->x_esced = x->x_packet_index = 0;
+ x->x_valid_SLIP = 1;
+}
static void slipdec_list(t_slipdec *x, t_symbol *s, int ac, t_atom *av)
{
@@ -82,9 +95,12 @@ static void slipdec_list(t_slipdec *x, t_symbol *s, int ac, t_atom *av)
if(SLIP_END == c)
{
/* If it's the beginning of a packet, ignore it */
- if (0 == i) continue;
- /* send the packet */
- else break;
+ if (x->x_slip_length)
+ {
+ /* send the packet */
+ slipdec_dump(x, 1);
+ }
+ continue;
}
if (SLIP_ESC == c)
{