aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_vumeter.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2005-08-16 04:06:28 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2005-08-16 04:06:28 +0000
commit8892fb6aabcbfd2c4695c154c22751b5fe5c9004 (patch)
treebd44e093cbc928e32560f70d4ca64fd593d5dc3c /pd/src/g_vumeter.c
parentccd93386bb8edff9991df8d8cabf71b73039c5e3 (diff)
Configure.in was broken. Also, better GUI update queueing for
IEM guis and for 'data' (which should affect arrays.) svn path=/trunk/; revision=3430
Diffstat (limited to 'pd/src/g_vumeter.c')
-rw-r--r--pd/src/g_vumeter.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/pd/src/g_vumeter.c b/pd/src/g_vumeter.c
index 983a28e4..ac6ee0ae 100644
--- a/pd/src/g_vumeter.c
+++ b/pd/src/g_vumeter.c
@@ -76,6 +76,21 @@ static void vu_update_peak(t_vu *x, t_glist *glist)
}
}
+static void vu_draw_update(t_gobj *client, t_glist *glist)
+{
+ t_vu *x = (t_vu *)client;
+ if (x->x_updaterms)
+ {
+ vu_update_rms(x, glist);
+ x->x_updaterms = 0;
+ }
+ if (x->x_updatepeak)
+ {
+ vu_update_peak(x, glist);
+ x->x_updatepeak = 0;
+ }
+}
+
static void vu_draw_new(t_vu *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
@@ -151,6 +166,8 @@ static void vu_draw_new(t_vu *x, t_glist *glist)
xpos+x->x_gui.x_w+1, ypos-1,
x, 1);
}
+ x->x_updaterms = x->x_updatepeak = 1;
+ sys_queuegui(x, x->x_gui.x_glist, vu_draw_update);
}
@@ -185,8 +202,8 @@ static void vu_draw_move(t_vu *x, t_glist *glist)
sys_vgui(".x%lx.c coords %lxSCALE%d %d %d\n",
canvas, x, i, end, yyy+k3);
}
- vu_update_peak(x, glist);
- vu_update_rms(x, glist);
+ x->x_updaterms = x->x_updatepeak = 1;
+ sys_queuegui(x, glist, vu_draw_update);
sys_vgui(".x%lx.c coords %lxLABEL %d %d\n",
canvas, x, xpos+x->x_gui.x_ldx,
ypos+x->x_gui.x_ldy);
@@ -572,7 +589,8 @@ static void vu_float(t_vu *x, t_floatarg rms)
rms = 0.01*(float)(i - 10000);
x->x_fr = rms;
outlet_float(x->x_out_rms, rms);
- vu_update_rms(x, x->x_gui.x_glist);
+ x->x_updaterms = 1;
+ sys_queuegui(x, x->x_gui.x_glist, vu_draw_update);
}
static void vu_ft1(t_vu *x, t_floatarg peak)
@@ -591,16 +609,17 @@ static void vu_ft1(t_vu *x, t_floatarg peak)
i = (int)(100.0*peak + 10000.5);
peak = 0.01*(float)(i - 10000);
x->x_fp = peak;
+ x->x_updatepeak = 1;
+ sys_queuegui(x, x->x_gui.x_glist, vu_draw_update);
outlet_float(x->x_out_peak, peak);
- vu_update_peak(x, x->x_gui.x_glist);
}
static void vu_bang(t_vu *x)
{
outlet_float(x->x_out_peak, x->x_fp);
outlet_float(x->x_out_rms, x->x_fr);
- vu_update_rms(x, x->x_gui.x_glist);
- vu_update_peak(x, x->x_gui.x_glist);
+ x->x_updaterms = x->x_updatepeak = 1;
+ sys_queuegui(x, x->x_gui.x_glist, vu_draw_update);
}
static void *vu_new(t_symbol *s, int argc, t_atom *argv)