Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18254
Modified Files: Tag: impd_0_37 g_hslider.c Log Message: .
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.1.1.3.2.2.2.33 retrieving revision 1.1.1.3.2.2.2.34 diff -C2 -d -r1.1.1.3.2.2.2.33 -r1.1.1.3.2.2.2.34 *** g_hslider.c 13 Aug 2004 16:39:38 -0000 1.1.1.3.2.2.2.33 --- g_hslider.c 18 Aug 2004 19:09:09 -0000 1.1.1.3.2.2.2.34 *************** *** 24,35 **** static t_symbol *sym_vsl, *sym_vslider;
- /* widget helper functions */ - static int isvert(t_slider *x) { return x->x_flavor == sym_vsl || x->x_flavor == sym_vslider; }
- /* ------------------------ hsl widgetbehaviour----------------------------- */ - static void slider_getrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2) { --- 24,31 ---- *************** *** 59,70 **** if(min == 0.0 && max == 0.0) max = 1.0; if(max > 0.0) { if (min<=0.0) min = 0.01*max; } ! else { if(min > 0.0) max = 0.01*min; } } x->x_min = min; x->x_max = max; diff = x->x_is_log ? log(x->x_max/x->x_min) : (x->x_max-x->x_min); ! x->x_k = isvert(x) ? ! diff/(double)(x->x_gui.x_h-1) : ! diff/(double)(x->x_gui.x_w-1); }
--- 55,64 ---- if(min == 0.0 && max == 0.0) max = 1.0; if(max > 0.0) { if (min<=0.0) min = 0.01*max; } ! else { if (min >0.0) max = 0.01*min; } } x->x_min = min; x->x_max = max; diff = x->x_is_log ? log(x->x_max/x->x_min) : (x->x_max-x->x_min); ! x->x_k = diff / (double)(isvert(x) ? (x->x_gui.x_h-1) : (x->x_gui.x_w-1)); }
*************** *** 84,90 **** static void slider_bang(t_slider *x) { ! double out = x->x_is_log ? ! x->x_min*exp(x->x_k*(double)(x->x_val)*0.01) : ! (double)(x->x_val)*0.01*x->x_k + x->x_min; if (fabs(out) < 1.0e-10) out = 0.0; outlet_float(x->x_gui.x_obj.ob_outlet, out); --- 78,83 ---- static void slider_bang(t_slider *x) { ! double t = (double)(x->x_val)*x->x_k*0.01; ! double out = x->x_is_log ? x->x_min*exp(t) : x->x_min+t; if (fabs(out) < 1.0e-10) out = 0.0; outlet_float(x->x_gui.x_obj.ob_outlet, out); *************** *** 98,104 **** int b = ac>1 ? atom_getintarg(1,ac,av) : 0; if (isvert(x)) { ! x->x_gui.x_w = iemgui_clip_size(a); if(ac>1) slider_check_width(x,b); } else { ! slider_check_width(x,a); if(ac>1) x->x_gui.x_h = iemgui_clip_size(b); } iemgui_size((t_iemgui *)x); --- 91,99 ---- int b = ac>1 ? atom_getintarg(1,ac,av) : 0; if (isvert(x)) { ! x->x_gui.x_w = iemgui_clip_size(a); ! if(ac>1) slider_check_width(x,b); } else { ! slider_check_width(x,a); ! if(ac>1) x->x_gui.x_h = iemgui_clip_size(b); } iemgui_size((t_iemgui *)x); *************** *** 107,111 **** static void slider_range(t_slider *x, t_float min, t_float max) {x->x_min = min; x->x_max = max; slider_check_minmax(x);} ! static void slider_lin(t_slider *x) {x->x_is_log=0; x->x_k = (x->x_max-x->x_min)/(double)((isvert(x)?x->x_gui.x_h:x->x_gui.x_w)-1);} static void slider_log(t_slider *x) {x->x_is_log=1; slider_check_minmax(x);} static void slider_steady(t_slider *x, t_floatarg f) {x->x_steady = !!f;} --- 102,106 ---- static void slider_range(t_slider *x, t_float min, t_float max) {x->x_min = min; x->x_max = max; slider_check_minmax(x);} ! static void slider_lin(t_slider *x) {x->x_is_log=0; slider_check_minmax(x);} static void slider_log(t_slider *x) {x->x_is_log=1; slider_check_minmax(x);} static void slider_steady(t_slider *x, t_floatarg f) {x->x_steady = !!f;}