aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2007-07-12 15:20:27 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2007-07-12 15:20:27 +0000
commit31573add9abbe5c25e1611c5d962f5f20c0f843c (patch)
treebd12d682c37389b1de998321e238de2267f24c5e
parent1e6df0a45bde37e2174b4611438d2c1de5a2c17a (diff)
Negative and zero delays now cause lists to pass straight through without clock_delay and memory allocation/copying.
svn path=/trunk/externals/mrpeach/; revision=8046
-rw-r--r--osc/pipelist.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/osc/pipelist.c b/osc/pipelist.c
index 14e9e7b..c561fed 100644
--- a/osc/pipelist.c
+++ b/osc/pipelist.c
@@ -84,19 +84,25 @@ static void pipelist_hang_tick(t_hang *h)
static void pipelist_list(t_pipelist *x, t_symbol *s, int ac, t_atom *av)
{
- t_hang *h = (t_hang *)getbytes(sizeof(t_hang));
- int i;
-
- h->h_n = ac;
- h->h_atoms = (t_atom *)getbytes(h->h_n*sizeof(t_atom));
-
- for (i = 0; i < h->h_n; ++i)
- h->h_atoms[i] = av[i];
- h->h_next = x->x_hang;
- x->x_hang = h;
- h->h_owner = x;
- h->h_clock = clock_new(h, (t_method)pipelist_hang_tick);
- clock_delay(h->h_clock, (x->x_deltime >= 0 ? x->x_deltime : 0));
+ if (x->x_deltime > 0)
+ { /* if delay is real, save the list for output in delay milliseconds */
+ t_hang *h;
+ int i;
+
+ h = (t_hang *)getbytes(sizeof(t_hang));
+ h->h_n = ac;
+ h->h_atoms = (t_atom *)getbytes(h->h_n*sizeof(t_atom));
+
+ for (i = 0; i < h->h_n; ++i)
+ h->h_atoms[i] = av[i];
+ h->h_next = x->x_hang;
+ x->x_hang = h;
+ h->h_owner = x;
+ h->h_clock = clock_new(h, (t_method)pipelist_hang_tick);
+ clock_delay(h->h_clock, (x->x_deltime >= 0 ? x->x_deltime : 0));
+ }
+ /* otherwise just pass the list straight through */
+ else outlet_list(x->x_pipelistout, &s_list, ac, av);
}
static void pipelist_flush(t_pipelist *x)