Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2762
Modified Files:
Tag: desiredata
desire.c
Log Message:
SET macro
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.11
retrieving revision 1.1.2.217.2.12
diff -C2 -d -r1.1.2.217.2.11 -r1.1.2.217.2.12
*** desire.c 2 Dec 2006 05:41:19 -0000 1.1.2.217.2.11
--- desire.c 2 Dec 2006 07:09:31 -0000 1.1.2.217.2.12
***************
*** 569,572 ****
--- 569,575 ----
void canvas_setgraph(t_canvas *x, int flag, int nogoprect);
+ #undef SET
+ #define SET(attr,value) gobj_changed(x,#attr), x->attr = (value);
+
static void canvas_coords(t_canvas *x, t_symbol *s, int argc, t_atom *argv) {
printf("scanargs = %d\n",
***************
*** 575,580 ****
else {
canvas_setgraph(x, atom_getintarg(6, argc, argv), 0);
! x->xmargin = atom_getintarg(7, argc, argv);
! x->ymargin = atom_getintarg(8, argc, argv);
}
gobj_changed(x,0);
--- 578,583 ----
else {
canvas_setgraph(x, atom_getintarg(6, argc, argv), 0);
! SET(xmargin, atom_getintarg(7, argc, argv));
! SET(ymargin, atom_getintarg(8, argc, argv));
}
gobj_changed(x,0);
***************
*** 613,618 ****
}
x->name = sym;
! x->x1 = x1; x->y1 = y1; x->x = (short)px1; x->pixwidth = (int)(px2-px1);
! x->x2 = x2; x->y2 = y2; x->y = (short)py1; x->pixheight = (int)(py2-py1);
x->font = (canvas_getcurrent() ? canvas_getcurrent()->font : 42 /*sys_defaultfont*/);
x->screenx1 = x->screeny1 = 0; x->screenx2 = 450; x->screeny2 = 300;
--- 616,621 ----
}
x->name = sym;
! SET(x1,x1); SET(y1,y1); SET(x,(short)px1); SET(pixwidth ,(int)(px2-px1));
! SET(x2,x2); SET(y2,y2); SET(y,(short)py1); SET(pixheight,(int)(py2-py1));
x->font = (canvas_getcurrent() ? canvas_getcurrent()->font : 42 /*sys_defaultfont*/);
x->screenx1 = x->screeny1 = 0; x->screenx2 = 450; x->screeny2 = 300;
***************
*** 1216,1222 ****
if (x->pixwidth <= 0) x->pixwidth = CANVAS_DEFGRAPHWIDTH;
if (x->pixheight <= 0) x->pixheight = CANVAS_DEFGRAPHHEIGHT;
! x->isgraph = 1;
if (!nogoprect && !x->goprect) {
! canvas_each(g,x) if (pd_checkobject(g)) {x->goprect = 1; break;}
}
if (canvas_isvisible(x) && x->goprect) canvas_redraw(x);
--- 1219,1225 ----
if (x->pixwidth <= 0) x->pixwidth = CANVAS_DEFGRAPHWIDTH;
if (x->pixheight <= 0) x->pixheight = CANVAS_DEFGRAPHHEIGHT;
! SET(isgraph,1);
if (!nogoprect && !x->goprect) {
! canvas_each(g,x) if (pd_checkobject(g)) {SET(goprect,1); break;}
}
if (canvas_isvisible(x) && x->goprect) canvas_redraw(x);
***************
*** 1231,1236 ****
pd_scanargs(argc,argv,"ffbffffffff",&xperpix,&yperpix,&graphme,
&x1,&y1,&x2,&y2,&xpix,&ypix,&xmargin,&ymargin);
! x->pixwidth = (int)xpix; x->pixheight = (int)ypix;
! x->xmargin = (int)xmargin; x->ymargin = (int)ymargin;
yperpix = -yperpix;
if (xperpix == 0) xperpix = 1;
--- 1234,1239 ----
pd_scanargs(argc,argv,"ffbffffffff",&xperpix,&yperpix,&graphme,
&x1,&y1,&x2,&y2,&xpix,&ypix,&xmargin,&ymargin);
! SET(pixwidth,(int)xpix); SET(pixheight,(int)ypix);
! SET(xmargin ,(int)xmargin); SET(ymargin ,(int)ymargin);
yperpix = -yperpix;
if (xperpix == 0) xperpix = 1;
***************
*** 1243,1249 ****
} else {
if (xperpix > 0) {x->x1=0; x->x2=xperpix;}
! else {x->x1 = -xperpix * (x->screenx2-x->screenx1); x->x2 = x->x1+xperpix;}
if (yperpix > 0) {x->y1=0; x->y2=yperpix;}
! else {x->y1 = -yperpix * (x->screeny2-x->screeny1); x->y2 = x->y1+yperpix;}
}
canvas_setgraph(x, graphme, 0);
--- 1246,1252 ----
} else {
if (xperpix > 0) {x->x1=0; x->x2=xperpix;}
! else {SET(x1,-xperpix * (x->screenx2-x->screenx1)); SET(x2,x->x1+xperpix);}
if (yperpix > 0) {x->y1=0; x->y2=yperpix;}
! else {SET(y1,-yperpix * (x->screeny2-x->screeny1)); SET(y2,x->y1+yperpix);}
}
canvas_setgraph(x, graphme, 0);
***************
*** 6761,6769 ****
if(x->ftbreak > x->fthold) {
int h = x->ftbreak;
! x->ftbreak = x->fthold;
! x->fthold = h;
}
! x->ftbreak = max(x->ftbreak,10);
! x->fthold = max(x->fthold, 50);
}
--- 6764,6772 ----
if(x->ftbreak > x->fthold) {
int h = x->ftbreak;
! SET(ftbreak,x->fthold);
! SET(fthold,h);
}
! SET(ftbreak,max(x->ftbreak,10));
! SET(fthold ,max(x->fthold, 50));
}
***************
*** 6788,6798 ****
static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) {
! x->h = x->w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
iemgui_size(x);
}
static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) {
! x->ftbreak = atom_getintarg(0, ac, av);
! x->fthold = atom_getintarg(1, ac, av);
bng_check_minmax(x);
}
--- 6791,6802 ----
static void bng_size(t_bng *x, t_symbol *s, int ac, t_atom *av) {
! SET(w,iemgui_clip_size((int)atom_getintarg(0, ac, av)));
! SET(h,x->w);
iemgui_size(x);
}
static void bng_flashtime(t_bng *x, t_symbol *s, int ac, t_atom *av) {
! SET(ftbreak,atom_getintarg(0, ac, av));
! SET(fthold ,atom_getintarg(1, ac, av));
bng_check_minmax(x);
}
***************
*** 6812,6816 ****
binbuf_update(x,gensym("bng"),argc,argv);
if (!bng_pickle(x,&foo)) return;
! x->h = x->w;
bng_check_minmax(x);
iemgui_constrain(x);
--- 6816,6820 ----
binbuf_update(x,gensym("bng"),argc,argv);
if (!bng_pickle(x,&foo)) return;
! SET(h,x->w);
bng_check_minmax(x);
iemgui_constrain(x);
***************
*** 6821,6827 ****
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;
! x->count = 0;
bng_check_minmax(x);
outlet_new(x, &s_bang);
--- 6825,6831 ----
static void *bng_new(t_symbol *s, int argc, t_atom *argv) {
t_bng *x = (t_bng *)iemgui_new(bng_class);
! SET(ftbreak,250);
! SET(fthold,50);
! SET(count,0);
bng_check_minmax(x);
outlet_new(x, &s_bang);
***************
*** 6863,6867 ****
static void toggle_bang(t_toggle *x) {
! x->on = x->on?0.0:x->nonzero;
gobj_changed(x,"on");
toggle_action(x);
--- 6867,6871 ----
static void toggle_bang(t_toggle *x) {
! SET(on,x->on?0.0:x->nonzero);
gobj_changed(x,"on");
toggle_action(x);
***************
*** 6878,6885 ****
static void toggle_fout (t_toggle *x, t_floatarg f) {toggle_set(x,f); toggle_action(x);}
static void toggle_loadbang(t_toggle *x) {if(iemgui_loadbang(x)) toggle_fout(x, (float)x->on);}
! static void toggle_nonzero(t_toggle *x, t_floatarg f) {if (f) x->nonzero = f;}
static void toggle_size(t_toggle *x, t_symbol *s, int ac, t_atom *av) {
! x->h = x->w = iemgui_clip_size((int)atom_getintarg(0, ac, av));
iemgui_size(x);
}
--- 6882,6890 ----
static void toggle_fout (t_toggle *x, t_floatarg f) {toggle_set(x,f); toggle_action(x);}
static void toggle_loadbang(t_toggle *x) {if(iemgui_loadbang(x)) toggle_fout(x, (float)x->on);}
! static void toggle_nonzero(t_toggle *x, t_floatarg f) {if (f) SET(nonzero,f);}
static void toggle_size(t_toggle *x, t_symbol *s, int ac, t_atom *av) {
! SET(w,iemgui_clip_size((int)atom_getintarg(0, ac, av)));
! SET(h,x->w);
iemgui_size(x);
}
***************
*** 6899,6905 ****
binbuf_update(x,gensym("tgl"),argc,argv);
if (!toggle_pickle(x,&foo)) return;
! x->h = x->w;
! x->on = x->isa&1 && x->on ? x->nonzero : 0.0;
! x->nonzero = argc==14 && IS_A_FLOAT(argv,13) ? atom_getfloatarg(13, argc, argv) : 1.0;
if (!x->nonzero) x->nonzero=1.0;
iemgui_constrain(x);
--- 6904,6910 ----
binbuf_update(x,gensym("tgl"),argc,argv);
if (!toggle_pickle(x,&foo)) return;
! SET(h,x->w);
! SET(on,x->isa&1 && x->on ? x->nonzero : 0.0);
! SET(nonzero,argc==14 && IS_A_FLOAT(argv,13) ? atom_getfloatarg(13, argc, argv) : 1.0);
if (!x->nonzero) x->nonzero=1.0;
iemgui_constrain(x);
***************
*** 6944,6951 ****
int old=x->on_old;
CLAMP(i,0,x->number-1);
! if(x->on!=old) x->on_old = x->on;
! x->on = i;
gobj_changed(x,"on");
! if(x->on!=old) x->on_old = old;
}
--- 6949,6956 ----
int old=x->on_old;
CLAMP(i,0,x->number-1);
! if(x->on!=old) SET(on_old,x->on);
! SET(on,i);
gobj_changed(x,"on");
! if(x->on!=old) SET(on_old,old);
}
***************
*** 6967,6971 ****
if (x->flavor == sym_vdl || x->flavor == sym_hdl) {
if(x->change && x->on!=x->on_old) radio_send2(x,x->on_old,0.0);
! x->on_old = x->on;
radio_send2(x,x->on,1.0);
} else {
--- 6972,6976 ----
if (x->flavor == sym_vdl || x->flavor == sym_hdl) {
if(x->change && x->on!=x->on_old) radio_send2(x,x->on_old,0.0);
! SET(on_old,x->on);
radio_send2(x,x->on,1.0);
} else {
***************
*** 6981,6995 ****
/* compatibility with earlier "hdial" behavior */
if(x->change && i!=x->on_old && (!forwardonly || iemgui_forward(x))) radio_send2(x,x->on_old,0.0);
! x->on_old = x->on;
! x->on = i;
gobj_changed(x,"on");
! x->on_old = x->on;
radio_send2(x,x->on,1.0);
if(!forwardonly || iemgui_forward(x)) radio_send2(x,x->on,1.0);
} else {
! x->on = i;
if (!forwardonly || iemgui_forward(x)) radio_send(x,x->on);
gobj_changed(x,"on");
! x->on_old = x->on;
}
}
--- 6986,7000 ----
/* compatibility with earlier "hdial" behavior */
if(x->change && i!=x->on_old && (!forwardonly || iemgui_forward(x))) radio_send2(x,x->on_old,0.0);
! SET(on_old,x->on);
! SET(on,i);
gobj_changed(x,"on");
! SET(on_old,x->on);
radio_send2(x,x->on,1.0);
if(!forwardonly || iemgui_forward(x)) radio_send2(x,x->on,1.0);
} else {
! SET(on,i);
if (!forwardonly || iemgui_forward(x)) radio_send(x,x->on);
gobj_changed(x,"on");
! SET(on_old,x->on);
}
}
***************
*** 7004,7010 ****
if(n != x->number) {
sys_mgui(x,"erase","");
! x->number = n;
CLAMP(x->on,0,x->number-1);
! x->on_old = x->on;
gobj_changed(x,"on");
gobj_changed(x,"number");
--- 7009,7015 ----
if(n != x->number) {
sys_mgui(x,"erase","");
! SET(number,n);
CLAMP(x->on,0,x->number-1);
! SET(on_old,x->on);
gobj_changed(x,"on");
gobj_changed(x,"number");
***************
*** 7013,7022 ****
static void radio_size(t_radio *x, t_float size) {
! x->h = x->w = iemgui_clip_size((int)size);
iemgui_size(x);
}
! static void radio_double_change(t_radio *x) {x->change = 1;}
! static void radio_single_change(t_radio *x) {x->change = 0;}
static int radio_pickle(t_radio *x, t_foo *foo) {
--- 7018,7028 ----
static void radio_size(t_radio *x, t_float size) {
! SET(w,iemgui_clip_size((int)size));
! SET(h,x->w);
iemgui_size(x);
}
! static void radio_double_change(t_radio *x) {SET(change,1);}
! static void radio_single_change(t_radio *x) {SET(change,0);}
static int radio_pickle(t_radio *x, t_foo *foo) {
***************
*** 7047,7051 ****
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, &s_list);
radio_reload(x,0,argc,argv);
--- 7053,7057 ----
CLAMP(x->number,1,128);
CLAMP(x->on,0,x->number-1);
! SET(on_old,x->on = x->isa&1 ? x->on : 0);
outlet_new(x, &s_list);
radio_reload(x,0,argc,argv);
***************
*** 7091,7096 ****
if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE;
if (isvert(x)) {x->h=w;} else {x->w=w;}
! if(x->val > m) {x->pos = m; x->val = x->pos;}
! x->k = span/l;
}
--- 7097,7102 ----
if(w < IEM_SL_MINSIZE) w = IEM_SL_MINSIZE;
if (isvert(x)) {x->h=w;} else {x->w=w;}
! if(x->val > m) {SET(pos,m); SET(val,x->pos);}
! SET(k,span/l);
}
***************
*** 7102,7109 ****
else { if (min >0.0) max = 0.01*min; }
}
! x->min = min;
! x->max = max;
double diff = x->is_log ? log(x->max/x->min) : (x->max-x->min);
! x->k = diff / (double)(isvert(x) ? (x->h-1) : (x->w-1));
}
--- 7108,7115 ----
else { if (min >0.0) max = 0.01*min; }
}
! SET(min,min);
! SET(max,max);
double diff = x->is_log ? log(x->max/x->min) : (x->max-x->min);
! SET(k,diff / (double)(isvert(x) ? (x->h-1) : (x->w-1)));
}
***************
*** 7113,7119 ****
else CLAMP(f,x->min,x->max);
//g = (x->is_log ? log(f/x->min) : (f-x->min)) / x->k;
! //x->val = (int)(100.0*g + 0.49999);
! x->val = (int)f;
! x->pos = x->val;
gobj_changed(x,"val");
gobj_changed(x,"pos");
--- 7119,7125 ----
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);
gobj_changed(x,"val");
gobj_changed(x,"pos");
***************
*** 7133,7141 ****
int b = ac>1 ? atom_getintarg(1,ac,av) : 0;
if (isvert(x)) {
! x->w = iemgui_clip_size(a);
if(ac>1) slider_check_width(x,b);
} else {
slider_check_width(x,a);
! if(ac>1) x->h = iemgui_clip_size(b);
}
iemgui_size(x);
--- 7139,7147 ----
int b = ac>1 ? atom_getintarg(1,ac,av) : 0;
if (isvert(x)) {
! SET(w,iemgui_clip_size(a));
if(ac>1) slider_check_width(x,b);
} else {
slider_check_width(x,a);
! if(ac>1) SET(h,iemgui_clip_size(b));
}
iemgui_size(x);
***************
*** 7143,7150 ****
static void slider_range(t_slider *x, t_float min, t_float max)
! {x->min = min; x->max = max; slider_check_minmax(x);}
static void slider_lin(t_slider *x) {x->is_log=0; slider_check_minmax(x);}
static void slider_log(t_slider *x) {x->is_log=1; slider_check_minmax(x);}
! static void slider_steady(t_slider *x, t_floatarg f) {x->steady = !!f;}
static void slider_float(t_slider *x, t_floatarg f) {slider_set(x,f);if(iemgui_forward(x))slider_bang(x);}
static void slider_loadbang(t_slider *x) {if(iemgui_loadbang(x)) slider_bang(x);}
--- 7149,7156 ----
static void slider_range(t_slider *x, t_float min, t_float max)
! {SET(min,min); SET(max,max); slider_check_minmax(x);}
static void slider_lin(t_slider *x) {x->is_log=0; slider_check_minmax(x);}
static void slider_log(t_slider *x) {x->is_log=1; slider_check_minmax(x);}
! static void slider_steady(t_slider *x, t_floatarg f) {SET(steady,!!f);}
static void slider_float(t_slider *x, t_floatarg f) {slider_set(x,f);if(iemgui_forward(x))slider_bang(x);}
static void slider_loadbang(t_slider *x) {if(iemgui_loadbang(x)) slider_bang(x);}
***************
*** 7165,7169 ****
binbuf_update(x,gensym((char *)(isvert(x)?"vsl":"hsl")),argc,argv);
if (!slider_pickle(x,&foo)) return;
! x->pos = x->val = x->isa&1 ? x->val : 0;
iemgui_constrain(x);
slider_check_minmax(x);
--- 7171,7175 ----
binbuf_update(x,gensym((char *)(isvert(x)?"vsl":"hsl")),argc,argv);
if (!slider_pickle(x,&foo)) return;
! SET(pos,x->val = x->isa&1 ? x->val : 0);
iemgui_constrain(x);
slider_check_minmax(x);
***************
*** 7224,7231 ****
if(max<=0.0 && min>0.0) max = 0.01*min;
}
! x->min = min;
! x->max = max;
CLAMP(x->val,x->min,x->max);
! x->k = x->is_log ? exp(log(x->max/x->min)/(double)(x->log_height)) : 1.0;
return x->val!=val;
}
--- 7230,7237 ----
if(max<=0.0 && min>0.0) max = 0.01*min;
}
! SET(min,min);
! SET(max,max);
CLAMP(x->val,x->min,x->max);
! SET(k,x->is_log ? exp(log(x->max/x->min)/(double)(x->log_height)) : 1.0);
return x->val!=val;
}
***************
*** 7240,7250 ****
static void nblog_height(t_nbx *x, t_floatarg lh) {
! x->log_height = max(10,(int)lh);
! x->k = x->is_log ? exp(log(x->max/x->min)/(double)(x->log_height)) : 1.0;
}
static void nbsize(t_nbx *x, t_symbol *s, int ac, t_atom *av) {
! x->w = max(1,(int)atom_getintarg(0, ac, av));
! if(ac > 1) x->h = max(8,(int)atom_getintarg(1, ac, av));
iemgui_size(x);
}
--- 7246,7256 ----
static void nblog_height(t_nbx *x, t_floatarg lh) {
! SET(log_height,max(10,(int)lh));
! SET(k,x->is_log ? exp(log(x->max/x->min)/(double)(x->log_height)) : 1.0);
}
static void nbsize(t_nbx *x, t_symbol *s, int ac, t_atom *av) {
! SET(w,max(1,(int)atom_getintarg(0, ac, av)));
! if(ac > 1) SET(h,max(8,(int)atom_getintarg(1, ac, av)));
iemgui_size(x);
}
***************
*** 7286,7290 ****
x->w=max(w,1);
nbcheck_minmax(x);
! x->w = max(x->w,1);
if (x->rcv) pd_bind(x,x->rcv);
gobj_changed(x,0);
--- 7292,7296 ----
x->w=max(w,1);
nbcheck_minmax(x);
! SET(w,max(x->w,1));
if (x->rcv) pd_bind(x,x->rcv);
gobj_changed(x,0);
***************
*** 7293,7298 ****
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;
--- 7299,7304 ----
static void *nbnew(t_symbol *s, int argc, t_atom *argv) {
t_nbx *x = (t_nbx *)iemgui_new(nbclass);
! SET(log_height,256);
! SET(is_log,0);
x->w=5;
x->h=14;
***************
*** 7300,7304 ****
x->max=1.0e+37;
x->buf[0]=0;
! x->change = 0;
outlet_new(x, &s_float);
nbreload(x,0,argc,argv);
--- 7306,7310 ----
x->max=1.0e+37;
x->buf[0]=0;
! SET(change,0);
outlet_new(x, &s_float);
nbreload(x,0,argc,argv);
***************
*** 7346,7358 ****
static void vu_check_height(t_vu *x, int h) {
int n=max(h/IEM_VU_STEPS,2);
! x->led_size = n-1;
! x->h = IEM_VU_STEPS * n;
gobj_changed(x,0);
}
! static void vu_scale(t_vu *x, t_floatarg fscale) {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);
--- 7352,7364 ----
static void vu_check_height(t_vu *x, int h) {
int n=max(h/IEM_VU_STEPS,2);
! SET(led_size,n-1);
! SET(h,IEM_VU_STEPS * n);
gobj_changed(x,0);
}
! static void vu_scale(t_vu *x, t_floatarg fscale) {SET(scale,!!fscale); gobj_changed(x,"scale");}
static void vu_size(t_vu *x, t_symbol *s, int ac, t_atom *av) {
! SET(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);
***************
*** 7401,7410 ****
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, &s_float);
! x->out_peak = outlet_new(x, &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,x,&s_float,gensym("ft1"));
--- 7407,7416 ----
static void *vu_new(t_symbol *s, int argc, t_atom *argv) {
t_vu *x = (t_vu *)iemgui_new(vu_class);
! SET(out_rms ,outlet_new(x, &s_float));
! SET(out_peak,outlet_new(x, &s_float));
x->h=IEM_VU_STEPS*3;
! SET(scale,1);
! SET(peak,x->rms = 0); /* ??? */
! SET(fp,x->fr = -101.0);
vu_check_height(x,x->h);
inlet_new(x,x,&s_float,gensym("ft1"));
***************
*** 7438,7446 ****
static void cnv_size(t_cnv *x, t_symbol *s, int ac, t_atom *av)
! {x->w = x->h = max(1,(int)atom_getintarg(0, ac, av)); iemgui_size(x);}
static void cnv_vis_size(t_cnv *x, t_symbol *s, int ac, t_atom *av) {
! x->vis_h = x->vis_w = max(1,(int)atom_getintarg(0, ac, av));
! if(ac > 1) x->vis_h = max(1,(int)atom_getintarg(1, ac, av));
gobj_changed(x,0);
}
--- 7444,7452 ----
static void cnv_size(t_cnv *x, t_symbol *s, int ac, t_atom *av)
! {SET(w,x->h = max(1,(int)atom_getintarg(0, ac, av))); iemgui_size(x);}
static void cnv_vis_size(t_cnv *x, t_symbol *s, int ac, t_atom *av) {
! SET(vis_h ,x->vis_w = max(1,(int)atom_getintarg(0, ac, av)));
! if(ac > 1) SET(vis_h,max(1,(int)atom_getintarg(1, ac, av)));
gobj_changed(x,0);
}
***************
*** 7460,7466 ****
binbuf_update(x,gensym("cnv"),argc,argv);
if (!cnv_pickle(x,&foo)) return;
! x->h = x->w = max(x->w,1);
! x->vis_w = max(x->vis_w,1);
! x->vis_h = max(x->vis_h,1);
x->at[0].a_type = x->at[1].a_type = A_FLOAT; //???
iemgui_constrain(x);
--- 7466,7472 ----
binbuf_update(x,gensym("cnv"),argc,argv);
if (!cnv_pickle(x,&foo)) return;
! SET(h,x->w = max(x->w,1));
! SET(vis_w,max(x->vis_w,1));
! SET(vis_h,max(x->vis_h,1));
x->at[0].a_type = x->at[1].a_type = A_FLOAT; //???
iemgui_constrain(x);
***************
*** 7472,7478 ****
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=15;
x->vis_w=100;
--- 7478,7484 ----
static void *cnv_new(t_symbol *s, int argc, t_atom *argv) {
t_cnv *x = (t_cnv *) iemgui_new(cnv_class);
! SET(bcol,0xe0e0e0);
! SET(fcol,0x000000);
! SET(lcol,0x404040);
x->w=15;
x->vis_w=100;
***************
*** 7503,7507 ****
static void dropper_symbol(t_dropper *x, t_symbol *s) {
! x->ds = s;
dropper_bang(x);
}
--- 7509,7513 ----
static void dropper_symbol(t_dropper *x, t_symbol *s) {
! SET(ds,s);
dropper_bang(x);
}
***************
*** 7521,7525 ****
binbuf_update(x,gensym("dropper"),argc,argv);
if (!dropper_pickle(x,&foo)) return;
! x->h = x->w;
if (x->rcv) pd_bind(x,x->rcv);
iemgui_constrain(x);
--- 7527,7531 ----
binbuf_update(x,gensym("dropper"),argc,argv);
if (!dropper_pickle(x,&foo)) return;
! SET(h,x->w);
if (x->rcv) pd_bind(x,x->rcv);
iemgui_constrain(x);