Commit 23e147cf authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

added sys_queuegui to all vanilla iemgui objects to optimize drawing

parent bdd61ee2
......@@ -215,6 +215,7 @@ typedef struct _iemgui
int label_offset_y;
int label_vis;
int x_vis; /* is the object drawn? */
int x_changed; /* has the value changed so that we need to do graphic update */
} t_iemgui;
typedef struct _iemguidummy
......
......@@ -35,13 +35,17 @@ static t_class *bng_class;
/* widget helper functions */
void bng_draw_update(t_bng *x, t_glist *glist)
void bng_draw_update(t_gobj *xgobj, t_glist *glist)
{
t_bng *x = (t_bng *)xgobj;
if (x->x_gui.x_changed != x->x_flashed) {
if(glist_isvisible(glist))
{
sys_vgui(".x%lx.c itemconfigure %lxBUT -fill #%6.6x\n", glist_getcanvas(glist), x,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol);
}
{
sys_vgui(".x%lx.c itemconfigure %lxBUT -fill #%6.6x\n", glist_getcanvas(glist), x,
x->x_flashed?x->x_gui.x_fcol:x->x_gui.x_bcol);
}
x->x_gui.x_changed = x->x_flashed;
}
}
void bng_draw_new(t_bng *x, t_glist *glist)
......@@ -492,7 +496,8 @@ static void bng__motionhook(t_scalehandle *sh,
void bng_draw(t_bng *x, t_glist *glist, int mode)
{
if(mode == IEM_GUI_DRAW_MODE_UPDATE)
bng_draw_update(x, glist);
sys_queuegui((t_gobj*)x, x->x_gui.x_glist, bng_draw_update);
//bng_draw_update(x, glist);
else if(mode == IEM_GUI_DRAW_MODE_MOVE)
bng_draw_move(x, glist);
else if(mode == IEM_GUI_DRAW_MODE_NEW) {
......@@ -875,6 +880,7 @@ static void *bng_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.label_vis = 0;
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.x_changed = 0;
return (x);
}
......
......@@ -17,6 +17,7 @@ Original Pure-Data source copyright (c) 1997-2001 Miller Puckette and others.
#include "g_undo.h"
#include "x_preset.h"
#include <string.h>
#include <math.h>
#include "g_all_guis.h"
void glist_readfrombinbuf(t_glist *x, t_binbuf *b, char *filename,
......@@ -3351,11 +3352,24 @@ void canvas_sort_selection_according_to_location(t_canvas *x)
}
void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, t_int tag, int issignal) {
int ymax = 0;
int halfx = (lx2 - lx1)/2;
int halfy = (ly2 - ly1)/2;
int yoff = abs((halfy+halfy)/2);
if (yoff < 2) yoff = 2;
if (yoff > 20) yoff = 20;
//int yoff = (abs(halfx)+abs(halfy))/2;
int yoff = abs(halfy);
//if (yoff < 2) yoff = 2;
if (halfy >= 0) {
//second object is below the first
if (abs(halfx) <=10) {
ymax = abs(halfy * pow((halfx/10.0),2));
if (ymax > 10) ymax = 10;
}
else ymax = 10;
} else {
//second object is above the first
ymax = 20;
}
if (yoff > ymax) yoff = ymax;
/*sys_vgui(".x%lx.c create polyline %d %d %d %d -stroke %s -strokewidth %s -tags {l%lx all_cords}\n",
x, lx1, ly1, lx2, ly2,
(issignal ? "$signal_cord" : "$msg_cord"),
......@@ -3373,11 +3387,25 @@ void canvas_drawconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, t_in
}
void canvas_updateconnection(t_canvas *x, int lx1, int ly1, int lx2, int ly2, t_int tag) {
int ymax = 0;
int halfx = (lx2 - lx1)/2;
int halfy = (ly2 - ly1)/2;
int yoff = abs((halfy+halfy)/2);
if (yoff < 2) yoff = 2;
if (yoff > 20) yoff = 20;
//int yoff = (abs(halfx)+abs(halfy))/2;
int yoff = abs(halfy);
//if (yoff < 2) yoff = 2;
if (halfy >= 0) {
//second object is below the first
if (abs(halfx) <=10) {
ymax = abs(halfy * pow((halfx/10.0),2));
if (ymax > 10) ymax = 10;
}
else ymax = 10;
} else {
//second object is above the first
ymax = 20;
}
//fprintf(stderr,"pow%f halfx%d yoff%d ymax%d\n", pow((halfx/10.0),2), halfx, yoff, ymax);
if (yoff > ymax) yoff = ymax;
if (tag) {
//sys_vgui(".x%lx.c coords l%lx %d %d %d %d\n", x, tag, lx1, ly1, lx2, ly2);
//bezier curves FTW
......
......@@ -652,13 +652,15 @@ static void hradio_set(t_hradio *x, t_floatarg f)
old = x->x_on_old;
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
x->x_on_old = old;
}
else
{
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
}
......@@ -724,7 +726,8 @@ static void hradio_fout(t_hradio *x, t_floatarg f)
{
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (i != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_float(x->x_gui.x_snd->s_thing, x->x_on);
......@@ -772,7 +775,8 @@ static void hradio_float(t_hradio *x, t_floatarg f)
{
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (i != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_gui.x_fsf.x_put_in2out)
{
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
......
......@@ -38,6 +38,7 @@ static t_class *hslider_class;
static void hslider_draw_update(t_gobj *client, t_glist *glist)
{
t_hslider *x = (t_hslider *)client;
if (x->x_gui.x_changed == 0) return;
t_canvas *canvas=glist_getcanvas(glist);
int ypos=text_ypix(&x->x_gui.x_obj, glist);
......@@ -64,6 +65,7 @@ static void hslider_draw_update(t_gobj *client, t_glist *glist)
}
}
}
x->x_gui.x_changed = 0;
}
static void hslider_draw_new(t_hslider *x, t_glist *glist)
......@@ -634,8 +636,11 @@ static void hslider_set(t_hslider *x, t_floatarg f) /* bugfix */
else
g = (f - x->x_min) / x->x_k;
x->x_val = (int)(100.0*g + 0.49999);
x->x_pos = x->x_val;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_pos != x->x_val) {
x->x_pos = x->x_val;
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
}
static void hslider_bang(t_hslider *x)
......@@ -724,6 +729,7 @@ static void hslider_motion(t_hslider *x, t_floatarg dx, t_floatarg dy)
}
if(old != x->x_val)
{
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
hslider_bang(x);
}
......@@ -738,8 +744,11 @@ static void hslider_click(t_hslider *x, t_floatarg xpos, t_floatarg ypos,
x->x_val = 100*x->x_gui.x_w - 100;
if(x->x_val < 0)
x->x_val = 0;
x->x_pos = x->x_val;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_pos != x->x_val) {
x->x_pos = x->x_val;
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
hslider_bang(x);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g, (t_glistmotionfn)hslider_motion,
0, xpos, ypos);
......@@ -970,6 +979,7 @@ static void *hslider_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.label_vis = 0;
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.x_changed = 0;
return (x);
}
......
......@@ -139,6 +139,9 @@ void my_numbox_ftoa(t_my_numbox *x)
static void my_numbox_draw_update(t_gobj *client, t_glist *glist)
{
t_my_numbox *x = (t_my_numbox *)client;
if (x->x_gui.x_changed == 0) {
return;
}
if (glist_isvisible(glist))
{
if(x->x_gui.x_fsf.x_change)
......@@ -183,6 +186,7 @@ static void my_numbox_draw_update(t_gobj *client, t_glist *glist)
x->x_buf[0] = 0;
}
}
x->x_gui.x_changed = 0;
}
static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist)
......@@ -758,6 +762,7 @@ static void my_numbox_save(t_gobj *z, t_binbuf *b)
{
x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
binbuf_addv(b, "ssiisiiffiisssiiiiiiifii", gensym("#X"),gensym("obj"),
......@@ -822,6 +827,7 @@ static void my_numbox_properties(t_gobj *z, t_glist *owner)
{
x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
......@@ -914,6 +920,7 @@ static void my_numbox_dialog(t_my_numbox *x, t_symbol *s, int argc,
static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
{
double k2=1.0;
int old = x->x_val;
if(x->x_gui.x_fsf.x_finemoved)
k2 = 0.01;
......@@ -922,9 +929,12 @@ static void my_numbox_motion(t_my_numbox *x, t_floatarg dx, t_floatarg dy)
else
x->x_val -= k2*dy;
my_numbox_clip(x);
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
my_numbox_bang(x);
clock_unset(x->x_clock_reset);
if (old != x->x_val) {
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
my_numbox_bang(x);
}
clock_unset(x->x_clock_reset);
}
static void my_numbox_click(t_my_numbox *x, t_floatarg xpos, t_floatarg ypos,
......@@ -960,6 +970,7 @@ static int my_numbox_newclick(t_gobj *z, struct _glist *glist,
x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
x->x_buf[0] = 0;
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
}
......@@ -968,9 +979,12 @@ static int my_numbox_newclick(t_gobj *z, struct _glist *glist,
static void my_numbox_set(t_my_numbox *x, t_floatarg f)
{
x->x_val = f;
my_numbox_clip(x);
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
if (x->x_val != f) {
x->x_val = f;
my_numbox_clip(x);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
}
static void my_numbox_log_height(t_my_numbox *x, t_floatarg lh)
......@@ -1033,6 +1047,7 @@ static void my_numbox_range(t_my_numbox *x, t_symbol *s, int ac, t_atom *av)
if(my_numbox_check_minmax(x, (double)atom_getfloatarg(0, ac, av),
(double)atom_getfloatarg(1, ac, av)))
{
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
/*my_numbox_bang(x);*/
}
......@@ -1074,6 +1089,7 @@ static void my_numbox_log(t_my_numbox *x)
x->x_lin0_log1 = 1;
if(my_numbox_check_minmax(x, x->x_min, x->x_max))
{
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
/*my_numbox_bang(x);*/
}
......@@ -1109,6 +1125,7 @@ static void my_numbox_key(void *z, t_floatarg fkey)
{
x->x_gui.x_fsf.x_change = 0;
clock_unset(x->x_clock_reset);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
return;
}
......@@ -1119,6 +1136,7 @@ static void my_numbox_key(void *z, t_floatarg fkey)
{
buf[0] = c;
strcat(x->x_buf, buf);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
}
......@@ -1129,6 +1147,7 @@ static void my_numbox_key(void *z, t_floatarg fkey)
if(sl < 0)
sl = 0;
x->x_buf[sl] = 0;
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
else if((c=='\n')||(c==13))
......@@ -1139,6 +1158,7 @@ static void my_numbox_key(void *z, t_floatarg fkey)
clock_unset(x->x_clock_reset);
my_numbox_clip(x);
my_numbox_bang(x);
x->x_gui.x_changed = 1;
sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
}
clock_delay(x->x_clock_reset, 3000);
......@@ -1280,6 +1300,7 @@ static void *my_numbox_new(t_symbol *s, int argc, t_atom *argv)
x->x_tmpfontsize = 0;
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.x_changed = 0;
return (x);
}
......
......@@ -36,17 +36,21 @@ static t_class *toggle_class;
/* widget helper functions */
void toggle_draw_update(t_toggle *x, t_glist *glist)
void toggle_draw_update(t_gobj *xgobj, t_glist *glist)
{
if(glist_isvisible(glist))
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxX1 -stroke #%6.6x\n", canvas, x,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol);
sys_vgui(".x%lx.c itemconfigure %lxX2 -stroke #%6.6x\n", canvas, x,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol);
}
t_toggle *x = (t_toggle *)xgobj;
if (x->x_gui.x_changed) {
if(glist_isvisible(glist))
{
t_canvas *canvas=glist_getcanvas(glist);
sys_vgui(".x%lx.c itemconfigure %lxX1 -stroke #%6.6x\n", canvas, x,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol);
sys_vgui(".x%lx.c itemconfigure %lxX2 -stroke #%6.6x\n", canvas, x,
(x->x_on!=0.0)?x->x_gui.x_fcol:x->x_gui.x_bcol);
}
x->x_gui.x_changed = 0;
}
}
void toggle_draw_new(t_toggle *x, t_glist *glist)
......@@ -495,7 +499,8 @@ static void toggle__motionhook(t_scalehandle *sh,
void toggle_draw(t_toggle *x, t_glist *glist, int mode)
{
if(mode == IEM_GUI_DRAW_MODE_UPDATE)
toggle_draw_update(x, glist);
sys_queuegui((t_gobj*)x, x->x_gui.x_glist, toggle_draw_update);
//toggle_draw_update(x, glist);
else if(mode == IEM_GUI_DRAW_MODE_MOVE)
toggle_draw_move(x, glist);
else if(mode == IEM_GUI_DRAW_MODE_NEW) {
......@@ -572,6 +577,7 @@ static void toggle_properties(t_gobj *z, t_glist *owner)
static void toggle_bang(t_toggle *x)
{
x->x_gui.x_changed = 1;
x->x_on = (x->x_on==0.0)?x->x_nonzero:0.0;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
......@@ -624,6 +630,7 @@ static int toggle_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix,
static void toggle_set(t_toggle *x, t_floatarg f)
{
if (x->x_on != f) x->x_gui.x_changed = 1;
x->x_on = f;
if(f != 0.0)
x->x_nonzero = f;
......@@ -798,6 +805,8 @@ static void *toggle_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.x_changed = 1;
return (x);
}
......
......@@ -642,13 +642,15 @@ static void vradio_set(t_vradio *x, t_floatarg f)
old = x->x_on_old;
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
x->x_on_old = old;
}
else
{
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
}
......@@ -715,7 +717,8 @@ static void vradio_fout(t_vradio *x, t_floatarg f)
{
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
if (x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_float(x->x_gui.x_snd->s_thing, x->x_on);
......@@ -763,7 +766,8 @@ static void vradio_float(t_vradio *x, t_floatarg f)
{
x->x_on_old = x->x_on;
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_on != x->x_on_old)
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_gui.x_fsf.x_put_in2out)
{
outlet_float(x->x_gui.x_obj.ob_outlet, x->x_on);
......
......@@ -38,6 +38,7 @@ static t_class *vslider_class;
static void vslider_draw_update(t_gobj *client, t_glist *glist)
{
t_vslider *x = (t_vslider *)client;
if (x->x_gui.x_changed == 0) return;
t_canvas *canvas=glist_getcanvas(glist);
if (glist_isvisible(glist))
{
......@@ -64,6 +65,7 @@ static void vslider_draw_update(t_gobj *client, t_glist *glist)
}
}
}
x->x_gui.x_changed = 0;
}
static void vslider_draw_new(t_vslider *x, t_glist *glist)
......@@ -706,8 +708,8 @@ static void vslider_motion(t_vslider *x, t_floatarg dx, t_floatarg dy)
x->x_pos -= 50;
x->x_pos -= x->x_pos%100;
}
if(old != x->x_val)
{
if(old != x->x_val) {
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
vslider_bang(x);
}
......@@ -722,8 +724,11 @@ static void vslider_click(t_vslider *x, t_floatarg xpos, t_floatarg ypos,
x->x_val = 100*x->x_gui.x_h - 100;
if(x->x_val < 0)
x->x_val = 0;
x->x_pos = x->x_val;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if (x->x_pos != x->x_val) {
x->x_pos = x->x_val;
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
vslider_bang(x);
glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.te_g,
(t_glistmotionfn)vslider_motion, 0, xpos, ypos);
......@@ -769,8 +774,11 @@ static void vslider_set(t_vslider *x, t_floatarg f)
else
g = (f - x->x_min) / x->x_k;
x->x_val = (int)(100.0*g + 0.49999);
x->x_pos = x->x_val;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
if(x->x_pos != x->x_val) {
x->x_pos = x->x_val;
x->x_gui.x_changed = 1;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
}
}
static void vslider_float(t_vslider *x, t_floatarg f)
......@@ -959,6 +967,7 @@ static void *vslider_new(t_symbol *s, int argc, t_atom *argv)
x->x_gui.label_vis = 0;
x->x_gui.x_obj.te_iemgui = 1;
x->x_gui.x_changed = 0;
return (x);
}
......
......@@ -686,6 +686,8 @@ static void vu__motionhook(t_scalehandle *sh,
void vu_draw(t_vu *x, t_glist *glist, int mode)
{
//fprintf(stderr,"vu_draw %d\n", mode);
if(mode == IEM_GUI_DRAW_MODE_UPDATE)
sys_queuegui((t_gobj*)x, x->x_gui.x_glist, vu_draw_update);
if(mode == IEM_GUI_DRAW_MODE_MOVE)
vu_draw_move(x, glist);
else if(mode == IEM_GUI_DRAW_MODE_NEW) {
......
......@@ -78,6 +78,7 @@ typedef struct _bindlist
} t_bindlist;
static int change_bindlist_via_graph = 0;
static t_bindlist *change_bindlist = NULL;
static void bindlist_cleanup(t_bindlist *x)
{
......@@ -109,69 +110,87 @@ static void bindlist_cleanup(t_bindlist *x)
static void bindlist_bang(t_bindlist *x)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_bang(e->e_who);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;
change_bindlist_via_graph = save;
change_bindlist = save_bindlist;
}
static void bindlist_float(t_bindlist *x, t_float f)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_float(e->e_who, f);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;
change_bindlist_via_graph = save;
change_bindlist = save_bindlist;
}
static void bindlist_symbol(t_bindlist *x, t_symbol *s)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_symbol(e->e_who, s);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;
change_bindlist_via_graph = save;
change_bindlist = save_bindlist;
}
static void bindlist_pointer(t_bindlist *x, t_gpointer *gp)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_pointer(e->e_who, gp);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;
change_bindlist_via_graph = save;
change_bindlist = save_bindlist;
}
static void bindlist_list(t_bindlist *x, t_symbol *s,
int argc, t_atom *argv)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_list(e->e_who, s, argc, argv);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;
change_bindlist_via_graph = save;
change_bindlist = save_bindlist;
}
static void bindlist_anything(t_bindlist *x, t_symbol *s,
int argc, t_atom *argv)
{
t_bindelem *e;
int save = change_bindlist_via_graph;
t_bindlist *save_bindlist = change_bindlist;
change_bindlist_via_graph = 1;
for (e = x->b_list; e; e = e->e_next)
if (e->e_who != NULL) pd_typedmess(e->e_who, s, argc, argv);
if (change_bindlist_via_graph > 1)
bindlist_cleanup(x);
change_bindlist_via_graph = 0;