Update of /cvsroot/pure-data/externals/miXed/cyclone/hammer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10934/cyclone/hammer
Modified Files:
Append.c Decode.c Makefile.objects Table.c bangbang.c coll.c
comment.c counter.c cycle.c funbuff.c gate.c hammer.c
maximum.c minimum.c mtr.c offer.c past.c prepend.c prob.c
seq.c switch.c urn.c
Log Message:
various bug-fixes, maxmode, toxy .#args
Index: funbuff.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/funbuff.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** funbuff.c 25 Apr 2004 10:37:27 -0000 1.3
--- funbuff.c 8 Dec 2004 15:40:11 -0000 1.4
***************
*** 1,8 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#include "m_pd.h"
- #include "unstable/fragile.h"
#include "common/loud.h"
#include "common/vefl.h"
--- 1,7 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
#include "m_pd.h"
#include "common/loud.h"
#include "common/vefl.h"
***************
*** 50,60 ****
/* LATER consider using extra fields, updated on the fly */
count = 1;
! xmin = np->n_index;
! xmax = x->x_tree.t_last->n_index;
! ymin = ymax = np->n_value;
while (np = np->n_next)
{
! if (np->n_value < ymin) ymin = np->n_value;
! else if (np->n_value > ymax) ymax = np->n_value;
count++;
}
--- 49,62 ----
/* LATER consider using extra fields, updated on the fly */
count = 1;
! xmin = np->n_key;
! xmax = x->x_tree.t_last->n_key;
! ymin = ymax = HAMMERNODE_GETFLOAT(np);
while (np = np->n_next)
{
! t_float f = HAMMERNODE_GETFLOAT(np);
! if (f < ymin)
! ymin = f;
! else if (f > ymax)
! ymax = f;
count++;
}
***************
*** 76,88 ****
if (x->x_valueset)
{
! if (np = hammertree_insert(&x->x_tree, ndx))
! np->n_value = x->x_value;
x->x_valueset = 0;
}
else if (np = hammertree_closest(&x->x_tree, ndx, 0))
! funbuff_dooutput(x, np->n_value, x->x_lastdelta);
/* CHECKED pointer is updated --
'next' outputs np also in a !valueset case (it is sent twice) */
! x->x_pointer = np;
x->x_pointerset = 0;
}
--- 78,89 ----
if (x->x_valueset)
{
! np = hammertree_insertfloat(&x->x_tree, ndx, x->x_value, 1);
x->x_valueset = 0;
}
else if (np = hammertree_closest(&x->x_tree, ndx, 0))
! funbuff_dooutput(x, HAMMERNODE_GETFLOAT(np), x->x_lastdelta);
/* CHECKED pointer is updated --
'next' outputs np also in a !valueset case (it is sent twice) */
! x->x_pointer = np; /* FIXME */
x->x_pointerset = 0;
}
***************
*** 121,127 ****
if (np = x->x_tree.t_first) /* CHECKED nop if empty */
{
! t_float result = np->n_value;
while (np = np->n_next)
! if (np->n_value < result) result = np->n_value;
funbuff_dooutput(x, result, x->x_lastdelta);
/* CHECKED pointer not updated */
--- 122,129 ----
if (np = x->x_tree.t_first) /* CHECKED nop if empty */
{
! t_float result = HAMMERNODE_GETFLOAT(np);
while (np = np->n_next)
! if (HAMMERNODE_GETFLOAT(np) < result)
! result = HAMMERNODE_GETFLOAT(np);
funbuff_dooutput(x, result, x->x_lastdelta);
/* CHECKED pointer not updated */
***************
*** 135,141 ****
if (np = x->x_tree.t_first) /* CHECKED nop if empty */
{
! t_float result = np->n_value;
while (np = np->n_next)
! if (np->n_value > result) result = np->n_value;
funbuff_dooutput(x, result, x->x_lastdelta);
/* CHECKED pointer not updated */
--- 137,144 ----
if (np = x->x_tree.t_first) /* CHECKED nop if empty */
{
! t_float result = HAMMERNODE_GETFLOAT(np);
while (np = np->n_next)
! if (HAMMERNODE_GETFLOAT(np) > result)
! result = HAMMERNODE_GETFLOAT(np);
funbuff_dooutput(x, result, x->x_lastdelta);
/* CHECKED pointer not updated */
***************
*** 157,164 ****
x->x_lastdelta = 0;
else if (np->n_prev)
! x->x_lastdelta = np->n_index - np->n_prev->n_index;
else
x->x_lastdelta = 0; /* CHECKED corrupt delta sent here... */
! funbuff_dooutput(x, np->n_value, x->x_lastdelta);
x->x_pointer = np->n_next;
x->x_pointerset = 0;
--- 160,167 ----
x->x_lastdelta = 0;
else if (np->n_prev)
! x->x_lastdelta = np->n_key - np->n_prev->n_key;
else
x->x_lastdelta = 0; /* CHECKED corrupt delta sent here... */
! funbuff_dooutput(x, HAMMERNODE_GETFLOAT(np), x->x_lastdelta);
x->x_pointer = np->n_next;
x->x_pointerset = 0;
***************
*** 186,193 ****
while (ac--)
{
! t_hammernode *np;
! if (np = hammertree_insert(&x->x_tree, (int)av++->a_w.w_float))
! np->n_value = av++->a_w.w_float;
! else return;
ac--;
}
--- 189,195 ----
while (ac--)
{
! int ndx = (int)av++->a_w.w_float;
! if (!hammertree_insertfloat(&x->x_tree, ndx, av++->a_w.w_float, 1))
! return;
ac--;
}
***************
*** 200,203 ****
--- 202,206 ----
t_atom *av;
char buf[MAXPDSTRING];
+ /* FIXME use open_via_path() */
canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
binbuf_read(bb, buf, "", 0);
***************
*** 227,231 ****
binbuf_addv(bb, "s", gensym("funbuff"));
for (np = x->x_tree.t_first; np; np = np->n_next)
! binbuf_addv(bb, "if", np->n_index, np->n_value);
canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
binbuf_write(bb, buf, "", 0);
--- 230,234 ----
binbuf_addv(bb, "s", gensym("funbuff"));
for (np = x->x_tree.t_first; np; np = np->n_next)
! binbuf_addv(bb, "if", np->n_key, HAMMERNODE_GETFLOAT(np));
canvas_makefilename(x->x_canvas, fn->s_name, buf, MAXPDSTRING);
binbuf_write(bb, buf, "", 0);
***************
*** 249,253 ****
binbuf_addv(bb, "ss", bindsym, gensym("set"));
for (; np; np = np->n_next)
! binbuf_addv(bb, "if", np->n_index, np->n_value);
binbuf_addsemi(bb);
}
--- 252,256 ----
binbuf_addv(bb, "ss", bindsym, gensym("set"));
for (; np; np = np->n_next)
! binbuf_addv(bb, "if", np->n_key, HAMMERNODE_GETFLOAT(np));
binbuf_addsemi(bb);
}
***************
*** 284,292 ****
t_hammernode *np;
if ((np = hammertree_search(&x->x_tree, ndx)) &&
! (ac == 1 || np->n_value == av[1].a_w.w_float))
{
if (np == x->x_pointer)
x->x_pointer = 0; /* CHECKED corrupt pointer left here... */
! hammertree_delete(&x->x_tree, np);
}
/* CHECKED mismatch silently ignored */
--- 287,295 ----
t_hammernode *np;
if ((np = hammertree_search(&x->x_tree, ndx)) &&
! (ac == 1 || HAMMERNODE_GETFLOAT(np) == av[1].a_w.w_float))
{
if (np == x->x_pointer)
x->x_pointer = 0; /* CHECKED corrupt pointer left here... */
! hammertree_delete(&x->x_tree, np); /* FIXME */
}
/* CHECKED mismatch silently ignored */
***************
*** 303,308 ****
{
/* CHECKED lastdelta preserved */
! if (np->n_value == f)
! funbuff_dooutput(x, np->n_index, x->x_lastdelta);
}
while (np = np->n_next);
--- 306,311 ----
{
/* CHECKED lastdelta preserved */
! if (HAMMERNODE_GETFLOAT(np) == f)
! funbuff_dooutput(x, np->n_key, x->x_lastdelta);
}
while (np = np->n_next);
***************
*** 319,325 ****
do
{
! x->x_lastdelta = np->n_value; /* CHECKED */
/* float value preserved (this is incompatible) */
! funbuff_dooutput(x, np->n_index, np->n_value);
}
while (np = np->n_next);
--- 322,328 ----
do
{
! x->x_lastdelta = HAMMERNODE_GETFLOAT(np); /* CHECKED */
/* float value preserved (this is incompatible) */
! funbuff_dooutput(x, np->n_key, x->x_lastdelta);
}
while (np = np->n_next);
***************
*** 337,348 ****
if (np1 = hammertree_closest(&x->x_tree, trunc, 0))
{
! float value = np1->n_value;
t_hammernode *np2 = np1->n_next;
if (np2)
{
! float delta = (float)(np2->n_index - np1->n_index);
/* this is incompatible -- CHECKED float argument is silently
truncated (which does not make much sense here), CHECKME again */
! float frac = f - np1->n_index;
if (frac < 0 || frac >= delta)
{
--- 340,351 ----
if (np1 = hammertree_closest(&x->x_tree, trunc, 0))
{
! float value = HAMMERNODE_GETFLOAT(np1);
t_hammernode *np2 = np1->n_next;
if (np2)
{
! float delta = (float)(np2->n_key - np1->n_key);
/* this is incompatible -- CHECKED float argument is silently
truncated (which does not make much sense here), CHECKME again */
! float frac = f - np1->n_key;
if (frac < 0 || frac >= delta)
{
***************
*** 365,374 ****
frac = *vec + (vec[1] - *vec) * vfrac;
}
! value += (np2->n_value - np1->n_value) * frac;
}
funbuff_dooutput(x, value, x->x_lastdelta); /* CHECKME !np2 */
}
else if (np1 = hammertree_closest(&x->x_tree, trunc, 1))
! funbuff_dooutput(x, np1->n_value, x->x_lastdelta); /* CHECKME */
}
--- 368,379 ----
frac = *vec + (vec[1] - *vec) * vfrac;
}
! value +=
! (HAMMERNODE_GETFLOAT(np2) - HAMMERNODE_GETFLOAT(np1)) * frac;
}
funbuff_dooutput(x, value, x->x_lastdelta); /* CHECKME !np2 */
}
else if (np1 = hammertree_closest(&x->x_tree, trunc, 1))
! /* CHECKME */
! funbuff_dooutput(x, HAMMERNODE_GETFLOAT(np1), x->x_lastdelta);
}
***************
*** 429,433 ****
static void funbuff_debug(t_funbuff *x, t_floatarg f)
{
! hammertree_debug(&x->x_tree, (int)f);
}
#endif
--- 434,438 ----
static void funbuff_debug(t_funbuff *x, t_floatarg f)
{
! hammertree_debug(&x->x_tree, (int)f, 0);
}
#endif
***************
*** 448,452 ****
x->x_lastdelta = 0;
x->x_embedflag = 0;
! hammertree_init(&x->x_tree, 0);
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
--- 453,457 ----
x->x_lastdelta = 0;
x->x_embedflag = 0;
! hammertree_inittyped(&x->x_tree, HAMMERTYPE_FLOAT, 0);
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
***************
*** 467,473 ****
{
funbuff_class = class_new(gensym("funbuff"),
! (t_newmethod)funbuff_new,
! (t_method)funbuff_free,
! sizeof(t_funbuff), 0, A_DEFSYM, 0);
class_addbang(funbuff_class, funbuff_bang);
class_addfloat(funbuff_class, funbuff_float);
--- 472,478 ----
{
funbuff_class = class_new(gensym("funbuff"),
! (t_newmethod)funbuff_new,
! (t_method)funbuff_free,
! sizeof(t_funbuff), 0, A_DEFSYM, 0);
class_addbang(funbuff_class, funbuff_bang);
class_addfloat(funbuff_class, funbuff_float);
Index: bangbang.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/bangbang.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bangbang.c 4 Jun 2003 11:50:14 -0000 1.2
--- bangbang.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 48,52 ****
--- 48,55 ----
nouts = BANGBANG_DEFOUTS;
if (nouts > BANGBANG_C74MAXOUTS)
+ {
+ shared_usecompatibility();
loud_incompatible_max(bangbang_class, BANGBANG_C74MAXOUTS, "outlets");
+ }
if (nouts > BANGBANG_DEFOUTS)
{
Index: cycle.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/cycle.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cycle.c 4 Jun 2003 11:50:14 -0000 1.2
--- cycle.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 120,123 ****
--- 120,124 ----
if (nouts > CYCLE_C74MAXOUTS)
{
+ shared_usecompatibility();
loud_incompatible_max(cycle_class, CYCLE_C74MAXOUTS, "outlets");
/* CHECKED: max clips with an error:
Index: seq.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/seq.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** seq.c 17 Apr 2004 17:45:27 -0000 1.5
--- seq.c 8 Dec 2004 15:40:11 -0000 1.6
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 12,26 ****
#include "common/loud.h"
[...1089 lines suppressed...]
! x->x_timescale = 1.;
! x->x_newtimescale = 1.;
x->x_prevtime = 0.;
x->x_slaveprevtime = 0.;
! x->x_seqsize = SEQ_INISEQSIZE;
x->x_nevents = 0;
x->x_sequence = x->x_seqini;
+ x->x_tempomapsize = SEQ_INITEMPOMAPSIZE;
+ x->x_ntempi = 0;
+ x->x_tempomap = x->x_tempomapini;
outlet_new((t_object *)x, &s_anything);
x->x_bangout = outlet_new((t_object *)x, &s_bang);
***************
*** 992,995 ****
--- 1045,1049 ----
class_addmethod(seq_class, (t_method)seq_print,
gensym("print"), 0);
+ forky_setpropertiesfn(seq_class, seq_properties);
hammerfile_setup(seq_class, 0);
}
Index: hammer.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/hammer.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hammer.c 11 Sep 2003 09:04:32 -0000 1.2
--- hammer.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 77,80 ****
--- 77,85 ----
return;
}
+ if (zgetfn(&pd_objectmaker, gensym("hammer")))
+ {
+ loud_error(0, "hammer is already loaded");
+ return;
+ }
if (!zgetfn(&pd_objectmaker, gensym("cyclone")))
post("this is hammer %s, %s %s build",
Index: past.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/past.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** past.c 4 Jun 2003 11:50:14 -0000 1.2
--- past.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 113,116 ****
--- 113,117 ----
if (ac > x->x_size)
{
+ shared_usecompatibility();
loud_incompatible_max(past_class, PAST_C74MAXSIZE, "guard points");
x->x_thresh = grow_nodata(&ac, &x->x_size, x->x_thresh,
Index: counter.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/counter.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** counter.c 23 May 2003 12:29:47 -0000 1.1.1.1
--- counter.c 8 Dec 2004 15:40:11 -0000 1.2
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 12,15 ****
--- 12,16 ----
#include "m_pd.h"
+ #include "common/loud.h"
#define COUNTER_UP 0
***************
*** 316,325 ****
int i3 = (int)f3;
int i;
! static int warned = 0;
! if (!warned)
{
! post("warning: counter is not fully compatible, \
! please report differences");
! warned = 1;
}
x->x_dir = COUNTER_UP;
--- 317,330 ----
int i3 = (int)f3;
int i;
! shared_usecompatibility();
! if (shared_getmaxcompatibility())
{
! static int warned = 0;
! if (!warned)
! {
! post("warning: counter is not fully compatible,\
! please report differences");
! warned = 1;
! }
}
x->x_dir = COUNTER_UP;
Index: urn.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/urn.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** urn.c 17 Apr 2004 17:45:27 -0000 1.3
--- urn.c 8 Dec 2004 15:40:11 -0000 1.4
***************
*** 123,126 ****
--- 123,127 ----
urn_resize(x, f1, 1);
urn_seed(x, f2); /* CHECKME */
+ shared_usecompatibility();
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
Index: maximum.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/maximum.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** maximum.c 4 Jun 2003 11:50:14 -0000 1.2
--- maximum.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 76,79 ****
--- 76,80 ----
x->x_last = 0; /* CHECKME */
x->x_test = f;
+ shared_usecompatibility();
floatinlet_new((t_object *)x, &x->x_test);
outlet_new((t_object *)x, &s_float);
Index: comment.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/comment.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** comment.c 19 Feb 2004 22:23:16 -0000 1.4
--- comment.c 8 Dec 2004 15:40:11 -0000 1.5
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 201,204 ****
--- 201,207 ----
{
/* LATER think about replacing #key binding/comment_float() with grabbing */
+ #ifdef COMMENT_DEBUG
+ post("comment_grabbedkey %g", f);
+ #endif
}
***************
*** 521,525 ****
problems now. */
/* glist_delete(x->x_glist, &x->x_text->te_g); */
! return;
}
else if (x->x_selstart && (x->x_selstart == x->x_selend))
--- 524,528 ----
problems now. */
/* glist_delete(x->x_glist, &x->x_text->te_g); */
! goto donefloat;
}
else if (x->x_selstart && (x->x_selstart == x->x_selend))
***************
*** 557,560 ****
--- 560,567 ----
}
else bug("comment_float");
+ donefloat:;
+ #ifdef COMMENT_DEBUG
+ post("donefloat");
+ #endif
}
***************
*** 626,630 ****
canvas_dirty(x->x_glist, 1);
clock_delay(x->x_transclock, 0); /* LATER rethink */
! return;
}
else if (!strcmp(keysym->s_name, "F5"))
--- 633,637 ----
canvas_dirty(x->x_glist, 1);
clock_delay(x->x_transclock, 0); /* LATER rethink */
! goto donelist;
}
else if (!strcmp(keysym->s_name, "F5"))
***************
*** 641,649 ****
canvas_dirty(x->x_glist, 1);
binbuf_free(bb);
! return;
}
! else return;
comment_update(x);
}
}
--- 648,660 ----
canvas_dirty(x->x_glist, 1);
binbuf_free(bb);
! goto donelist;
}
! else goto donelist;
comment_update(x);
}
+ donelist:;
+ #ifdef COMMENT_DEBUG
+ post("donelist");
+ #endif
}
***************
*** 831,834 ****
--- 842,847 ----
[$cvname index $tag @$x,$y] [$cvname bbox $tag]\\;}\n");
+ /* LATER think how to conditionally (FORKY_VERSION >= 38)
+ replace puts with pdtk_post */
sys_gui("proc comment_entext {enc tt} {\n\
set rr [catch {encoding convertfrom $enc $tt} tt1]\n\
Index: offer.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/offer.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** offer.c 23 May 2003 12:29:48 -0000 1.1.1.1
--- offer.c 8 Dec 2004 15:40:11 -0000 1.2
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 8,14 ****
/* As a class `derived' from the common hammertree code (also in funbuff),
! offer uses the auxiliary list, generally not needed here.
! As a side-effect, it gets a bonus of a small speedup of deletion,
! and a penalty of a small slowdown of insertion. */
typedef struct _offer
--- 8,14 ----
/* As a class `derived' from the common hammertree code (also in funbuff),
! offer maintains the auxiliary list, the main purpose of which is faster
! traversal (not needed here). As a side-effect, there is a bonus of a small
! speedup of deletion, and a penalty of a small slowdown of insertion. */
typedef struct _offer
***************
*** 30,40 ****
if (x->x_valueset)
{
! if (np = hammertree_insert(&x->x_tree, ndx))
! np->n_value = x->x_value;
x->x_valueset = 0;
}
else if (np = hammertree_search(&x->x_tree, ndx))
{
! outlet_float(((t_object *)x)->ob_outlet, np->n_value);
hammertree_delete(&x->x_tree, np);
}
--- 30,39 ----
if (x->x_valueset)
{
! hammertree_insertfloat(&x->x_tree, ndx, x->x_value, 1);
x->x_valueset = 0;
}
else if (np = hammertree_search(&x->x_tree, ndx))
{
! outlet_float(((t_object *)x)->ob_outlet, HAMMERNODE_GETFLOAT(np));
hammertree_delete(&x->x_tree, np);
}
***************
*** 58,62 ****
static void offer_debug(t_offer *x, t_floatarg f)
{
! hammertree_debug(&x->x_tree, (int)f);
}
#endif
--- 57,61 ----
static void offer_debug(t_offer *x, t_floatarg f)
{
! hammertree_debug(&x->x_tree, (int)f, 0);
}
#endif
***************
*** 71,75 ****
t_offer *x = (t_offer *)pd_new(offer_class);
x->x_valueset = 0;
! hammertree_init(&x->x_tree, 0);
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
--- 70,74 ----
t_offer *x = (t_offer *)pd_new(offer_class);
x->x_valueset = 0;
! hammertree_inittyped(&x->x_tree, HAMMERTYPE_FLOAT, 0);
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
Index: coll.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/coll.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** coll.c 25 Apr 2004 10:37:27 -0000 1.6
--- coll.c 8 Dec 2004 15:40:11 -0000 1.7
***************
*** 592,595 ****
--- 592,596 ----
if (!fn && !(fn = cc->c_filename)) /* !fn: 'readagain' */
return;
+ /* FIXME use open_via_path() */
if (cv || (cv = cc->c_lastcanvas)) /* !cv: 'read' w/o arg, 'readagain' */
canvas_makefilename(cv, fn->s_name, buf, MAXPDSTRING);
Index: prepend.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/prepend.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** prepend.c 17 Apr 2004 17:45:27 -0000 1.2
--- prepend.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 22,28 ****
--- 22,36 ----
int x_auxsize;
t_atom *x_auxbuf;
+ t_pd *x_proxy;
} t_prepend;
+ typedef struct _prependxy
+ {
+ t_pd xy_pd;
+ t_prepend *xy_owner;
+ } t_prependxy;
+
static t_class *prepend_class;
+ static t_class *prependxy_class;
/* Usually a preallocation method is used, except in special cases of:
***************
*** 33,42 ****
memcpying of the stored message (a small performance gain when the
preallocation method is chosen). Instead, self-invoked 'set'
! messages are postponed, using an auxiliary buffer.
! */
! static void prepend_dooutput(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
! if (s == &s_float)
{
if (ac > 1)
--- 41,50 ----
memcpying of the stored message (a small performance gain when the
preallocation method is chosen). Instead, self-invoked 'set'
! messages are postponed, using an auxiliary buffer. */
! /* called only from prepend_doanything() */
! static void prepend_dooutput(t_prepend *x, int ac, t_atom *av)
{
! if (x->x_selector == &s_float)
{
if (ac > 1)
***************
*** 45,113 ****
outlet_float(((t_object *)x)->ob_outlet, av->a_w.w_float);
}
! else if (s == &s_list)
outlet_list(((t_object *)x)->ob_outlet, &s_list, ac, av);
! else if (s)
/* CHECKED: 'bang' is prepended -- we cannot do so...
('symbol' cannot be compatible too) */
! {
! outlet_anything(((t_object *)x)->ob_outlet, s, ac, av);
! }
}
! static void prepend_anything(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
int reentered = x->x_entered;
- int prealloc = !reentered;
- int ntotal = x->x_natoms + ac;
- t_atom *buf;
x->x_entered = 1;
! if (s == &s_) s = 0;
! if (s)
! ntotal++;
! if (prealloc && ntotal > x->x_size)
! {
! if (ntotal > PREPEND_MAXSIZE)
! prealloc = 0;
! else
! {
! int nrequested = ntotal;
! x->x_message = grow_withdata(&nrequested, &x->x_natoms,
! &x->x_size, x->x_message,
! PREPEND_INISIZE, x->x_messini,
! sizeof(*x->x_message));
! prealloc = (nrequested == ntotal);
! }
! }
! if (prealloc)
{
! buf = x->x_message + x->x_natoms;
if (s)
{
! SETSYMBOL(buf, s);
! buf++;
}
! if (ac)
! memcpy(buf, av, ac * sizeof(*buf));
! prepend_dooutput(x, x->x_selector, ntotal, x->x_message);
! }
! else
! {
! /* LATER consider using the stack if ntotal <= MAXSTACK */
! if (buf = getbytes(ntotal * sizeof(*buf)))
{
! t_atom *bp = buf + x->x_natoms;
! if (x->x_natoms)
! memcpy(buf, x->x_message, x->x_natoms * sizeof(*buf));
if (s)
{
! SETSYMBOL(bp, s);
! bp++;
}
if (ac)
! memcpy(bp, av, ac * sizeof(*bp));
! prepend_dooutput(x, x->x_selector, ntotal, buf);
! freebytes(buf, ntotal * sizeof(*buf));
}
}
if (!reentered)
{
--- 53,124 ----
outlet_float(((t_object *)x)->ob_outlet, av->a_w.w_float);
}
! else if (x->x_selector == &s_list)
outlet_list(((t_object *)x)->ob_outlet, &s_list, ac, av);
! else /* x->x_selector guaranteed non-empty */
/* CHECKED: 'bang' is prepended -- we cannot do so...
('symbol' cannot be compatible too) */
! outlet_anything(((t_object *)x)->ob_outlet, x->x_selector, ac, av);
}
! static void prepend_doanything(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
int reentered = x->x_entered;
x->x_entered = 1;
! if (s == &s_)
! s = 0;
! if (s || x->x_natoms)
{
! int prealloc = !reentered;
! int ntotal = x->x_natoms + ac;
! t_atom *buf;
if (s)
+ ntotal++;
+ if (prealloc && ntotal > x->x_size)
{
! if (ntotal > PREPEND_MAXSIZE)
! prealloc = 0;
! else
! {
! int nrequested = ntotal;
! x->x_message = grow_withdata(&nrequested, &x->x_natoms,
! &x->x_size, x->x_message,
! PREPEND_INISIZE, x->x_messini,
! sizeof(*x->x_message));
! prealloc = (nrequested == ntotal);
! }
}
! if (prealloc)
{
! buf = x->x_message + x->x_natoms;
if (s)
{
! SETSYMBOL(buf, s);
! buf++;
}
if (ac)
! memcpy(buf, av, ac * sizeof(*buf));
! prepend_dooutput(x, ntotal, x->x_message);
! }
! else
! {
! /* LATER consider using the stack if ntotal <= MAXSTACK */
! if (buf = getbytes(ntotal * sizeof(*buf)))
! {
! t_atom *bp = buf + x->x_natoms;
! if (x->x_natoms)
! memcpy(buf, x->x_message, x->x_natoms * sizeof(*buf));
! if (s)
! {
! SETSYMBOL(bp, s);
! bp++;
! }
! if (ac)
! memcpy(bp, av, ac * sizeof(*bp));
! prepend_dooutput(x, ntotal, buf);
! freebytes(buf, ntotal * sizeof(*buf));
! }
}
}
+ else prepend_dooutput(x, ac, av);
if (!reentered)
{
***************
*** 137,157 ****
static void prepend_bang(t_prepend *x)
{
! t_atom at;
! SETSYMBOL(&at, &s_bang); /* CHECKED */
! prepend_anything(x, 0, 1, &at);
}
static void prepend_float(t_prepend *x, t_float f)
{
! t_atom at;
! SETFLOAT(&at, f);
! prepend_anything(x, 0, 1, &at);
}
static void prepend_symbol(t_prepend *x, t_symbol *s)
{
! t_atom at;
! SETSYMBOL(&at, s);
! prepend_anything(x, 0, 1, &at);
}
--- 148,180 ----
static void prepend_bang(t_prepend *x)
{
! if (x->x_selector)
! {
! t_atom at;
! SETSYMBOL(&at, &s_bang); /* CHECKED */
! prepend_doanything(x, 0, 1, &at);
! }
! else outlet_bang(((t_object *)x)->ob_outlet);
}
static void prepend_float(t_prepend *x, t_float f)
{
! if (x->x_selector)
! {
! t_atom at;
! SETFLOAT(&at, f);
! prepend_doanything(x, 0, 1, &at);
! }
! else outlet_float(((t_object *)x)->ob_outlet, f);
}
static void prepend_symbol(t_prepend *x, t_symbol *s)
{
! if (x->x_selector)
! {
! t_atom at;
! SETSYMBOL(&at, s);
! prepend_doanything(x, 0, 1, &at);
! }
! else outlet_symbol(((t_object *)x)->ob_outlet, s);
}
***************
*** 160,185 ****
static void prepend_list(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
! prepend_anything(x, 0, ac, av);
}
! static void prepend_set(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
! if (ac)
{
! int newsize;
! if (av->a_type == A_FLOAT)
! {
! if (ac > 1) x->x_selector = &s_list;
! else x->x_selector = &s_float;
! }
! else if (av->a_type == A_SYMBOL)
{
x->x_selector = av->a_w.w_symbol;
! ac--;
! av++;
}
else
return; /* LATER rethink */
! newsize = ac * 2;
if (x->x_entered)
{
--- 183,220 ----
static void prepend_list(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
! if (x->x_selector)
! prepend_doanything(x, 0, ac, av);
! else
! outlet_list(((t_object *)x)->ob_outlet, s, ac, av);
}
! static void prepend_anything(t_prepend *x, t_symbol *s, int ac, t_atom *av)
{
! if (x->x_selector)
! prepend_doanything(x, s, ac, av);
! else
! outlet_anything(((t_object *)x)->ob_outlet, s, ac, av);
! }
!
! static void prepend_doset(t_prepend *x, t_symbol *s, int ac, t_atom *av)
! {
! if (s)
! x->x_selector = s;
! else if (ac)
{
! if (av->a_type == A_SYMBOL)
{
x->x_selector = av->a_w.w_symbol;
! ac--; av++;
}
+ else if (av->a_type == A_FLOAT)
+ x->x_selector = (ac > 1 ? &s_list : &s_float);
else
return; /* LATER rethink */
! }
! else x->x_selector = 0;
! if (ac)
! {
! int newsize = ac * 2;
if (x->x_entered)
{
***************
*** 213,216 ****
--- 248,288 ----
}
}
+ else x->x_natoms = 0;
+ }
+
+ static void prepend_set(t_prepend *x, t_symbol *s, int ac, t_atom *av)
+ {
+ if (shared_getmaxcompatibility())
+ prepend_doset(x, 0, ac, av);
+ else
+ prepend_anything(x, s, ac, av);
+ }
+
+ static void prependxy_bang(t_prependxy *xy)
+ {
+ prepend_doset(xy->xy_owner, 0, 0, 0); /* LATER rethink */
+ }
+
+ static void prependxy_float(t_prependxy *xy, t_float f)
+ {
+ t_atom at;
+ SETFLOAT(&at, f);
+ prepend_doset(xy->xy_owner, &s_float, 1, &at);
+ }
+
+ static void prependxy_symbol(t_prependxy *xy, t_symbol *s)
+ {
+ prepend_doset(xy->xy_owner,
+ (s && s != &s_ ? s : &s_symbol), 0, 0); /* LATER rethink */
+ }
+
+ static void prependxy_list(t_prependxy *xy, t_symbol *s, int ac, t_atom *av)
+ {
+ prepend_doset(xy->xy_owner, &s_list, ac, av); /* LATER rethink */
+ }
+
+ static void prependxy_anything(t_prependxy *xy, t_symbol *s, int ac, t_atom *av)
+ {
+ prepend_doset(xy->xy_owner, s, ac, av);
}
***************
*** 219,222 ****
--- 291,301 ----
if (x->x_message != x->x_messini)
freebytes(x->x_message, x->x_size * sizeof(*x->x_message));
+ if (x->x_auxbuf)
+ {
+ bug("prepend_free"); /* LATER rethink */
+ freebytes(x->x_auxbuf, x->x_auxsize * sizeof(*x->x_auxbuf));
+ }
+ if (x->x_proxy)
+ pd_free(x->x_proxy);
}
***************
*** 230,242 ****
x->x_auxbuf = 0;
x->x_entered = 0;
! if (!ac)
{
! loud_incompatible(prepend_class,
! "creating an object without an argument");
! /* CHECKED: this is not compatible -- in max an object without an outlet
! is created, and there is no warning if loading from a file. */
}
outlet_new((t_object *)x, &s_anything);
- prepend_set(x, 0, ac, av);
return (x);
}
--- 309,331 ----
x->x_auxbuf = 0;
x->x_entered = 0;
! shared_usecompatibility();
! if (ac)
{
! x->x_proxy = 0;
! prepend_doset(x, 0, ac, av);
! }
! else
! {
! if (shared_getmaxcompatibility())
! /* CHECKED: this is still not compatible -- in max an object
! without an outlet is created, and there is no warning when
! loading from a file. */
! loud_incompatible(prepend_class,
! "creating an object without an argument");
! x->x_proxy = pd_new(prependxy_class);
! ((t_prependxy *)x->x_proxy)->xy_owner = x;
! inlet_new((t_object *)x, x->x_proxy, 0, 0);
}
outlet_new((t_object *)x, &s_anything);
return (x);
}
***************
*** 256,258 ****
--- 345,355 ----
class_addmethod(prepend_class, (t_method)prepend_set,
gensym("set"), A_GIMME, 0);
+
+ prependxy_class = class_new(gensym("prepend"), 0, 0, sizeof(t_prependxy),
+ CLASS_PD | CLASS_NOINLET, 0);
+ class_addbang(prependxy_class, prependxy_bang);
+ class_addfloat(prependxy_class, prependxy_float);
+ class_addsymbol(prependxy_class, prependxy_symbol);
+ class_addlist(prependxy_class, prependxy_list);
+ class_addanything(prependxy_class, prependxy_anything);
}
Index: minimum.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/minimum.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** minimum.c 4 Jun 2003 11:50:14 -0000 1.2
--- minimum.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 76,79 ****
--- 76,80 ----
x->x_last = 0; /* CHECKME */
x->x_test = f;
+ shared_usecompatibility();
floatinlet_new((t_object *)x, &x->x_test);
outlet_new((t_object *)x, &s_float);
Index: prob.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/prob.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** prob.c 23 Apr 2004 11:25:52 -0000 1.2
--- prob.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 275,278 ****
--- 275,279 ----
x->x_silent = 0;
rand_seed(&x->x_seed, 0);
+ shared_usecompatibility();
outlet_new((t_object *)x, &s_float);
x->x_bangout = outlet_new((t_object *)x, &s_bang);
Index: mtr.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/mtr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mtr.c 11 Sep 2003 09:04:32 -0000 1.3
--- mtr.c 8 Dec 2004 15:40:11 -0000 1.4
***************
*** 337,345 ****
{
float newtempo;
! static int warned = 0;
! if (!warned)
{
! loud_incompatible(mtr_class, "no 'tempo' control in Max");
! warned = 1;
}
if (f < 1e-20)
--- 337,348 ----
{
float newtempo;
! if (shared_getmaxcompatibility())
{
! static int warned = 0;
! if (!warned)
! {
! loud_incompatible(mtr_class, "no 'tempo' control in Max");
! warned = 1;
! }
}
if (f < 1e-20)
***************
*** 477,480 ****
--- 480,484 ----
char path[MAXPDSTRING];
FILE *fp;
+ /* FIXME use open_via_path() */
if (x->x_glist)
canvas_makefilename(x->x_glist, fname->s_name, path, MAXPDSTRING);
***************
*** 757,760 ****
--- 761,765 ----
x->x_filehandle = hammerfile_new((t_pd *)x, 0,
mtr_readhook, mtr_writehook, 0);
+ shared_usecompatibility();
if (ntracks > MTR_C74MAXTRACKS)
loud_incompatible_max(mtr_class, MTR_C74MAXTRACKS, "tracks");
Index: gate.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/gate.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gate.c 4 Jun 2003 11:50:14 -0000 1.2
--- gate.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 101,105 ****
--- 101,108 ----
nouts = GATE_DEFOUTS;
if (nouts > GATE_C74MAXOUTS)
+ {
+ shared_usecompatibility();
loud_incompatible_max(gate_class, GATE_C74MAXOUTS, "outlets");
+ }
nouts++; /* for convenience (the cost is one pointer) */
if (!(outs = (t_outlet **)getbytes(nouts * sizeof(*outs))))
Index: Decode.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/Decode.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Decode.c 4 Jun 2003 11:50:14 -0000 1.2
--- Decode.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 79,82 ****
--- 79,83 ----
if (nouts > DECODE_C74MAXOUTS)
{
+ shared_usecompatibility();
loud_incompatible_max(Decode_class, DECODE_C74MAXOUTS, "outlets");
if (!(outs = (t_outlet **)getbytes(nouts * sizeof(*outs))))
Index: switch.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/switch.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** switch.c 4 Jun 2003 11:50:14 -0000 1.2
--- switch.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 104,108 ****
--- 104,111 ----
nproxies = SWITCH_DEFINLETS;
if (nproxies > SWITCH_C74MAXINLETS)
+ {
+ shared_usecompatibility();
loud_incompatible_max(switch_class, SWITCH_C74MAXINLETS, "inlets");
+ }
if (!(proxies = (t_pd **)getbytes(nproxies * sizeof(*proxies))))
return (0);
Index: Makefile.objects
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/Makefile.objects,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile.objects 19 Sep 2003 12:19:32 -0000 1.2
--- Makefile.objects 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 7,13 ****
common/rand.o \
common/vefl.o \
- common/sq.o \
- common/bifi.o \
common/mifi.o \
common/binport.o \
common/port.o \
--- 7,12 ----
common/rand.o \
common/vefl.o \
common/mifi.o \
+ common/lex.o \
common/binport.o \
common/port.o \
Index: Append.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/Append.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Append.c 17 Apr 2004 17:45:27 -0000 1.2
--- Append.c 8 Dec 2004 15:40:11 -0000 1.3
***************
*** 1,3 ****
! /* Copyright (c) 2002-2003 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
--- 1,3 ----
! /* Copyright (c) 2002-2004 krzYszcz and others.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
***************
*** 22,28 ****
--- 22,36 ----
int x_auxsize;
t_atom *x_auxbuf;
+ t_pd *x_proxy;
} t_append;
+ typedef struct _appendxy
+ {
+ t_pd xy_pd;
+ t_append *xy_owner;
+ } t_appendxy;
+
static t_class *append_class;
+ static t_class *appendxy_class;
/* Usually a preallocation method is used, except in special cases of:
***************
*** 33,38 ****
memcpying of the stored message (a small performance gain when the
preallocation method is chosen). Instead, self-invoked 'set'
! messages are postponed, using an auxiliary buffer.
! */
/* Any Append's output goes through outlet_anything() -> typedmess() */
--- 41,45 ----
memcpying of the stored message (a small performance gain when the
preallocation method is chosen). Instead, self-invoked 'set'
! messages are postponed, using an auxiliary buffer. */
/* Any Append's output goes through outlet_anything() -> typedmess() */
***************
*** 133,139 ****
/* LATER gpointer */
! static void append_set(t_append *x, t_symbol *s, int ac, t_atom *av)
{
int newsize = ac * 2;
if (newsize > 0)
{
--- 140,148 ----
/* LATER gpointer */
! static void append_doset(t_append *x, t_symbol *s, int ac, t_atom *av)
{
int newsize = ac * 2;
+ if (s)
+ newsize += 2;
if (newsize > 0)
{
***************
*** 148,152 ****
if (x->x_auxbuf = getbytes(newsize * sizeof(*x->x_auxbuf)))
{
! memcpy(x->x_auxbuf + ac, av, ac * sizeof(*x->x_auxbuf));
x->x_auxsize = newsize;
}
--- 157,169 ----
if (x->x_auxbuf = getbytes(newsize * sizeof(*x->x_auxbuf)))
{
! t_atom *ap = x->x_auxbuf + ac;
! if (s)
! {
! ap++;
! SETSYMBOL(ap, s);
! ap++;
! }
! if (ac)
! memcpy(ap, av, ac * sizeof(*x->x_auxbuf));
x->x_auxsize = newsize;
}
***************
*** 162,169 ****
sizeof(*x->x_messbuf));
if (sz != newsize)
ac = sz / 2; /* LATER rethink */
}
- append_setnatoms(x, ac);
- ap = x->x_message;
while (ac--) *ap++ = *av++;
}
--- 179,200 ----
sizeof(*x->x_messbuf));
if (sz != newsize)
+ {
ac = sz / 2; /* LATER rethink */
+ if (s)
+ ac--;
+ }
+ }
+ if (s)
+ {
+ append_setnatoms(x, ac + 1);
+ ap = x->x_message;
+ SETSYMBOL(ap, s);
+ ap++;
+ }
+ else
+ {
+ append_setnatoms(x, ac);
+ ap = x->x_message;
}
while (ac--) *ap++ = *av++;
}
***************
*** 171,178 ****
--- 202,262 ----
}
+ static void append_set(t_append *x, t_symbol *s, int ac, t_atom *av)
+ {
+ if (shared_getmaxcompatibility())
+ append_doset(x, 0, ac, av);
+ else
+ append_anything(x, s, ac, av);
+ }
+
+ static void appendxy_bang(t_appendxy *xy)
+ {
+ append_doset(xy->xy_owner, 0, 0, 0); /* LATER rethink */
+ }
+
+ static void appendxy_float(t_appendxy *xy, t_float f)
+ {
+ t_atom at;
+ SETFLOAT(&at, f);
+ append_doset(xy->xy_owner, 0, 1, &at);
+ }
+
+ static void appendxy_symbol(t_appendxy *xy, t_symbol *s)
+ {
+ t_atom at;
+ if (!s || s == &s_)
+ s = &s_symbol; /* LATER rethink */
+ SETSYMBOL(&at, s);
+ append_doset(xy->xy_owner, 0, 1, &at);
+ }
+
+ static void appendxy_list(t_appendxy *xy, t_symbol *s, int ac, t_atom *av)
+ {
+ if (ac)
+ append_doset(xy->xy_owner, 0, ac, av);
+ else
+ { /* LATER rethink */
+ t_atom at;
+ SETSYMBOL(&at, &s_list);
+ append_doset(xy->xy_owner, 0, 1, &at);
+ }
+ }
+
+ static void appendxy_anything(t_appendxy *xy, t_symbol *s, int ac, t_atom *av)
+ {
+ append_doset(xy->xy_owner, s, ac, av);
+ }
+
static void append_free(t_append *x)
{
if (x->x_messbuf != x->x_messini)
freebytes(x->x_messbuf, x->x_size * sizeof(*x->x_messbuf));
+ if (x->x_auxbuf)
+ {
+ bug("append_free"); /* LATER rethink */
+ freebytes(x->x_auxbuf, x->x_auxsize * sizeof(*x->x_auxbuf));
+ }
+ if (x->x_proxy)
+ pd_free(x->x_proxy);
}
***************
*** 185,191 ****
x->x_auxbuf = 0;
x->x_entered = 0;
- outlet_new((t_object *)x, &s_anything);
append_setnatoms(x, 0);
! append_set(x, 0, ac, av);
return (x);
}
--- 269,286 ----
x->x_auxbuf = 0;
x->x_entered = 0;
append_setnatoms(x, 0);
! shared_usecompatibility();
! if (ac)
! {
! x->x_proxy = 0;
! append_doset(x, 0, ac, av);
! }
! else
! {
! x->x_proxy = pd_new(appendxy_class);
! ((t_appendxy *)x->x_proxy)->xy_owner = x;
! inlet_new((t_object *)x, x->x_proxy, 0, 0);
! }
! outlet_new((t_object *)x, &s_anything);
return (x);
}
***************
*** 205,207 ****
--- 300,310 ----
class_addmethod(append_class, (t_method)append_set,
gensym("set"), A_GIMME, 0);
+
+ appendxy_class = class_new(gensym("append"), 0, 0, sizeof(t_appendxy),
+ CLASS_PD | CLASS_NOINLET, 0);
+ class_addbang(appendxy_class, appendxy_bang);
+ class_addfloat(appendxy_class, appendxy_float);
+ class_addsymbol(appendxy_class, appendxy_symbol);
+ class_addlist(appendxy_class, appendxy_list);
+ class_addanything(appendxy_class, appendxy_anything);
}
Index: Table.c
===================================================================
RCS file: /cvsroot/pure-data/externals/miXed/cyclone/hammer/Table.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Table.c 25 Apr 2004 10:37:27 -0000 1.5
--- Table.c 8 Dec 2004 15:40:11 -0000 1.6
***************
*** 234,237 ****
--- 234,238 ----
if (!fn)
return; /* CHECKME complaint */
+ /* FIXME use open_via_path() */
if (cv || (cv = cc->c_lastcanvas)) /* !cv: 'read' w/o arg */
canvas_makefilename(cv, fn->s_name, buf, MAXPDSTRING);