Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22087
Modified Files: Tag: devel_0_39 desire.c Log Message: more observer stuff + cleanup
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.34 retrieving revision 1.1.2.35 diff -C2 -d -r1.1.2.34 -r1.1.2.35 *** desire.c 21 Oct 2005 15:38:28 -0000 1.1.2.34 --- desire.c 22 Oct 2005 14:23:35 -0000 1.1.2.35 *************** *** 74,78 **** t_appendix *d = self->g_adix; int i; ! for (i=0; i<d->nobs; i++) self->g_pd->c_notice(d->obs[i],self,argc,argv); }
--- 74,83 ---- t_appendix *d = self->g_adix; int i; ! for (i=0; i<d->nobs; i++) { ! t_notice ice = self->g_pd->c_notice; ! if (ice) ice(d->obs[i],self,argc,argv); ! else post("null func ptr for class %s",self->g_pd->c_name->s_name); ! ! } }
*************** *** 12531,12536 **** static void *bng_new(t_symbol *s, int argc, t_atom *argv) { ! t_iemgui *y = iemgui_new(bng_class); ! t_bng *x = (t_bng *)y; x->ftbreak = 250; x->fthold = 50; --- 12536,12540 ---- static void *bng_new(t_symbol *s, int argc, t_atom *argv) { ! t_bng *x = (t_bng *)iemgui_new(bng_class); x->ftbreak = 250; x->fthold = 50; *************** *** 12628,12635 **** }
! static void *toggle_new(t_symbol *s, int argc, t_atom *argv) ! { ! t_iemgui *y = iemgui_new(toggle_class); ! t_toggle *x = (t_toggle *)y; x->on=0.0; x->nonzero=1.0; --- 12632,12637 ---- }
! static void *toggle_new(t_symbol *s, int argc, t_atom *argv) { ! t_toggle *x = (t_toggle *)iemgui_new(toggle_class); x->on=0.0; x->nonzero=1.0; *************** *** 12771,12778 **** }
! static void *radio_new(t_symbol *s, int argc, t_atom *argv) ! { ! t_iemgui *y = iemgui_new(radio_class); ! t_radio *x = (t_radio *)y; x->on_old=x->on=0; x->number=8; --- 12773,12778 ---- }
! static void *radio_new(t_symbol *s, int argc, t_atom *argv) { ! t_radio *x = (t_radio *)iemgui_new(radio_class); x->on_old=x->on=0; x->number=8; *************** *** 12781,12786 **** CLAMP(x->number,1,128); CLAMP(x->on,0,x->number-1); ! x->on_old = x->on = y->isa&1 ? x->on : 0; ! outlet_new(&y->obj, &s_list); radio_reload(x,0,argc,argv); return x; --- 12781,12786 ---- CLAMP(x->number,1,128); CLAMP(x->on,0,x->number-1); ! x->on_old = x->on = x->isa&1 ? x->on : 0; ! outlet_new(&x->obj, &s_list); radio_reload(x,0,argc,argv); return x; *************** *** 12922,12929 **** }
! static void *slider_new(t_symbol *s, int argc, t_atom *argv) ! { ! t_iemgui *y = iemgui_new(slider_class); ! t_slider *x = (t_slider *)y; x->flavor=s; x->is_log=0; --- 12922,12927 ---- }
! static void *slider_new(t_symbol *s, int argc, t_atom *argv) { ! t_slider *x = (t_slider *)iemgui_new(slider_class); x->flavor=s; x->is_log=0; *************** *** 12931,12936 **** x->steady=0; x->max=(double)(IEM_SL_DEFAULTSIZE-1); ! if (isvert(x)) y->h=IEM_SL_DEFAULTSIZE; else y->w=IEM_SL_DEFAULTSIZE; ! outlet_new(&y->obj, &s_float); slider_reload(x,0,argc,argv); return x; --- 12929,12934 ---- x->steady=0; x->max=(double)(IEM_SL_DEFAULTSIZE-1); ! if (isvert(x)) x->h=IEM_SL_DEFAULTSIZE; else x->w=IEM_SL_DEFAULTSIZE; ! outlet_new(&x->obj, &s_float); slider_reload(x,0,argc,argv); return x; *************** *** 13053,13064 **** }
! static void *nbnew(t_symbol *s, int argc, t_atom *argv) ! { ! t_iemgui *y = iemgui_new(nbclass); ! t_nbx *x = (t_nbx *)y; x->log_height = 256; x->is_log = 0; ! y->w=5; ! y->h=14; x->min=-1.0e+37; x->max=1.0e+37; --- 13051,13060 ---- }
! static void *nbnew(t_symbol *s, int argc, t_atom *argv) { ! t_nbx *x = (t_nbx *)iemgui_new(nbclass); x->log_height = 256; x->is_log = 0; ! x->w=5; ! x->h=14; x->min=-1.0e+37; x->max=1.0e+37; *************** *** 13111,13118 **** };
! static t_class *vu_class; ! ! static void vu_check_height(t_vu *x, int h) ! { int n=MAX(h/IEM_VU_STEPS,2); x->led_size = n-1; --- 13107,13111 ---- };
! static void vu_check_height(t_vu *x, int h) { int n=MAX(h/IEM_VU_STEPS,2); x->led_size = n-1; *************** *** 13124,13130 **** {x->scale = !!fscale; gobj_changed(x,"scale");}
! static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av) ! { ! x->w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); if(ac>1) vu_check_height(x, (int)atom_getintarg(1, ac, av)); gobj_changed(x,0); --- 13117,13122 ---- {x->scale = !!fscale; gobj_changed(x,"scale");}
! static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av) { ! x->w = iemgui_clip_size((int)atom_getintarg(0, ac, av)); if(ac>1) vu_check_height(x, (int)atom_getintarg(1, ac, av)); gobj_changed(x,0); *************** *** 13168,13183 **** }
! static void *vu_new(t_symbol *s, int argc, t_atom *argv) ! { ! t_iemgui *y = iemgui_new(vu_class); ! t_vu *x = (t_vu *)y; ! x->out_rms = outlet_new(&y->obj, &s_float); ! x->out_peak = outlet_new(&y->obj, &s_float); ! y->h=IEM_VU_STEPS*3; x->scale = 1; x->peak = x->rms = 0; /* ??? */ x->fp = x->fr = -101.0; ! vu_check_height(x, y->h); ! inlet_new(&y->obj, &y->obj.ob_pd, &s_float, gensym("ft1")); vu_reload(x,0,argc,argv); return x; --- 13160,13175 ---- }
! static t_class *vu_class; ! ! static void *vu_new(t_symbol *s, int argc, t_atom *argv) { ! t_vu *x = (t_vu *)iemgui_new(vu_class); ! x->out_rms = outlet_new(&x->obj, &s_float); ! x->out_peak = outlet_new(&x->obj, &s_float); ! x->h=IEM_VU_STEPS*3; x->scale = 1; x->peak = x->rms = 0; /* ??? */ x->fp = x->fr = -101.0; ! vu_check_height(x, x->h); ! inlet_new(&x->obj, &x->obj.ob_pd, &s_float, gensym("ft1")); vu_reload(x,0,argc,argv); return x; *************** *** 13201,13211 **** static t_class *cnv_class;
! static void cnv_get_pos(t_cnv *x) ! { ! t_iemgui *y = (t_iemgui *)x; ! if(y->snd && y->snd->s_thing) { ! x->at[0].a_w.w_float = text_xpix(&y->obj, y->glist); ! x->at[1].a_w.w_float = text_ypix(&y->obj, y->glist); ! pd_list(y->snd->s_thing, &s_list, 2, x->at); } } --- 13193,13201 ---- static t_class *cnv_class;
! static void cnv_get_pos(t_cnv *x) { ! if(x->snd && x->snd->s_thing) { ! x->at[0].a_w.w_float = text_xpix(&x->obj, x->glist); ! x->at[1].a_w.w_float = text_ypix(&x->obj, x->glist); ! pd_list(x->snd->s_thing, &s_list, 2, x->at); } } *************** *** 13252,13262 **** static void *cnv_new(t_symbol *s, int argc, t_atom *argv) { ! t_iemgui *y = iemgui_new(cnv_class); ! t_cnv *x = (t_cnv *)y; ! y->bcol = 0xe0e0e0; ! y->fcol = 0x000000; ! y->lcol = 0x404040; ! y->w=100; ! y->h=60; cnv_reload(x,0,argc,argv); return x; --- 13242,13251 ---- static void *cnv_new(t_symbol *s, int argc, t_atom *argv) { ! t_cnv *x = (t_cnv *) iemgui_new(cnv_class); ! x->bcol = 0xe0e0e0; ! x->fcol = 0x000000; ! x->lcol = 0x404040; ! x->w=100; ! x->h=60; cnv_reload(x,0,argc,argv); return x; *************** *** 13317,13322 **** static void *dropper_new(t_symbol *s, int argc, t_atom *argv) { ! t_iemgui *y = iemgui_new(dropper_class); ! t_dropper *x = (t_dropper *)y; outlet_new((t_text *)x, &s_symbol); dropper_reload(x,0,argc,argv); --- 13306,13310 ---- static void *dropper_new(t_symbol *s, int argc, t_atom *argv) { ! t_dropper *x = (t_dropper *) iemgui_new(dropper_class); outlet_new((t_text *)x, &s_symbol); dropper_reload(x,0,argc,argv); *************** *** 13339,13342 **** --- 13327,13334 ---- // blah
+ void canvas_notice(t_gobj *x, struct _gobj *origin, int argc, t_atom *argv) { + post("canvas_notice(%p,%p,%d,...)",x,origin,argc); + } + void g_canvas_setup(void) { *************** *** 13434,13437 **** --- 13426,13430 ----
class_addmethod(c, (t_method)canvas_text_setto, gensym("text_setto"), A_GIMME, 0); + class_setnotice(c, canvas_notice); }