Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3490
Modified Files: Tag: desiredata desire.c Log Message: slider: made ->val backwards-compatible and removed ->pos.
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.119 retrieving revision 1.1.2.217.2.120 diff -C2 -d -r1.1.2.217.2.119 -r1.1.2.217.2.120 *** desire.c 9 Jan 2007 22:36:48 -0000 1.1.2.217.2.119 --- desire.c 10 Jan 2007 00:23:56 -0000 1.1.2.217.2.120 *************** *** 5664,5668 ****
struct t_slider : t_iemgui { - int pos; int val; double min,max; --- 5664,5667 ---- *************** *** 5757,5765 **** if (binbuf_getnatom(b)) { if (!newest) { ! binbuf_print(b); ! post("... couldn't create"); } else if (!(x = pd_checkobject(newest))) { ! binbuf_print(b); ! post("... didn't return a patchable object"); } } --- 5756,5766 ---- if (binbuf_getnatom(b)) { if (!newest) { ! char *s = binbuf_gettext2(b); ! error("couldn't create %s",s); ! free(s); } else if (!(x = pd_checkobject(newest))) { ! char *s = binbuf_gettext2(b); ! error("didn't return a patchable object: %s",s); ! free(s); } } *************** *** 6767,6771 **** if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE; if (x->orient) SET(h,w); else SET(w,w); ! if(x->val > m) {SET(pos,m); SET(val,x->pos);} SET(k,span/l); } --- 6768,6772 ---- if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE; if (x->orient) SET(h,w); else SET(w,w); ! if(x->val > m) SET(val,m); SET(k,span/l); } *************** *** 6785,6795 ****
static void slider_set(t_slider *x, t_floatarg f) { - //double g; if(x->min > x->max) CLAMP(f,x->max,x->min); else CLAMP(f,x->min,x->max); ! //g = (x->is_log ? log(f/x->min) : (f-x->min)) / x->k; ! //SET(val,(int)(100.0*g + 0.49999)); ! SET(val,(int)f); ! SET(pos,x->val); }
--- 6786,6794 ----
static void slider_set(t_slider *x, t_floatarg f) { if(x->min > x->max) CLAMP(f,x->max,x->min); else CLAMP(f,x->min,x->max); ! double g = (x->is_log ? log(f/x->min) : (f-x->min)) / x->k; ! SET(val,(int)(100.0*g + 0.49999)); ! //SET(val,(int)f); }
*************** *** 6839,6846 **** binbuf_update(x,gensym((char *)(x->orient?"vsl":"hsl")),argc,argv); if (!slider_pickle(x,&foo)) return; - // fprintf(stderr,"STEADY=%d\n",x->steady); //this is wrong because it should happen when loading a file but not when loading from properties: SET(val,x->isa&1 ? x->val : 0); - SET(pos,x->val); //end wrong. iemgui_constrain(x); --- 6838,6843 ----