From 1160a5c9b9a89ad8ca2c14fd924a9733bb274996 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Tue, 7 Oct 2014 22:50:24 -0400 Subject: [PATCH] *removed ugen connect error when autopatching (in the case we create a blank object) --- pd/src/d_ugen.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pd/src/d_ugen.c b/pd/src/d_ugen.c index fcd2ed083..13fbea175 100644 --- a/pd/src/d_ugen.c +++ b/pd/src/d_ugen.c @@ -643,6 +643,9 @@ void ugen_add(t_dspcontext *dc, t_object *obj) uout->o_connections = 0, uout->o_nconnect = 0; } +extern t_class *text_class; +#include <stdio.h> + /* and then this to make all the connections. */ void ugen_connect(t_dspcontext *dc, t_object *x1, int outno, t_object *x2, int inno) @@ -661,8 +664,15 @@ void ugen_connect(t_dspcontext *dc, t_object *x1, int outno, t_object *x2, for (u2 = dc->dc_ugenlist; u2 && u2->u_obj != x2; u2 = u2->u_next); if (!u1 || !u2 || siginno < 0) { - pd_error(u1->u_obj, - "signal outlet connect to nonsignal inlet (ignored)"); + t_text *t2 = (t_text *)x2; + // The following only happens if the DAC is on while connecting + // objects. If this is not yet initialized object we don't + // really know if its inlet is signal or not, so we don't post + // the error. + if (pd_class(&t2->te_pd) != text_class || + (pd_class(&t2->te_pd) == text_class && t2->te_type == T_TEXT)) + pd_error(u1->u_obj, + "signal outlet connect to nonsignal inlet (ignored)"); return; } if (sigoutno < 0 || sigoutno >= u1->u_nout || siginno >= u2->u_nin) -- GitLab