diff --git a/src/g_canvas.h b/src/g_canvas.h index 179eca2a278b4e0a66a9c0d6c0e3f68de0dfb263..fb096e7def5021556d135a6022efe7e66d036a6c 100644 --- a/src/g_canvas.h +++ b/src/g_canvas.h @@ -243,6 +243,7 @@ t_class *message_class; extern t_class *pdint_class; extern t_class *pdfloat_class; extern t_class *pdsymbol_class; +extern t_class *print_class; // iemgui t_class *bng_class; diff --git a/src/g_editor.c b/src/g_editor.c index 6588f3dfd6860a8ac38b639c2eebc25c756f9f45..77536a5ad9f1b1866a1e24ee35e2455ce403346a 100644 --- a/src/g_editor.c +++ b/src/g_editor.c @@ -600,8 +600,8 @@ void canvas_disconnect(t_canvas *x, // if we are dealing with a preset_node, make sure to also disconnect its invisible return node // we trust here that the object has been already connected to a valid object so we blindly - // disconnect first outlet with the first inlet - if (pd_class(&t.tr_ob->ob_g.g_pd) == preset_node_class) { + // disconnect first outlet with the first inlet (EXCEPTION: print object that cannot be connected back to) + if (pd_class(&t.tr_ob->ob_g.g_pd) == preset_node_class && pd_class(&t.tr_ob2->ob_g.g_pd) != print_class) { //fprintf(stderr,"gotta disconnect hidden one too...\n"); obj_disconnect(t.tr_ob2, 0, t.tr_ob, 0); } @@ -3023,8 +3023,9 @@ void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) pd_class(&y2->g_pd) != vu_class && pd_class(&y2->g_pd) != pdint_class && pd_class(&y2->g_pd) != pdfloat_class && - pd_class(&y2->g_pd) != pdsymbol_class) { - error("preset node currently works only with gui objects, ints, floats, and symbols...\n"); + pd_class(&y2->g_pd) != pdsymbol_class && + pd_class(&y2->g_pd) != print_class) { + error("preset node currently works only with gui objects, ints, floats, and symbols, plus a print object for node monitoring...\n"); return; } } @@ -4609,7 +4610,8 @@ void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno, if (!(oc = obj_connect(objsrc, outno, objsink, inno))) goto bad; // add auto-connect back to preset_node object // (by this time we know we are connecting only to legal objects who have at least one outlet) - if (pd_class(&objsrc->ob_pd) == preset_node_class) { + // EXCEPTION: we do not connect back to the print class + if (pd_class(&objsrc->ob_pd) == preset_node_class && pd_class(&sink->g_pd) != print_class) { //fprintf(stderr,"canvas_connect: gotta do auto-connect back to preset_node\n"); if (!canvas_isconnected(x, objsink, 0, objsrc, 0)) obj_connect(objsink, 0, objsrc, 0); diff --git a/src/x_interface.c b/src/x_interface.c index 231a0cf809ffd2f669c62d993e0ceb0341f7db2c..f1487122aa33ae8d40930b8a855b4760580e632b 100644 --- a/src/x_interface.c +++ b/src/x_interface.c @@ -7,7 +7,7 @@ #include "m_pd.h" /* -------------------------- print ------------------------------ */ -static t_class *print_class; +t_class *print_class; typedef struct _print {