From 477488a5916e896669bf0bdda698e6184c24e74d Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Wed, 28 Jan 2009 21:42:46 +0000 Subject: Added an outlet for the array size. The outlet is updated with each incoming list or float. This makes it easier to append to existing arrays. svn path=/trunk/externals/mrpeach/; revision=10669 --- flist2tab/flist2tab.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'flist2tab') diff --git a/flist2tab/flist2tab.c b/flist2tab/flist2tab.c index 7217bd6..c4521ae 100644 --- a/flist2tab/flist2tab.c +++ b/flist2tab/flist2tab.c @@ -19,6 +19,7 @@ typedef struct _flist2tab t_symbol *x_arrayname; t_float x_ft1; t_float x_offset; + t_outlet *x_sizeout; } t_flist2tab; static void flist2tab_list(t_flist2tab *x, t_symbol *s, int argc, t_atom *argv); @@ -80,6 +81,8 @@ static void flist2tab_list(t_flist2tab *x, t_symbol *s, int argc, t_atom *argv) vec[i+offset] = argv[i].a_w.w_float; #endif } + /* output the size of the array */ + outlet_float(x->x_sizeout, npoints); } } @@ -119,6 +122,8 @@ static void flist2tab_float(t_flist2tab *x, t_float f) vec[offset] = f; #endif garray_redraw(a); + /* output the size of the array */ + outlet_float(x->x_sizeout, npoints); } } @@ -132,6 +137,7 @@ static void *flist2tab_new(t_symbol *s) t_flist2tab *x = (t_flist2tab *)pd_new(flist2tab_class); x->x_offset = 0; x->x_arrayname = s; + x->x_sizeout = outlet_new(&x->x_obj, &s_float); floatinlet_new(&x->x_obj, &x->x_offset); return (x); } -- cgit v1.2.1