diff options
author | N.N. <krzyszcz@users.sourceforge.net> | 2003-09-05 10:03:46 +0000 |
---|---|---|
committer | N.N. <krzyszcz@users.sourceforge.net> | 2003-09-05 10:03:46 +0000 |
commit | 53f05d96ff8e49c87977fa91a06ebade8893606e (patch) | |
tree | 51bd07eb57c532e61515fb85a0fcd83698054854 /shared/unstable/forky.c | |
parent | 672477f94d2d0701f75f2546ad79980dc9ac8543 (diff) |
*** empty log message ***
svn path=/trunk/externals/miXed/; revision=931
Diffstat (limited to 'shared/unstable/forky.c')
-rw-r--r-- | shared/unstable/forky.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/shared/unstable/forky.c b/shared/unstable/forky.c index 7fb6b08..1feae26 100644 --- a/shared/unstable/forky.c +++ b/shared/unstable/forky.c @@ -7,7 +7,32 @@ #include "shared.h" #include "unstable/forky.h" -//#define FORKY_DEBUG +#if FORKY_VERSION < 37 +/* need this for t_class::c_wb field access */ +#include "unstable/pd_imp.h" +#endif + +#define FORKY_DEBUG + +void forky_setsavefn(t_class *c, t_forkysavefn fn) +{ +#if FORKY_VERSION >= 37 + class_setsavefn(c, fn); +#else + if (c->c_wb->w_savefn) + { + /* cloning is necessary, because class_setwidget has not been called */ + t_widgetbehavior *wb = getbytes(sizeof(*wb)); /* never freed */ +#ifdef FORKY_DEBUG + post("cloning widgetbehavior..."); +#endif + *wb = *c->c_wb; + wb->w_savefn = fn; + class_setwidget(c, wb); + } + else c->c_wb->w_savefn = fn; +#endif +} /* To be called in a 'dsp' method -- e.g. if there are no feeders, the caller might use an optimized version of a 'perform' routine. @@ -18,7 +43,7 @@ int forky_hasfeeders(t_object *x, t_glist *glist, int inno, t_symbol *outsym) linetraverser_start(&t, glist); while (linetraverser_next(&t)) if (t.tr_ob2 == x && t.tr_inno == inno -#ifdef PD_VERSION /* FIXME ask Miller */ +#if FORKY_VERSION >= 36 && (!outsym || outsym == outlet_getsymbol(t.tr_outlet)) #endif ) |