[PD-cvs] pd/src desire.c,1.1.2.205,1.1.2.206
Mathieu Bouchard
matju at users.sourceforge.net
Tue Nov 28 01:55:28 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18810
Modified Files:
Tag: devel_0_39
desire.c
Log Message:
.
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.205
retrieving revision 1.1.2.206
diff -C2 -d -r1.1.2.205 -r1.1.2.206
*** desire.c 28 Nov 2006 00:44:54 -0000 1.1.2.205
--- desire.c 28 Nov 2006 00:55:24 -0000 1.1.2.206
***************
*** 86,89 ****
--- 86,90 ----
#define pd_bind(a,b) pd_bind((t_pd *)(a),b)
#define pd_unbind(a,b) pd_unbind((t_pd *)(a),b)
+ #define pd_checkobject(a) pd_checkobject((t_pd *)(a))
//--------------------------------------------------------------------------
***************
*** 457,461 ****
t_object *ob = 0;
t_gobj *y = t->from ? t->from->g_next : t->canvas->list;
! for (; y; y = y->g_next) if ((ob = pd_checkobject(&y->_class))) break;
if (!ob) return 0;
t->from = ob;
--- 458,462 ----
t_object *ob = 0;
t_gobj *y = t->from ? t->from->g_next : t->canvas->list;
! for (; y; y = y->g_next) if ((ob = pd_checkobject(y))) break;
if (!ob) return 0;
t->from = ob;
***************
*** 808,812 ****
static void canvas_loadbangabstractions(t_canvas *x) {
! canvas_each(y,x) if (pd_class(&y->_class) == canvas_class) {
if (canvas_isabstraction((t_canvas *)y))
canvas_loadbang((t_canvas *)y);
--- 809,813 ----
static void canvas_loadbangabstractions(t_canvas *x) {
! canvas_each(y,x) if (y->_class == canvas_class) {
if (canvas_isabstraction((t_canvas *)y))
canvas_loadbang((t_canvas *)y);
***************
*** 818,826 ****
void canvas_loadbangsubpatches(t_canvas *x) {
t_symbol *s = gensym("loadbang");
! canvas_each(y,x) if (pd_class(&y->_class) == canvas_class)
if (!canvas_isabstraction((t_canvas *)y))
canvas_loadbangsubpatches((t_canvas *)y);
canvas_each(y,x)
! if ((pd_class(&y->_class) != canvas_class) && zgetfn(&y->_class, s))
pd_vmess(&y->_class, s, "");
}
--- 819,827 ----
void canvas_loadbangsubpatches(t_canvas *x) {
t_symbol *s = gensym("loadbang");
! canvas_each(y,x) if (y->_class == canvas_class)
if (!canvas_isabstraction((t_canvas *)y))
canvas_loadbangsubpatches((t_canvas *)y);
canvas_each(y,x)
! if ((y->_class != canvas_class) && zgetfn(&y->_class, s))
pd_vmess(&y->_class, s, "");
}
***************
*** 974,978 ****
/* find all the "dsp" boxes and add them to the graph */
! canvas_each(y,x) if ((ob = pd_checkobject(&y->_class)) && zgetfn(&y->_class, dspsym)) ugen_add(dc, ob);
/* ... and all dsp interconnections */
--- 975,979 ----
/* find all the "dsp" boxes and add them to the graph */
! canvas_each(y,x) if ((ob = pd_checkobject(y)) && zgetfn(&y->_class, dspsym)) ugen_add(dc, ob);
/* ... and all dsp interconnections */
***************
*** 1090,1094 ****
t_symbol *s1 = gensym("struct");
canvas_each(g,x) {
! t_object *ob = pd_checkobject(&g->_class);
t_atom *argv;
if (!ob || ob->te_type != T_OBJECT || binbuf_getnatom(ob->te_binbuf) < 2) continue;
--- 1091,1095 ----
t_symbol *s1 = gensym("struct");
canvas_each(g,x) {
! t_object *ob = pd_checkobject(g);
t_atom *argv;
if (!ob || ob->te_type != T_OBJECT || binbuf_getnatom(ob->te_binbuf) < 2) continue;
***************
*** 1161,1165 ****
int i=0, nobj = canvas_getindex(gl, 0); /* number of objects */
for (t_gobj *g = gl->list; g && i < nobj; i++) {
! if (g != except && pd_class(&g->_class) == canvas_class &&
canvas_isabstraction((t_canvas *)g) &&
((t_canvas *)g)->name == name &&
--- 1162,1166 ----
int i=0, nobj = canvas_getindex(gl, 0); /* number of objects */
for (t_gobj *g = gl->list; g && i < nobj; i++) {
! if (g != except && g->_class == canvas_class &&
canvas_isabstraction((t_canvas *)g) &&
((t_canvas *)g)->name == name &&
***************
*** 1175,1179 ****
if (!hadwindow) canvas_vis(canvas_getcanvas(gl), 0);
} else {
! if (g != except && pd_class(&g->_class) == canvas_class)
canvas_doreload((t_canvas *)g, name, dir, except);
g = g->g_next;
--- 1176,1180 ----
if (!hadwindow) canvas_vis(canvas_getcanvas(gl), 0);
} else {
! if (g != except && g->_class == canvas_class)
canvas_doreload((t_canvas *)g, name, dir, except);
g = g->g_next;
***************
*** 1211,1215 ****
x->isgraph = 1;
if (!nogoprect && !x->goprect) {
! canvas_each(g,x) if (pd_checkobject(&g->_class)) {x->goprect = 1; break;}
}
if (canvas_isvisible(x) && x->goprect) canvas_redraw(x);
--- 1212,1216 ----
x->isgraph = 1;
if (!nogoprect && !x->goprect) {
! canvas_each(g,x) if (pd_checkobject(g)) {x->goprect = 1; break;}
}
if (canvas_isvisible(x) && x->goprect) canvas_redraw(x);
***************
*** 1270,1274 ****
if (myindex1 >= canvas_find_index1) {
canvas_each(y,x) {
! t_object *ob = pd_checkobject(&y->_class);
if (ob && binbuf_match(ob->ob_binbuf, canvas_findbuf)) {
if (myindex1 > canvas_find_index1 ||
--- 1271,1275 ----
if (myindex1 >= canvas_find_index1) {
canvas_each(y,x) {
! t_object *ob = pd_checkobject(y);
if (ob && binbuf_match(ob->ob_binbuf, canvas_findbuf)) {
if (myindex1 > canvas_find_index1 ||
***************
*** 1285,1289 ****
myindex2=0;
canvas_each(y,x) {
! if (pd_class(&y->_class) == canvas_class) {
(*myindex1p)++;
if (canvas_dofind((t_canvas *)y, myindex1p)) return 1;
--- 1286,1290 ----
myindex2=0;
canvas_each(y,x) {
! if (y->_class == canvas_class) {
(*myindex1p)++;
if (canvas_dofind((t_canvas *)y, myindex1p)) return 1;
***************
*** 1382,1386 ****
static int is_dummy (t_text *x) {
! return pd_class((t_pd *)x)==text_class && x->te_type==T_OBJECT;}
void canvas_connect(t_canvas *x, t_floatarg ffrom, t_floatarg foutlet, t_floatarg fto,t_floatarg finlet) {
--- 1383,1387 ----
static int is_dummy (t_text *x) {
! return x->_class==text_class && x->te_type==T_OBJECT;}
void canvas_connect(t_canvas *x, t_floatarg ffrom, t_floatarg foutlet, t_floatarg fto,t_floatarg finlet) {
***************
*** 1393,1398 ****
for (i=ifrom, gfrom=x->list; i>0; gfrom=gfrom->g_next, i--) if (!gfrom->g_next) goto bad;
for (i=ito, gto =x->list; i>0; gto =gto ->g_next, i--) if (!gto ->g_next) goto bad;
! from = pd_checkobject((t_pd *)gfrom);
! to = pd_checkobject( (t_pd *)gto);
if (!from || !to) goto bad;
/* if object creation failed, make dummy inlets or outlets as needed */
--- 1394,1399 ----
for (i=ifrom, gfrom=x->list; i>0; gfrom=gfrom->g_next, i--) if (!gfrom->g_next) goto bad;
for (i=ito, gto =x->list; i>0; gto =gto ->g_next, i--) if (!gto ->g_next) goto bad;
! from = pd_checkobject(gfrom);
! to = pd_checkobject( gto);
if (!from || !to) goto bad;
/* if object creation failed, make dummy inlets or outlets as needed */
***************
*** 1405,1410 ****
bad:
post("%s %d %d %d %d (%s->%s) connection failed", x->name->s_name,ifrom,outlet,ito,inlet,
! from ? class_getname(pd_class((t_pd *)from)) : "???",
! to ? class_getname(pd_class((t_pd *)to )) : "???");
}
--- 1406,1411 ----
bad:
post("%s %d %d %d %d (%s->%s) connection failed", x->name->s_name,ifrom,outlet,ito,inlet,
! from ? class_getname(from->_class) : "???",
! to ? class_getname( to->_class) : "???");
}
***************
*** 1712,1716 ****
x->listviewing = 1;
sprintf(cmdbuf, "pdtk_array_listview_new %%s %s %d\n", x->realname->s_name, 0);
! gfxstub_new(&x->x_gobj._class, x, cmdbuf);
for (int i=0; i < ARRAYPAGESIZE && i < a->n; i++) {
yval = *(float *)(a->vec + elemsize*i + yonset);
--- 1713,1717 ----
x->listviewing = 1;
sprintf(cmdbuf, "pdtk_array_listview_new %%s %s %d\n", x->realname->s_name, 0);
! gfxstub_new((t_pd *)x, x, cmdbuf);
for (int i=0; i < ARRAYPAGESIZE && i < a->n; i++) {
yval = *(float *)(a->vec + elemsize*i + yonset);
***************
*** 2294,2298 ****
}
gobj_changed(x,0);
! if (x->isgraph && !x->goprect && pd_checkobject(&y->_class)) {
x->goprect = 1;
canvas_drawredrect(x, 1);
--- 2295,2299 ----
}
gobj_changed(x,0);
! if (x->isgraph && !x->goprect && pd_checkobject(y)) {
x->goprect = 1;
canvas_drawredrect(x, 1);
***************
*** 2333,2337 ****
while ((y = x->list)) {
/* to avoid unnecessary DSP resorting, we suspend DSP only if we find a DSP object. */
! if (!suspended && pd_checkobject(&y->_class) && zgetfn(&y->_class, dspsym)) {
dspstate = canvas_suspend_dsp();
suspended = 1;
--- 2334,2338 ----
while ((y = x->list)) {
/* to avoid unnecessary DSP resorting, we suspend DSP only if we find a DSP object. */
! if (!suspended && pd_checkobject(y) && zgetfn(&y->_class, dspsym)) {
dspstate = canvas_suspend_dsp();
suspended = 1;
More information about the Pd-cvs
mailing list