Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1:/tmp/cvs-serv10649
Modified Files: Tag: devel_0_37 configure configure.in d_delay.c d_global.c d_osc.c g_all_guis.c g_all_guis.h g_bang.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c g_rtext.c g_scalar.c g_toggle.c g_vdial.c g_vslider.c g_vumeter.c m_binbuf.c m_pd.h notes.txt s_audio.c s_audio_alsa.c s_audio_oss.c s_main.c s_midi.c s_midi_pm.c x_midi.c Log Message: merge with millers version 0.37-1
Index: configure =================================================================== RCS file: /cvsroot/pure-data/pd/src/configure,v retrieving revision 1.1.1.4.2.5 retrieving revision 1.1.1.4.2.6 diff -C2 -d -r1.1.1.4.2.5 -r1.1.1.4.2.6 *** configure 6 Oct 2003 16:40:57 -0000 1.1.1.4.2.5 --- configure 18 Nov 2003 10:34:08 -0000 1.1.1.4.2.6 *************** *** 5892,5896 **** -DUSEAPI_OSS \ -I../portaudio/pa_common \ ! -I../portaudio/pablio -I../portaudio/portmidi-macosx -Werror" SYSSRC="s_midi_oss.c s_audio_oss.c" if test x$alsa == "xyes"; --- 5892,5897 ---- -DUSEAPI_OSS \ -I../portaudio/pa_common \ ! -I../portaudio/pablio -I../portaudio/portmidi-macosx \ ! -Werror -fno-strict-aliasing" SYSSRC="s_midi_oss.c s_audio_oss.c" if test x$alsa == "xyes";
Index: configure.in =================================================================== RCS file: /cvsroot/pure-data/pd/src/configure.in,v retrieving revision 1.1.1.4.2.5 retrieving revision 1.1.1.4.2.6 diff -C2 -d -r1.1.1.4.2.5 -r1.1.1.4.2.6 *** configure.in 6 Oct 2003 16:40:58 -0000 1.1.1.4.2.5 --- configure.in 18 Nov 2003 10:34:09 -0000 1.1.1.4.2.6 *************** *** 158,162 **** -DUSEAPI_OSS \ -I../portaudio/pa_common \ ! -I../portaudio/pablio -I../portaudio/portmidi-macosx -Werror" SYSSRC="s_midi_oss.c s_audio_oss.c" if test x$alsa == "xyes"; --- 158,163 ---- -DUSEAPI_OSS \ -I../portaudio/pa_common \ ! -I../portaudio/pablio -I../portaudio/portmidi-macosx \ ! -Werror -fno-strict-aliasing" SYSSRC="s_midi_oss.c s_audio_oss.c" if test x$alsa == "xyes";
Index: d_delay.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_delay.c,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.3.2.1 diff -C2 -d -r1.1.1.3 -r1.1.1.3.2.1 *** d_delay.c 9 May 2003 16:03:40 -0000 1.1.1.3 --- d_delay.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.1 *************** *** 248,252 **** int nsamps = ctl->c_n; float limit = nsamps - n - 1; ! float fn = n-4; float *vp = ctl->c_vec, *bp, *wp = vp + ctl->c_phase; float zerodel = x->x_zerodel; --- 248,252 ---- int nsamps = ctl->c_n; float limit = nsamps - n - 1; ! float fn = n-1; float *vp = ctl->c_vec, *bp, *wp = vp + ctl->c_phase; float zerodel = x->x_zerodel; *************** *** 262,266 **** idelsamps = delsamps; frac = delsamps - (float)idelsamps; ! bp = wp - (idelsamps + 3); if (bp < vp + 4) bp += nsamps; d = bp[-3]; --- 262,266 ---- idelsamps = delsamps; frac = delsamps - (float)idelsamps; ! bp = wp - idelsamps; if (bp < vp + 4) bp += nsamps; d = bp[-3];
Index: d_global.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_global.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.8.1 diff -C2 -d -r1.1.1.2 -r1.1.1.2.8.1 *** d_global.c 25 Nov 2002 10:46:37 -0000 1.1.1.2 --- d_global.c 18 Nov 2003 10:34:10 -0000 1.1.1.2.8.1 *************** *** 41,49 **** while (n--) { ! float f = *in++; ! if (PD_BADFLOAT(f)) ! f = 0; ! ! *out++ = f; } return (w+4); --- 41,47 ---- while (n--) { ! *out = (PD_BADFLOAT(*in) ? 0 : *in); ! out++; ! in++; } return (w+4); *************** *** 245,252 **** while (n--) { ! float f = *in++; ! if (PD_BADFLOAT(f)) ! f = 0; ! *out++ += f; } } --- 243,249 ---- while (n--) { ! *out = (PD_BADFLOAT(*in) ? 0 : *in); ! out++; ! in++; } }
Index: d_osc.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_osc.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.2.1 diff -C2 -d -r1.1.1.2 -r1.1.1.2.2.1 *** d_osc.c 9 May 2003 16:03:41 -0000 1.1.1.2 --- d_osc.c 18 Nov 2003 10:34:10 -0000 1.1.1.2.2.1 *************** *** 449,452 **** --- 449,456 ---- *out2++ = im = coefi * re2 + coefr * im; } + if (PD_BADFLOAT(re)) + re = 0; + if (PD_BADFLOAT(im)) + im = 0; c->c_re = re; c->c_im = im;
Index: g_all_guis.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v retrieving revision 1.1.1.4.2.2 retrieving revision 1.1.1.4.2.3 diff -C2 -d -r1.1.1.4.2.2 -r1.1.1.4.2.3 *** g_all_guis.c 25 Sep 2003 20:09:45 -0000 1.1.1.4.2.2 --- g_all_guis.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.3 *************** *** 174,458 **** }
! t_symbol *iemgui_unique2dollarzero(t_symbol *s, int unique_num, int and_unique_flag) ! { ! if(and_unique_flag) ! { ! int l=0; ! char *b, str[144]; ! ! sprintf(str, "%d", unique_num); ! while(str[l]) ! { ! if(s->s_name[l] != str[l]) ! return(s); ! else ! l++; ! } ! str[0] = '$'; ! str[1] = '0'; ! str[2] = 0; ! b = s->s_name + l; ! if(strlen(b) >= IEM_MAX_SYM_LEN) ! strncat(str, b, IEM_MAX_SYM_LEN-1); ! else ! strcat(str, b); ! return(gensym(str)); ! } ! else ! return(s); ! } ! ! t_symbol *iemgui_sym2dollararg(t_symbol *s, int nth_arg, int tail_len) ! { ! if(nth_arg) ! { ! char *b, str[144]; ! int i=(int)strlen(s->s_name) - tail_len; ! ! sprintf(str, "_%d", nth_arg); ! str[0] = '$'; ! if(i < 0) i = 0; ! b = s->s_name + i; ! strcat(str, b); ! return(gensym(str)); ! } ! else ! return(s); ! } ! ! t_symbol *iemgui_dollarzero2unique(t_symbol *s, int unique_num) ! { ! int l; ! char *b, str[144]; ! ! sprintf(str, "%d", unique_num); ! l = (int)strlen(s->s_name); ! b = s->s_name + 2; ! if(l < 2) ! strcat(str, "shorty"); ! else if(l >= IEM_MAX_SYM_LEN) ! strncat(str, b, IEM_MAX_SYM_LEN-1); ! else ! strcat(str, b); ! return(gensym(str)); ! } ! ! t_symbol *iemgui_dollararg2sym(t_symbol *s, int nth_arg, int tail_len, int pargc, t_atom *pargv) ! { ! int l=(int)strlen(s->s_name); ! char *b, str[288]="0"; ! t_symbol *s2; ! ! if(pargc <= 0){} ! else if(nth_arg < 1){} ! else if(nth_arg > pargc){} ! else if(IS_A_FLOAT(pargv, nth_arg-1)) ! sprintf(str, "%d", (int)atom_getintarg(nth_arg-1, pargc, pargv)); ! else if(IS_A_SYMBOL(pargv, nth_arg-1)) ! { ! s2 = atom_getsymbolarg(nth_arg-1, pargc, pargv); ! strcpy(str, s2->s_name); ! } ! b = s->s_name + (l - tail_len); ! if(l <= tail_len) ! strcat(str, "shorty"); ! else if(l >= IEM_MAX_SYM_LEN) ! strncat(str, b, IEM_MAX_SYM_LEN-1); ! else ! strcat(str, b); ! return(gensym(str)); ! } ! ! int iemgui_is_dollarzero(t_symbol *s) { ! char *name=s->s_name; ! ! if((int)strlen(name) >= 2) { ! if((name[0] == '$') && (name[1] == '0') && ((name[2] < '0') || (name[2] > '9'))) ! return(1); } - return(0); }
! int iemgui_is_dollararg(t_symbol *s, int *tail_len) { ! char *name=s->s_name; ! ! *tail_len = (int)strlen(name); ! if(*tail_len >= 2) { ! if((name[0] == '$') && (name[1] >= '1') && (name[1] <= '9')) ! { ! int i=2, arg=(int)(name[1]-'0'); ! ! (*tail_len) -= 2; ! while(name[i] && (name[i] >= '0') && (name[i] <= '9')) ! { ! arg *= 10; ! arg += (int)(name[i]-'0'); ! i++; ! (*tail_len)--; ! } ! return(arg); ! } } ! return(0); }
! void iemgui_fetch_unique(t_iemgui *iemgui) { ! if(!iemgui->x_unique_num) { ! pd_bind(&iemgui->x_glist->gl_gobj.g_pd, gensym("#X")); ! iemgui->x_unique_num = canvas_getdollarzero(); ! pd_unbind(&iemgui->x_glist->gl_gobj.g_pd, gensym("#X")); } }
! void iemgui_fetch_parent_args(t_iemgui *iemgui, int *pargc, t_atom **pargv) { ! t_canvas *canvas=glist_getcanvas(iemgui->x_glist); ! ! canvas_setcurrent(canvas); ! canvas_getargs(pargc, pargv); ! canvas_unsetcurrent(canvas); }
! void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui) { ! iemgui->x_fsf.x_put_in2out = 1; ! if(iemgui->x_fsf.x_snd_able && iemgui->x_fsf.x_rcv_able) { ! if(!strcmp(iemgui->x_snd->s_name, iemgui->x_rcv->s_name)) ! iemgui->x_fsf.x_put_in2out = 0; } }
! void iemgui_all_unique2dollarzero(t_iemgui *iemgui, t_symbol **srlsym) ! { ! iemgui_fetch_unique(iemgui); ! srlsym[0] = iemgui_unique2dollarzero(srlsym[0], iemgui->x_unique_num, ! iemgui->x_fsf.x_snd_is_unique); ! srlsym[1] = iemgui_unique2dollarzero(srlsym[1], iemgui->x_unique_num, ! iemgui->x_fsf.x_rcv_is_unique); ! srlsym[2] = iemgui_unique2dollarzero(srlsym[2], iemgui->x_unique_num, ! iemgui->x_fsf.x_lab_is_unique); ! } ! void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) { ! srlsym[0] = iemgui_sym2dollararg(srlsym[0], iemgui->x_isa.x_snd_is_arg_num, ! iemgui->x_isa.x_snd_arg_tail_len); ! srlsym[1] = iemgui_sym2dollararg(srlsym[1], iemgui->x_isa.x_rcv_is_arg_num, ! iemgui->x_isa.x_rcv_arg_tail_len); ! srlsym[2] = iemgui_sym2dollararg(srlsym[2], iemgui->x_fsf.x_lab_is_arg_num, ! iemgui->x_fsf.x_lab_arg_tail_len); ! } ! ! void iemgui_all_dollarzero2unique(t_iemgui *iemgui, t_symbol **srlsym) ! { ! iemgui_fetch_unique(iemgui); ! if(iemgui_is_dollarzero(srlsym[0])) ! { ! iemgui->x_fsf.x_snd_is_unique = 1; ! iemgui->x_isa.x_snd_is_arg_num = 0; ! iemgui->x_isa.x_snd_arg_tail_len = 0; ! srlsym[0] = iemgui_dollarzero2unique(srlsym[0], iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_snd_is_unique = 0; ! if(iemgui_is_dollarzero(srlsym[1])) ! { ! iemgui->x_fsf.x_rcv_is_unique = 1; ! iemgui->x_isa.x_rcv_is_arg_num = 0; ! iemgui->x_isa.x_rcv_arg_tail_len = 0; ! srlsym[1] = iemgui_dollarzero2unique(srlsym[1], iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_rcv_is_unique = 0; ! if(iemgui_is_dollarzero(srlsym[2])) ! { ! iemgui->x_fsf.x_lab_is_unique = 1; ! iemgui->x_fsf.x_lab_is_arg_num = 0; ! iemgui->x_fsf.x_lab_arg_tail_len = 0; ! srlsym[2] = iemgui_dollarzero2unique(srlsym[2], iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_lab_is_unique = 0; ! } ! ! void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) ! { ! int pargc, tail_len, nth_arg; ! t_atom *pargv; ! ! iemgui_fetch_parent_args(iemgui, &pargc, &pargv); ! if(nth_arg = iemgui_is_dollararg(srlsym[0], &tail_len)) ! { ! iemgui->x_isa.x_snd_is_arg_num = nth_arg; ! iemgui->x_isa.x_snd_arg_tail_len = tail_len; ! iemgui->x_fsf.x_snd_is_unique = 0; ! srlsym[0] = iemgui_dollararg2sym(srlsym[0], nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_isa.x_snd_is_arg_num = 0; ! iemgui->x_isa.x_snd_arg_tail_len = 0; ! } ! if(nth_arg = iemgui_is_dollararg(srlsym[1], &tail_len)) ! { ! iemgui->x_isa.x_rcv_is_arg_num = nth_arg; ! iemgui->x_isa.x_rcv_arg_tail_len = tail_len; ! iemgui->x_fsf.x_rcv_is_unique = 0; ! srlsym[1] = iemgui_dollararg2sym(srlsym[1], nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_isa.x_rcv_is_arg_num = 0; ! iemgui->x_isa.x_rcv_arg_tail_len = 0; ! } ! if(nth_arg = iemgui_is_dollararg(srlsym[2], &tail_len)) ! { ! iemgui->x_fsf.x_lab_is_arg_num = nth_arg; ! iemgui->x_fsf.x_lab_arg_tail_len = tail_len; ! iemgui->x_fsf.x_lab_is_unique = 0; ! srlsym[2] = iemgui_dollararg2sym(srlsym[2], nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_fsf.x_lab_is_arg_num = 0; ! iemgui->x_fsf.x_lab_arg_tail_len = 0; ! } }
void iemgui_first_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { ! int pargc=0, tail_len, nth_arg; ! t_atom pargv; ! char *name; ! ! SETFLOAT(&pargv, 0.0); ! name = srlsym[0]->s_name; ! if(iemgui->x_isa.x_snd_is_arg_num && (name[0] == '$') ! && (name[1] >= '1') && (name[1] <= '9')) ! { ! srlsym[0] = iemgui_dollararg2sym(srlsym[0], iemgui->x_isa.x_snd_is_arg_num, ! iemgui->x_isa.x_snd_arg_tail_len, pargc, &pargv); ! } ! name = srlsym[1]->s_name; ! if(iemgui->x_isa.x_rcv_is_arg_num && (name[0] == '$') ! && (name[1] >= '1') && (name[1] <= '9')) ! { ! srlsym[1] = iemgui_dollararg2sym(srlsym[1], iemgui->x_isa.x_rcv_is_arg_num, ! iemgui->x_isa.x_rcv_arg_tail_len, pargc, &pargv); ! } ! name = srlsym[2]->s_name; ! if(iemgui->x_fsf.x_lab_is_arg_num && (name[0] == '$') ! && (name[1] >= '1') && (name[1] <= '9')) ! { ! srlsym[2] = iemgui_dollararg2sym(srlsym[2], iemgui->x_fsf.x_lab_is_arg_num, ! iemgui->x_fsf.x_lab_arg_tail_len, pargc, &pargv); ! } }
--- 174,261 ---- }
! void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui) { ! iemgui->x_fsf.x_put_in2out = 1; ! if(iemgui->x_fsf.x_snd_able && iemgui->x_fsf.x_rcv_able) { ! if(!strcmp(iemgui->x_snd->s_name, iemgui->x_rcv->s_name)) ! iemgui->x_fsf.x_put_in2out = 0; } }
! t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv) { ! if (IS_A_SYMBOL(argv, indx)) ! return (atom_getsymbolarg(indx, 100000, argv)); ! else if (IS_A_FLOAT(argv, indx)) { ! char str[80]; ! sprintf(str, "%d", (int)atom_getintarg(indx, 100000, argv)); ! return (gensym(str)); } ! else return (gensym("empty")); }
! void iemgui_new_getnames(t_iemgui *iemgui, int indx, t_atom *argv) { ! if (argv) { ! iemgui->x_snd = iemgui_new_dogetname(iemgui, indx, argv); ! iemgui->x_rcv = iemgui_new_dogetname(iemgui, indx+1, argv); ! iemgui->x_lab = iemgui_new_dogetname(iemgui, indx+2, argv); } + else iemgui->x_snd = iemgui->x_rcv = iemgui->x_lab = gensym("empty"); + iemgui->x_snd_unexpanded = iemgui->x_rcv_unexpanded = + iemgui->x_lab_unexpanded = 0; + iemgui->x_binbufindex = indx; + iemgui->x_labelbindex = indx + 2; }
! /* convert symbols in "$" form to the expanded symbols */ ! void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { ! /* save unexpanded ones for later */ ! iemgui->x_snd_unexpanded = srlsym[0]; ! iemgui->x_rcv_unexpanded = srlsym[1]; ! iemgui->x_lab_unexpanded = srlsym[2]; ! srlsym[0] = canvas_realizedollar(iemgui->x_glist, srlsym[0]); ! srlsym[1] = canvas_realizedollar(iemgui->x_glist, srlsym[1]); ! srlsym[2] = canvas_realizedollar(iemgui->x_glist, srlsym[2]); }
! /* initialize a single symbol in unexpanded form. We reach into the ! binbuf to grab them; if there's nothing there, set it to "empty". */ ! static void iemgui_init_sym2dollararg(t_iemgui *iemgui, t_symbol **symp, ! int indx) { ! if (!*symp) { ! t_binbuf *b = iemgui->x_obj.ob_binbuf; ! char buf[80]; ! if (binbuf_getnatom(b) <= indx) ! strcpy(buf, "empty"); ! else atom_string(binbuf_getvec(b) + indx, buf, 80); ! *symp = gensym(buf); } }
! /* get the unexpanded versions of the symbols; initialize them if ! necessary. */ void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym) { ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_snd_unexpanded, ! iemgui->x_binbufindex+1); ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_rcv_unexpanded, ! iemgui->x_binbufindex+2); ! iemgui_init_sym2dollararg(iemgui, &iemgui->x_lab_unexpanded, ! iemgui->x_labelbindex); ! srlsym[0] = iemgui->x_snd_unexpanded; ! srlsym[1] = iemgui->x_rcv_unexpanded; ! srlsym[2] = iemgui->x_lab_unexpanded; }
void iemgui_first_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym) { ! /* delete this function */ }
*************** *** 543,571 ****
if(!strcmp(s->s_name, "empty")) sndable = 0; - iemgui_fetch_unique(iemgui); snd = iemgui_raute2dollar(s); ! if(iemgui_is_dollarzero(snd)) ! { ! iemgui->x_fsf.x_snd_is_unique = 1; ! iemgui->x_isa.x_snd_is_arg_num = 0; ! iemgui->x_isa.x_snd_arg_tail_len = 0; ! snd = iemgui_dollarzero2unique(snd, iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_snd_is_unique = 0; ! iemgui_fetch_parent_args(iemgui, &pargc, &pargv); ! if(nth_arg = iemgui_is_dollararg(snd, &tail_len)) ! { ! iemgui->x_isa.x_snd_is_arg_num = nth_arg; ! iemgui->x_isa.x_snd_arg_tail_len = tail_len; ! iemgui->x_fsf.x_snd_is_unique = 0; ! snd = iemgui_dollararg2sym(snd, nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_isa.x_snd_is_arg_num = 0; ! iemgui->x_isa.x_snd_arg_tail_len = 0; ! } ! iemgui->x_snd = snd; iemgui->x_fsf.x_snd_able = sndable; iemgui_verify_snd_ne_rcv(iemgui); --- 346,355 ----
if(!strcmp(s->s_name, "empty")) sndable = 0; snd = iemgui_raute2dollar(s); ! iemgui->x_snd_unexpanded = snd; ! iemgui->x_snd = snd = canvas_realizedollar(iemgui->x_glist, snd); ! post("send: before %s, after %s", iemgui->x_snd_unexpanded->s_name, ! iemgui->x_snd->s_name); ! iemgui->x_fsf.x_snd_able = sndable; iemgui_verify_snd_ne_rcv(iemgui); *************** *** 586,612 **** if(!strcmp(s->s_name, "empty")) rcvable = 0; rcv = iemgui_raute2dollar(s); ! iemgui_fetch_unique(iemgui); ! if(iemgui_is_dollarzero(rcv)) ! { ! iemgui->x_fsf.x_rcv_is_unique = 1; ! iemgui->x_isa.x_rcv_is_arg_num = 0; ! iemgui->x_isa.x_rcv_arg_tail_len = 0; ! rcv = iemgui_dollarzero2unique(rcv, iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_rcv_is_unique = 0; ! iemgui_fetch_parent_args(iemgui, &pargc, &pargv); ! if(nth_arg = iemgui_is_dollararg(rcv, &tail_len)) ! { ! iemgui->x_isa.x_rcv_is_arg_num = nth_arg; ! iemgui->x_isa.x_rcv_arg_tail_len = tail_len; ! iemgui->x_fsf.x_rcv_is_unique = 0; ! rcv = iemgui_dollararg2sym(rcv, nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_isa.x_rcv_is_arg_num = 0; ! iemgui->x_isa.x_rcv_arg_tail_len = 0; ! } if(rcvable) { --- 370,375 ---- if(!strcmp(s->s_name, "empty")) rcvable = 0; rcv = iemgui_raute2dollar(s); ! iemgui->x_rcv_unexpanded = rcv; ! iemgui->x_rcv = rcv = canvas_realizedollar(iemgui->x_glist, rcv); if(rcvable) { *************** *** 636,665 ****
lab = iemgui_raute2dollar(s); ! iemgui_fetch_unique(iemgui); ! ! if(iemgui_is_dollarzero(lab)) ! { ! iemgui->x_fsf.x_lab_is_unique = 1; ! iemgui->x_fsf.x_lab_is_arg_num = 0; ! iemgui->x_fsf.x_lab_arg_tail_len = 0; ! lab = iemgui_dollarzero2unique(lab, iemgui->x_unique_num); ! } ! else ! iemgui->x_fsf.x_lab_is_unique = 0; ! ! iemgui_fetch_parent_args(iemgui, &pargc, &pargv); ! if(nth_arg = iemgui_is_dollararg(lab, &tail_len)) ! { ! iemgui->x_fsf.x_lab_is_arg_num = nth_arg; ! iemgui->x_fsf.x_lab_arg_tail_len = tail_len; ! iemgui->x_fsf.x_lab_is_unique = 0; ! lab = iemgui_dollararg2sym(lab, nth_arg, tail_len, pargc, pargv); ! } ! else ! { ! iemgui->x_fsf.x_lab_is_arg_num = 0; ! iemgui->x_fsf.x_lab_arg_tail_len = 0; ! } ! iemgui->x_lab = lab; if(glist_isvisible(iemgui->x_glist)) sys_vgui(".x%x.c itemconfigure %xLABEL -text {%s} \n", --- 399,404 ----
lab = iemgui_raute2dollar(s); ! iemgui->x_lab_unexpanded = lab; ! iemgui->x_lab = lab = canvas_realizedollar(iemgui->x_glist, lab); if(glist_isvisible(iemgui->x_glist)) sys_vgui(".x%x.c itemconfigure %xLABEL -text {%s} \n", *************** *** 783,787 **** srl[1] = iemgui->x_rcv; srl[2] = iemgui->x_lab; - iemgui_all_unique2dollarzero(iemgui, srl); iemgui_all_sym2dollararg(iemgui, srl); iemgui_all_col2save(iemgui, bflcol); --- 522,525 ---- *************** *** 793,797 **** srl[1] = iemgui->x_rcv; srl[2] = iemgui->x_lab; - iemgui_all_unique2dollarzero(iemgui, srl); iemgui_all_sym2dollararg(iemgui, srl); iemgui_all_dollar2raute(srl); --- 531,534 ---- *************** *** 841,845 **** if(!strcmp(srl[1]->s_name, "empty")) rcvable = 0; iemgui_all_raute2dollar(srl); - iemgui_all_dollarzero2unique(iemgui, srl); iemgui_all_dollararg2sym(iemgui, srl); if(rcvable) --- 578,581 ---- *************** *** 886,898 **** memset(symargp, 0, sizeof(*symargp)); symargp->x_loadinit = (n >> 0); - symargp->x_rcv_arg_tail_len = (n >> 1); - symargp->x_snd_arg_tail_len = (n >> 7); - symargp->x_rcv_is_arg_num = (n >> 13); - symargp->x_snd_is_arg_num = (n >> 19); symargp->x_scale = (n >> 20); ! symargp->x_flashed = (n >> 21); ! symargp->x_locked = (n >> 22); ! symargp->x_reverse = (n >> 23); ! symargp->dummy = (n >> 24); }
--- 622,630 ---- memset(symargp, 0, sizeof(*symargp)); symargp->x_loadinit = (n >> 0); symargp->x_scale = (n >> 20); ! symargp->x_flashed = 0; ! symargp->x_locked = 0; ! symargp->x_reverse = 0; ! symargp->dummy = 0; }
*************** *** 900,914 **** { return ( ! ((symargp->x_loadinit << 0) | ! (symargp->x_rcv_arg_tail_len << 1) | ! (symargp->x_snd_arg_tail_len << 7) | ! (symargp->x_rcv_is_arg_num << 13) | ! (symargp->x_snd_is_arg_num << 19) | ! (symargp->x_scale << 20) | ! (symargp->x_flashed << 21) | ! (symargp->x_locked << 22) | ! (symargp->x_reverse << 23) | ! (symargp->dummy << 24)) & IEM_INIT_ARGS_ALL ! ); }
--- 632,637 ---- { return ( ! (((symargp->x_loadinit & 1) << 0) | ! ((symargp->x_scale & 1) << 20))); }
*************** *** 917,958 **** memset(fstylep, 0, sizeof(*fstylep)); fstylep->x_font_style = (n >> 0); ! fstylep->x_rcv_able = (n >> 6); ! fstylep->x_snd_able = (n >> 7); ! fstylep->x_lab_is_unique = (n >> 8); ! fstylep->x_rcv_is_unique = (n >> 9); ! fstylep->x_snd_is_unique = (n >> 10); ! fstylep->x_lab_arg_tail_len = (n >> 11); ! fstylep->x_lab_is_arg_num = (n >> 17); ! fstylep->x_shiftdown = (n >> 23); ! fstylep->x_selected = (n >> 24); ! fstylep->x_finemoved = (n >> 25); ! fstylep->x_put_in2out = (n >> 26); ! fstylep->x_change = (n >> 27); ! fstylep->x_thick = (n >> 28); ! fstylep->x_lin0_log1 = (n >> 29); ! fstylep->x_steady = (n >> 30); ! fstylep->dummy = (n >> 31); }
int iem_fstyletoint(t_iem_fstyle_flags *fstylep) { ! return ( ! ((fstylep->x_font_style << 0) | ! (fstylep->x_rcv_able << 6) | ! (fstylep->x_snd_able << 7) | ! (fstylep->x_lab_is_unique << 8) | ! (fstylep->x_rcv_is_unique << 9) | ! (fstylep->x_snd_is_unique << 10) | ! (fstylep->x_lab_arg_tail_len << 11) | ! (fstylep->x_lab_is_arg_num << 17) | ! (fstylep->x_shiftdown << 23) | ! (fstylep->x_selected << 24) | ! (fstylep->x_finemoved << 25) | ! (fstylep->x_put_in2out << 26) | ! (fstylep->x_change << 27) | ! (fstylep->x_thick << 28) | ! (fstylep->x_lin0_log1 << 29) | ! (fstylep->x_steady << 30) | ! (fstylep->dummy << 31)) & IEM_FSTYLE_FLAGS_ALL ! ); } --- 640,656 ---- memset(fstylep, 0, sizeof(*fstylep)); fstylep->x_font_style = (n >> 0); ! fstylep->x_shiftdown = 0; ! fstylep->x_selected = 0; ! fstylep->x_finemoved = 0; ! fstylep->x_put_in2out = 0; ! fstylep->x_change = 0; ! fstylep->x_thick = 0; ! fstylep->x_lin0_log1 = 0; ! fstylep->x_steady = 0; ! fstylep->dummy = 0; }
int iem_fstyletoint(t_iem_fstyle_flags *fstylep) { ! return ((fstylep->x_font_style << 0) & 63); }
Index: g_all_guis.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v retrieving revision 1.1.1.4.2.1 retrieving revision 1.1.1.4.2.2 diff -C2 -d -r1.1.1.4.2.1 -r1.1.1.4.2.2 *** g_all_guis.h 12 Sep 2003 20:55:31 -0000 1.1.1.4.2.1 --- g_all_guis.h 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.2 *************** *** 152,159 **** int x_bcol; int x_lcol; ! int x_unique_num; ! t_symbol *x_snd; ! t_symbol *x_rcv; ! t_symbol *x_lab; } t_iemgui;
--- 152,163 ---- int x_bcol; int x_lcol; ! t_symbol *x_snd; /* send symbol */ ! t_symbol *x_rcv; /* receive */ ! t_symbol *x_lab; /* label */ ! t_symbol *x_snd_unexpanded; /* same 3, with '$' unexpanded */ ! t_symbol *x_rcv_unexpanded; ! t_symbol *x_lab_unexpanded; ! int x_binbufindex; /* where in binbuf to find these */ ! int x_labelbindex; /* where in binbuf to find label */ } t_iemgui;
*************** *** 290,293 **** --- 294,299 ---- EXTERN void iemgui_all_sym2dollararg(t_iemgui *iemgui, t_symbol **srlsym); EXTERN void iemgui_all_dollarzero2unique(t_iemgui *iemgui, t_symbol **srlsym); + EXTERN t_symbol *iemgui_new_dogetname(t_iemgui *iemgui, int indx, t_atom *argv); + EXTERN void iemgui_new_getnames(t_iemgui *iemgui, int indx, t_atom *argv); EXTERN void iemgui_all_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym); EXTERN void iemgui_first_dollararg2sym(t_iemgui *iemgui, t_symbol **srlsym);
Index: g_bang.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_bang.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_bang.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_bang.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 433,437 **** t_bng *x = (t_bng *)pd_new(bng_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE; int ldx=0, ldy=-6; --- 433,436 ---- *************** *** 443,449 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if((argc == 14)&&IS_A_FLOAT(argv,0) --- 442,445 ---- *************** *** 462,486 **** ftbreak = (int)atom_getintarg(2, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(3, argc, argv)); ! if(IS_A_SYMBOL(argv,4)) ! srl[0] = atom_getsymbolarg(4, argc, argv); ! else if(IS_A_FLOAT(argv,4)) ! { ! sprintf(str, "%d", (int)atom_getintarg(4, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,5)) ! srl[1] = atom_getsymbolarg(5, argc, argv); ! else if(IS_A_FLOAT(argv,5)) ! { ! sprintf(str, "%d", (int)atom_getintarg(5, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,6)) ! srl[2] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); --- 458,462 ---- ftbreak = (int)atom_getintarg(2, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(3, argc, argv)); ! iemgui_new_getnames(&x->x_gui, 4, argv); ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); *************** *** 491,494 **** --- 467,471 ---- bflcol[2] = (int)atom_getintarg(13, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 4, 0);
x->x_gui.x_draw = (t_iemfunptr)bng_draw; *************** *** 498,514 **** x->x_flashed = 0; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } - iemgui_first_dollararg2sym(&x->x_gui, srl);
! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 475,489 ---- x->x_flashed = 0; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); }
! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_hdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v retrieving revision 1.1.1.4.2.1 retrieving revision 1.1.1.4.2.2 diff -C2 -d -r1.1.1.4.2.1 -r1.1.1.4.2.2 *** g_hdial.c 12 Sep 2003 20:55:31 -0000 1.1.1.4.2.1 --- g_hdial.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.2 *************** *** 540,544 **** t_hradio *x = (t_hradio *)pd_new(old? hradio_old_class : hradio_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; int ldx=0, ldy=-6, chg=1, num=8; --- 540,543 ---- *************** *** 549,555 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) --- 548,551 ---- *************** *** 566,590 **** iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv)); num = (int)atom_getintarg(3, argc, argv); ! if(IS_A_SYMBOL(argv,4)) ! srl[0] = atom_getsymbolarg(4, argc, argv); ! else if(IS_A_FLOAT(argv,4)) ! { ! sprintf(str, "%d", (int)atom_getintarg(4, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,5)) ! srl[1] = atom_getsymbolarg(5, argc, argv); ! else if(IS_A_FLOAT(argv,5)) ! { ! sprintf(str, "%d", (int)atom_getintarg(5, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,6)) ! srl[2] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); --- 562,566 ---- iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv)); num = (int)atom_getintarg(3, argc, argv); ! iemgui_new_getnames(&x->x_gui, 4, argv); ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); *************** *** 596,610 **** on = (int)atom_getintarg(14, argc, argv); } x->x_gui.x_draw = (t_iemfunptr)hradio_draw; x->x_gui.x_fsf.x_snd_able = 1; x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } - x->x_gui.x_unique_num = 0; if(num < 1) num = 1; --- 572,588 ---- on = (int)atom_getintarg(14, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 4, 0); x->x_gui.x_draw = (t_iemfunptr)hradio_draw; x->x_gui.x_fsf.x_snd_able = 1; x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } if(num < 1) num = 1; *************** *** 622,630 **** x->x_on_old = x->x_on; x->x_change = (chg==0)?0:1; ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 600,605 ---- x->x_on_old = x->x_on; x->x_change = (chg==0)?0:1; ! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_hslider.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_hslider.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 525,529 **** t_hslider *x = (t_hslider *)pd_new(hslider_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int w=IEM_SL_DEFAULTSIZE, h=IEM_GUI_DEFAULTSIZE; int lilo=0, ldx=-2, ldy=-6, f=0, v=0, steady=1; --- 525,528 ---- *************** *** 534,540 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if(((argc == 17)||(argc == 18))&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) --- 533,536 ---- *************** *** 554,578 **** lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! if(IS_A_SYMBOL(argv,6)) ! srl[0] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,7)) ! srl[1] = atom_getsymbolarg(7, argc, argv); ! else if(IS_A_FLOAT(argv,7)) ! { ! sprintf(str, "%d", (int)atom_getintarg(7, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,8)) ! srl[2] = atom_getsymbolarg(8, argc, argv); ! else if(IS_A_FLOAT(argv,8)) ! { ! sprintf(str, "%d", (int)atom_getintarg(8, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); --- 550,554 ---- lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! iemgui_new_getnames(&x->x_gui, 6, argv); ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); *************** *** 584,587 **** --- 560,564 ---- v = (int)atom_getintarg(16, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 6, 0); if((argc == 18)&&IS_A_FLOAT(argv,17)) steady = (int)atom_getintarg(17, argc, argv); *************** *** 602,617 **** if(steady != 0) steady = 1; x->x_steady = steady; ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 579,592 ---- if(steady != 0) steady = 1; x->x_steady = steady; ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! if(x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_mycanvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_mycanvas.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_mycanvas.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 262,266 **** t_my_canvas *x = (t_my_canvas *)pd_new(my_canvas_class); int bflcol[]={-233017, -1, -66577}; - t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE, w=100, h=60; int ldx=20, ldy=12, f=2, i=0; --- 262,265 ---- *************** *** 270,276 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if(((argc >= 10)&&(argc <= 13)) --- 269,272 ---- *************** *** 284,313 **** { i = 2; ! if(IS_A_SYMBOL(argv,3)) ! srl[0] = atom_getsymbolarg(3, argc, argv); ! else if(IS_A_FLOAT(argv,3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(3, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,4)) ! srl[1] = atom_getsymbolarg(4, argc, argv); ! else if(IS_A_FLOAT(argv,4)) ! { ! sprintf(str, "%d", (int)atom_getintarg(4, argc, argv)); ! srl[1] = gensym(str); ! } } else if((argc == 11)&&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3))) { i = 1; ! if(IS_A_SYMBOL(argv,3)) ! srl[1] = atom_getsymbolarg(3, argc, argv); ! else if(IS_A_FLOAT(argv,3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(3, argc, argv)); ! srl[1] = gensym(str); ! } }
if(((argc >= 10)&&(argc <= 13)) --- 280,291 ---- { i = 2; ! iemgui_new_getnames(&x->x_gui, 3, argv); } else if((argc == 11)&&(IS_A_SYMBOL(argv,3)||IS_A_FLOAT(argv,3))) { i = 1; ! iemgui_new_getnames(&x->x_gui, 3, argv); } + else iemgui_new_getnames(&x->x_gui, 3, 0);
if(((argc >= 10)&&(argc <= 13)) *************** *** 317,327 **** &&IS_A_FLOAT(argv,i+9)) { ! if(IS_A_SYMBOL(argv,i+3)) ! srl[2] = atom_getsymbolarg(i+3, argc, argv); ! else if(IS_A_FLOAT(argv,i+3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(i+3, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(i+4, argc, argv); ldy = (int)atom_getintarg(i+5, argc, argv); --- 295,303 ---- &&IS_A_FLOAT(argv,i+9)) { ! /* disastrously, the "label" sits in a different part of the ! message. So we have to track its location separately (in ! the slot x_labelbindex) and initialize it specially here. */ ! iemgui_new_dogetname(&x->x_gui, i+3, argv); ! x->x_gui.x_labelbindex = i+3; ldx = (int)atom_getintarg(i+4, argc, argv); ldy = (int)atom_getintarg(i+5, argc, argv); *************** *** 339,345 **** x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(a < 1) a = 1; --- 315,322 ---- x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(a < 1) a = 1; *************** *** 356,364 **** else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 333,338 ---- else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_numbox.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v retrieving revision 1.1.1.4.2.1 retrieving revision 1.1.1.4.2.2 diff -C2 -d -r1.1.1.4.2.1 -r1.1.1.4.2.2 *** g_numbox.c 12 Sep 2003 20:55:31 -0000 1.1.1.4.2.1 --- g_numbox.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.2 *************** *** 754,758 **** t_my_numbox *x = (t_my_numbox *)pd_new(my_numbox_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int w=5, h=14; int lilo=0, f=0, ldx=0, ldy=-6; --- 754,757 ---- *************** *** 762,770 **** char str[144];
- srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty"); - - if((argc >= 17)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) &&IS_A_FLOAT(argv,2)&&IS_A_FLOAT(argv,3) --- 761,764 ---- *************** *** 783,810 **** lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! srl[0] = atom_getsymbolarg(6, argc, argv); ! srl[1] = atom_getsymbolarg(7, argc, argv); ! srl[2] = atom_getsymbolarg(8, argc, argv); ! if(IS_A_SYMBOL(argv,6)) ! srl[0] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,7)) ! srl[1] = atom_getsymbolarg(7, argc, argv); ! else if(IS_A_FLOAT(argv,7)) ! { ! sprintf(str, "%d", (int)atom_getintarg(7, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,8)) ! srl[2] = atom_getsymbolarg(8, argc, argv); ! else if(IS_A_FLOAT(argv,8)) ! { ! sprintf(str, "%d", (int)atom_getintarg(8, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); --- 777,781 ---- lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! iemgui_new_getnames(&x->x_gui, 6, argv); ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); *************** *** 816,819 **** --- 787,791 ---- v = atom_getfloatarg(16, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 6, 0); if((argc == 18)&&IS_A_FLOAT(argv,17)) { *************** *** 833,848 **** log_height = 10; x->x_log_height = log_height; ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 805,818 ---- log_height = 10; x->x_log_height = log_height; ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_rtext.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_rtext.c,v retrieving revision 1.1.1.2.2.5 retrieving revision 1.1.1.2.2.6 diff -C2 -d -r1.1.1.2.2.5 -r1.1.1.2.2.6 *** g_rtext.c 29 Oct 2003 12:57:42 -0000 1.1.1.2.2.5 --- g_rtext.c 18 Nov 2003 10:34:10 -0000 1.1.1.2.2.6 *************** *** 138,141 **** --- 138,146 ---- #define BOXWIDTH 60
+ /* Older (pre-8.3.4) TCL versions handle text selection differently; this + flag is set from the GUI if this happens. LATER take this out: early 2006? */ + + extern int sys_oldtclversion; + static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp, int *indexp) *************** *** 230,240 **** x->x_tag, x->x_selstart); sys_vgui(".x%x.c select to %s %d\n", canvas, ! x->x_tag, x->x_selend ! #if defined (MSW) || defined(MACOSX) ! /* Why is linux selecting text differently from MSW and OSX??? ! Just adjust it here... LATER revisit this one */ ! -1 ! #endif ! ); sys_vgui(".x%x.c focus ""\n", canvas); } --- 235,239 ---- x->x_tag, x->x_selstart); sys_vgui(".x%x.c select to %s %d\n", canvas, ! x->x_tag, x->x_selend + (sys_oldtclversion ? 0 : -1)); sys_vgui(".x%x.c focus ""\n", canvas); }
Index: g_scalar.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_scalar.c,v retrieving revision 1.1.1.2.2.1 retrieving revision 1.1.1.2.2.2 diff -C2 -d -r1.1.1.2.2.1 -r1.1.1.2.2.2 *** g_scalar.c 12 Sep 2003 20:55:31 -0000 1.1.1.2.2.1 --- g_scalar.c 18 Nov 2003 10:34:10 -0000 1.1.1.2.2.2 *************** *** 175,196 **** float basex, basey; scalar_getbasexy(x, &basex, &basey); ! for (y = templatecanvas->gl_list; y; y = y->g_next) { ! t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); ! int nx1, ny1, nx2, ny2; ! if (!wb) continue; ! (*wb->w_parentgetrectfn)(y, owner, ! x->sc_vec, template, basex, basey, ! &nx1, &ny1, &nx2, &ny2); ! if (hit) { ! if (nx1 < x1) x1 = nx1; ! if (ny1 < y1) y1 = ny1; ! if (nx2 > x2) x2 = nx2; ! if (ny2 > y2) y2 = ny2; } ! else x1 = nx1, y1 = ny1, x2 = nx2, y2 = ny2, hit = 1; } - if (!hit) x1 = y1 = x2 = y2 = 0; /* post("scalar x1 %d y1 %d x2 %d y2 %d", x1, y1, x2, y2); */ *xp1 = x1; --- 175,208 ---- float basex, basey; scalar_getbasexy(x, &basex, &basey); ! /* if someone deleted the template canvas, we're just a point */ ! if (!templatecanvas) { ! x1 = x2 = glist_xtopixels(owner, basex); ! y1 = y2 = glist_ytopixels(owner, basey); ! } ! else ! { ! int hit = 0; ! x1 = y1 = 0x7fffffff; ! x2 = y2 = -0x7fffffff; ! for (y = templatecanvas->gl_list; y; y = y->g_next) { ! t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd); ! int nx1, ny1, nx2, ny2; ! if (!wb) continue; ! (*wb->w_parentgetrectfn)(y, owner, ! x->sc_vec, template, basex, basey, ! &nx1, &ny1, &nx2, &ny2); ! if (hit) ! { ! if (nx1 < x1) x1 = nx1; ! if (ny1 < y1) y1 = ny1; ! if (nx2 > x2) x2 = nx2; ! if (ny2 > y2) y2 = ny2; ! } ! else x1 = nx1, y1 = ny1, x2 = nx2, y2 = ny2, hit = 1; } ! if (!hit) x1 = y1 = x2 = y2 = 0; } /* post("scalar x1 %d y1 %d x2 %d y2 %d", x1, y1, x2, y2); */ *xp1 = x1; *************** *** 209,212 **** --- 221,225 ---- int x1, y1, x2, y2; scalar_getrect(z, owner, &x1, &y1, &x2, &y2); + x1--; x2++; y1--; y2++; sys_vgui(".x%x.c create line %d %d %d %d %d %d %d %d %d %d \ -width 0 -fill blue -tags select%x\n", *************** *** 267,276 **** t_gobj *y; float basex, basey; if (!templatecanvas) { ! bug("scalar_vis"); /* it's still a bug, have to fix this for real... */ ! return; /* proposed by Krzysztof Czaja to avoid crashing */ } - scalar_getbasexy(x, &basex, &basey);
for (y = templatecanvas->gl_list; y; y = y->g_next) --- 280,297 ---- t_gobj *y; float basex, basey; + scalar_getbasexy(x, &basex, &basey); + /* if we don't know how to draw it, make a small rectangle */ if (!templatecanvas) { ! if (vis) ! { ! int x1 = glist_xtopixels(owner, basex); ! int y1 = glist_ytopixels(owner, basey); ! sys_vgui(".x%x.c create rectangle %d %d %d %d -tags scalar%x\n", ! glist_getcanvas(owner), x1-1, y1-1, x1+1, y1+1, x); ! } ! else sys_vgui(".x%x.c delete scalar%x\n", glist_getcanvas(owner), x); ! return; }
for (y = templatecanvas->gl_list; y; y = y->g_next) *************** *** 331,335 **** binbuf_gettext(b, &buf, &bufsize); binbuf_free(b); ! t_resizebytes(buf, bufsize, bufsize+1); buf[bufsize] = 0; sprintf(buf2, "pdtk_data_dialog %%s {"); --- 352,356 ---- binbuf_gettext(b, &buf, &bufsize); binbuf_free(b); ! buf = t_resizebytes(buf, bufsize, bufsize+1); buf[bufsize] = 0; sprintf(buf2, "pdtk_data_dialog %%s {");
Index: g_toggle.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_toggle.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_toggle.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 363,367 **** t_toggle *x = (t_toggle *)pd_new(toggle_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE, f=0; int ldx=0, ldy=-6; --- 363,366 ---- *************** *** 372,378 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if(((argc == 13)||(argc == 14))&&IS_A_FLOAT(argv,0) --- 371,374 ---- *************** *** 387,411 **** a = (int)atom_getintarg(0, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(1, argc, argv)); ! if(IS_A_SYMBOL(argv,2)) ! srl[0] = atom_getsymbolarg(2, argc, argv); ! else if(IS_A_FLOAT(argv,2)) ! { ! sprintf(str, "%d", (int)atom_getintarg(2, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,3)) ! srl[1] = atom_getsymbolarg(3, argc, argv); ! else if(IS_A_FLOAT(argv,3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(3, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,4)) ! srl[2] = atom_getsymbolarg(4, argc, argv); ! else if(IS_A_FLOAT(argv,4)) ! { ! sprintf(str, "%d", (int)atom_getintarg(4, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(5, argc, argv); ldy = (int)atom_getintarg(6, argc, argv); --- 383,387 ---- a = (int)atom_getintarg(0, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(1, argc, argv)); ! iemgui_new_getnames(&x->x_gui, 2, argv); ldx = (int)atom_getintarg(5, argc, argv); ldy = (int)atom_getintarg(6, argc, argv); *************** *** 417,420 **** --- 393,397 ---- on = (float)atom_getfloatarg(12, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 2, 0); if((argc == 14)&&IS_A_FLOAT(argv,13)) nonzero = (float)atom_getfloatarg(13, argc, argv); *************** *** 424,430 **** x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); --- 401,408 ---- x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); *************** *** 436,444 **** else x->x_on = 0.0; ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 414,419 ---- else x->x_on = 0.0; ! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_vdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vdial.c,v retrieving revision 1.1.1.4.2.1 retrieving revision 1.1.1.4.2.2 diff -C2 -d -r1.1.1.4.2.1 -r1.1.1.4.2.2 *** g_vdial.c 12 Sep 2003 20:55:31 -0000 1.1.1.4.2.1 --- g_vdial.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.2 *************** *** 543,547 **** t_vradio *x = (t_vradio *)pd_new(old? vradio_old_class : vradio_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int a=IEM_GUI_DEFAULTSIZE, on=0, f=0; int ldx=0, ldy=-6, chg=1, num=8; --- 543,546 ---- *************** *** 550,558 **** char str[144];
- /* post("new %s %d", s->s_name, old); */ - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty"); - if((argc == 15)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1)&&IS_A_FLOAT(argv,2) &&IS_A_FLOAT(argv,3) --- 549,552 ---- *************** *** 568,592 **** iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv)); num = (int)atom_getintarg(3, argc, argv); ! if(IS_A_SYMBOL(argv,4)) ! srl[0] = atom_getsymbolarg(4, argc, argv); ! else if(IS_A_FLOAT(argv,4)) ! { ! sprintf(str, "%d", (int)atom_getintarg(4, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,5)) ! srl[1] = atom_getsymbolarg(5, argc, argv); ! else if(IS_A_FLOAT(argv,5)) ! { ! sprintf(str, "%d", (int)atom_getintarg(5, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,6)) ! srl[2] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); --- 562,566 ---- iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(2, argc, argv)); num = (int)atom_getintarg(3, argc, argv); ! iemgui_new_getnames(&x->x_gui, 4, argv); ldx = (int)atom_getintarg(7, argc, argv); ldy = (int)atom_getintarg(8, argc, argv); *************** *** 598,612 **** on = (int)atom_getintarg(14, argc, argv); } x->x_gui.x_draw = (t_iemfunptr)vradio_draw; x->x_gui.x_fsf.x_snd_able = 1; x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } - x->x_gui.x_unique_num = 0; if(num < 1) num = 1; --- 572,588 ---- on = (int)atom_getintarg(14, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 4, 0); x->x_gui.x_draw = (t_iemfunptr)vradio_draw; x->x_gui.x_fsf.x_snd_able = 1; x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_snd->s_name, "empty")) ! x->x_gui.x_fsf.x_snd_able = 0; ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } if(num < 1) num = 1; *************** *** 624,632 **** x->x_on_old = x->x_on; x->x_change = (chg==0)?0:1; ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 600,605 ---- x->x_on_old = x->x_on; x->x_change = (chg==0)?0:1; ! if (x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_vslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vslider.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_vslider.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_vslider.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 506,510 **** t_vslider *x = (t_vslider *)pd_new(vslider_class); int bflcol[]={-262144, -1, -1}; - t_symbol *srl[3]; int w=IEM_GUI_DEFAULTSIZE, h=IEM_SL_DEFAULTSIZE; int lilo=0, f=0, ldx=0, ldy=-8; --- 506,509 ---- *************** *** 515,522 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty"); -
if(((argc == 17)||(argc == 18))&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) --- 514,517 ---- *************** *** 536,563 **** lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! srl[0] = atom_getsymbolarg(6, argc, argv); ! srl[1] = atom_getsymbolarg(7, argc, argv); ! srl[2] = atom_getsymbolarg(8, argc, argv); ! if(IS_A_SYMBOL(argv,6)) ! srl[0] = atom_getsymbolarg(6, argc, argv); ! else if(IS_A_FLOAT(argv,6)) ! { ! sprintf(str, "%d", (int)atom_getintarg(6, argc, argv)); ! srl[0] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,7)) ! srl[1] = atom_getsymbolarg(7, argc, argv); ! else if(IS_A_FLOAT(argv,7)) ! { ! sprintf(str, "%d", (int)atom_getintarg(7, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,8)) ! srl[2] = atom_getsymbolarg(8, argc, argv); ! else if(IS_A_FLOAT(argv,8)) ! { ! sprintf(str, "%d", (int)atom_getintarg(8, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); --- 531,535 ---- lilo = (int)atom_getintarg(4, argc, argv); iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(5, argc, argv)); ! iemgui_new_getnames(&x->x_gui, 6, argv); ldx = (int)atom_getintarg(9, argc, argv); ldy = (int)atom_getintarg(10, argc, argv); *************** *** 569,572 **** --- 541,545 ---- v = (int)atom_getintarg(16, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 6, 0); if((argc == 18)&&IS_A_FLOAT(argv,17)) steady = (int)atom_getintarg(17, argc, argv); *************** *** 584,599 **** if(steady != 0) steady = 1; x->x_steady = steady; ! if(!strcmp(srl[0]->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 557,567 ---- if(steady != 0) steady = 1; x->x_steady = steady; ! if(!strcmp(x->x_gui.x_snd->s_name, "empty")) x->x_gui.x_fsf.x_snd_able = 0; ! if(!strcmp(x->x_gui.x_rcv->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: g_vumeter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v retrieving revision 1.1.1.3.2.1 retrieving revision 1.1.1.3.2.2 diff -C2 -d -r1.1.1.3.2.1 -r1.1.1.3.2.2 *** g_vumeter.c 12 Sep 2003 20:55:31 -0000 1.1.1.3.2.1 --- g_vumeter.c 18 Nov 2003 10:34:10 -0000 1.1.1.3.2.2 *************** *** 608,612 **** t_vu *x = (t_vu *)pd_new(vu_class); int bflcol[]={-66577, -1, -1}; - t_symbol *srl[3]; int w=IEM_GUI_DEFAULTSIZE, h=IEM_VU_STEPS*IEM_VU_DEFAULTSIZE; int ldx=-1, ldy=-8, f=0, fs=8, scale=1; --- 608,611 ---- *************** *** 616,622 **** iem_inttosymargs(&x->x_gui.x_isa, 0); iem_inttofstyle(&x->x_gui.x_fsf, 0); - srl[0] = gensym("empty"); - srl[1] = gensym("empty"); - srl[2] = gensym("empty");
if((argc >= 11)&&IS_A_FLOAT(argv,0)&&IS_A_FLOAT(argv,1) --- 615,618 ---- *************** *** 629,646 **** w = (int)atom_getintarg(0, argc, argv); h = (int)atom_getintarg(1, argc, argv); ! if(IS_A_SYMBOL(argv,2)) ! srl[1] = atom_getsymbolarg(2, argc, argv); ! else if(IS_A_FLOAT(argv,2)) ! { ! sprintf(str, "%d", (int)atom_getintarg(2, argc, argv)); ! srl[1] = gensym(str); ! } ! if(IS_A_SYMBOL(argv,3)) ! srl[2] = atom_getsymbolarg(3, argc, argv); ! else if(IS_A_FLOAT(argv,3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(3, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(4, argc, argv); ldy = (int)atom_getintarg(5, argc, argv); --- 625,629 ---- w = (int)atom_getintarg(0, argc, argv); h = (int)atom_getintarg(1, argc, argv); ! iemgui_new_getnames(&x->x_gui, 1, argv); ldx = (int)atom_getintarg(4, argc, argv); ldy = (int)atom_getintarg(5, argc, argv); *************** *** 651,654 **** --- 634,638 ---- scale = (int)atom_getintarg(10, argc, argv); } + else iemgui_new_getnames(&x->x_gui, 1, 0); if((argc == 12)&&IS_A_FLOAT(argv,11)) iem_inttosymargs(&x->x_gui.x_isa, atom_getintarg(11, argc, argv)); *************** *** 658,672 **** x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if(!strcmp(srl[1]->s_name, "empty")) x->x_gui.x_fsf.x_rcv_able = 0; ! x->x_gui.x_unique_num = 0; ! if(x->x_gui.x_fsf.x_font_style == 1) strcpy(x->x_gui.x_font, "helvetica"); ! else if(x->x_gui.x_fsf.x_font_style == 2) strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! iemgui_first_dollararg2sym(&x->x_gui, srl); ! if(x->x_gui.x_fsf.x_rcv_able) pd_bind(&x->x_gui.x_obj.ob_pd, srl[1]); ! x->x_gui.x_snd = srl[0]; ! x->x_gui.x_rcv = srl[1]; ! x->x_gui.x_lab = srl[2]; x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy; --- 642,655 ---- x->x_gui.x_fsf.x_rcv_able = 1; x->x_gui.x_glist = (t_glist *)canvas_getcurrent(); ! if (!strcmp(x->x_gui.x_rcv->s_name, "empty")) ! x->x_gui.x_fsf.x_rcv_able = 0; ! if (x->x_gui.x_fsf.x_font_style == 1) ! strcpy(x->x_gui.x_font, "helvetica"); ! else if(x->x_gui.x_fsf.x_font_style == 2) ! strcpy(x->x_gui.x_font, "times"); else { x->x_gui.x_fsf.x_font_style = 0; strcpy(x->x_gui.x_font, "courier"); } ! if(x->x_gui.x_fsf.x_rcv_able) ! pd_bind(&x->x_gui.x_obj.ob_pd, x->x_gui.x_rcv); x->x_gui.x_ldx = ldx; x->x_gui.x_ldy = ldy;
Index: m_binbuf.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_binbuf.c,v retrieving revision 1.1.1.4.2.3 retrieving revision 1.1.1.4.2.4 diff -C2 -d -r1.1.1.4.2.3 -r1.1.1.4.2.4 *** m_binbuf.c 12 Sep 2003 21:34:17 -0000 1.1.1.4.2.3 --- m_binbuf.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.4 *************** *** 456,460 **** int ac = x->b_n; int nargs; - while (1) { --- 456,459 ----
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.1.1.4.2.8 retrieving revision 1.1.1.4.2.9 diff -C2 -d -r1.1.1.4.2.8 -r1.1.1.4.2.9 *** m_pd.h 14 Oct 2003 12:32:16 -0000 1.1.1.4.2.8 --- m_pd.h 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.9 *************** *** 637,645 **** #define PD_USE_TE_XPIX
! /* a test for NANs and denormals. Shouldn't be necessary on Mac but can't ! test this just now. */
#define PD_BADFLOAT(f) ((((*(unsigned int*)&(f))&0x7f800000)==0) || \ (((*(unsigned int*)&(f))&0x7f800000)==0x7f800000))
#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus) --- 637,648 ---- #define PD_USE_TE_XPIX
! /* a test for NANs and denormals. Should only be necessary on i386. */
+ #ifdef __i386__ #define PD_BADFLOAT(f) ((((*(unsigned int*)&(f))&0x7f800000)==0) || \ (((*(unsigned int*)&(f))&0x7f800000)==0x7f800000)) + #else + #define PD_BADFLOAT(f) 0 + #endif
#if defined(_LANGUAGE_C_PLUS_PLUS) || defined(__cplusplus)
Index: notes.txt =================================================================== RCS file: /cvsroot/pure-data/pd/src/notes.txt,v retrieving revision 1.1.1.4.2.3 retrieving revision 1.1.1.4.2.4 diff -C2 -d -r1.1.1.4.2.3 -r1.1.1.4.2.4 *** notes.txt 23 Sep 2003 00:50:02 -0000 1.1.1.4.2.3 --- notes.txt 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.4 *************** *** 28,37 ****
fix for 0.37: ! don't prepend help- if sethalpname is called ! Tom schouten: $HOME undefined crashes Pd ! update 'getting pd to run' to start in with dialog panels ! MIDI on windows?
0.38: message dialog not to disappear sprout inlets/outlets on objects whose creation failed. --- 28,41 ----
fix for 0.37: ! ALSA readn - doesn't work yet. ! test MIDI I/O on all platforms, inc. sysex... ! canvas grows by 2 pixels? (what platform?)
0.38: + + makefile to set SETUID bit on install? + loading e-mailed patches without removing headers crashes pd + investigate gcc 3.3 warnings; try to reinstate -fstrict-aliasing + configure script to drop -Werror unless in the caller's environment message dialog not to disappear sprout inlets/outlets on objects whose creation failed. *************** *** 99,103 **** command line flag to defeat loading objects signal inlets with initialized values... - Pd to open html help on windows/mac flag to hide array names ??? have a way to disambiguate externs from different libs??? --- 103,106 ----
Index: s_audio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v retrieving revision 1.1.1.1.2.5 retrieving revision 1.1.1.1.2.6 diff -C2 -d -r1.1.1.1.2.5 -r1.1.1.1.2.6 *** s_audio.c 7 Oct 2003 14:31:45 -0000 1.1.1.1.2.5 --- s_audio.c 18 Nov 2003 10:34:10 -0000 1.1.1.1.2.6 *************** *** 184,188 **** { for (i = 0; i < MAXAUDIOINDEV; i++) ! audioindev[i] = i+1; naudioindev = nchindev; } --- 184,188 ---- { for (i = 0; i < MAXAUDIOINDEV; i++) ! audioindev[i] = i; naudioindev = nchindev; } *************** *** 230,234 **** { for (i = 0; i < MAXAUDIOOUTDEV; i++) ! audiooutdev[i] = i+1; naudiooutdev = nchoutdev; } --- 230,234 ---- { for (i = 0; i < MAXAUDIOOUTDEV; i++) ! audiooutdev[i] = i; naudiooutdev = nchoutdev; }
Index: s_audio_alsa.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_alsa.c,v retrieving revision 1.1.1.1.2.3 retrieving revision 1.1.1.1.2.4 diff -C2 -d -r1.1.1.1.2.3 -r1.1.1.1.2.4 *** s_audio_alsa.c 12 Sep 2003 21:02:15 -0000 1.1.1.1.2.3 --- s_audio_alsa.c 18 Nov 2003 10:34:10 -0000 1.1.1.1.2.4 *************** *** 43,50 **** snd_pcm_t *inhandle; snd_pcm_t *outhandle; } t_alsa_dev;
t_alsa_dev alsa_device; ! static short *alsa_buf = 0; static int alsa_samplewidth; static snd_pcm_status_t* in_status; --- 43,53 ---- snd_pcm_t *inhandle; snd_pcm_t *outhandle; + int innoninterleave; /* true if we're set for noninterleaved read */ + int outnoninterleave; /* same for write */ } t_alsa_dev;
t_alsa_dev alsa_device; ! static void *alsa_snd_buf = 0; ! static void **alsa_buf_ptrs; static int alsa_samplewidth; static snd_pcm_status_t* in_status; *************** *** 122,126 **** post("audio buffer set to %d", (int)(0.001 * sys_schedadvance));
! if (wantinchans) { --- 125,129 ---- post("audio buffer set to %d", (int)(0.001 * sys_schedadvance));
! alsa_device.innoninterleave = alsa_device.outnoninterleave = 0; if (wantinchans) { *************** *** 161,167 **** err = snd_pcm_hw_params_any(alsa_device.inhandle, hw_params); check_error(err, "snd_pcm_hw_params_any (input)"); ! // set interleaved access - FIXME deal with other access types ! err = snd_pcm_hw_params_set_access(alsa_device.inhandle, hw_params, ! SND_PCM_ACCESS_RW_INTERLEAVED); check_error(err, "snd_pcm_hw_params_set_access (input)"); // Try to set 32 bit format first --- 164,182 ---- err = snd_pcm_hw_params_any(alsa_device.inhandle, hw_params); check_error(err, "snd_pcm_hw_params_any (input)"); ! ! /* try to set interleaved access */ ! err = snd_pcm_hw_params_set_access(alsa_device.inhandle, ! hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); ! if (err < 0) ! { ! /* OK, so try non-interleaved */ ! err = snd_pcm_hw_params_set_access(alsa_device.inhandle, ! hw_params, SND_PCM_ACCESS_RW_NONINTERLEAVED); ! if (err >= 0) ! { ! post("using non-interleaved audio input"); ! alsa_device.innoninterleave = 1; ! } ! } check_error(err, "snd_pcm_hw_params_set_access (input)"); // Try to set 32 bit format first *************** *** 277,280 **** --- 292,313 ---- SND_PCM_ACCESS_RW_INTERLEAVED); check_error(err, "snd_pcm_hw_params_set_access (output)"); + + /* try to set interleaved access */ + err = snd_pcm_hw_params_set_access(alsa_device.outhandle, + hw_params, SND_PCM_ACCESS_RW_INTERLEAVED); + if (err < 0) + { + /* OK, so try non-interleaved */ + err = snd_pcm_hw_params_set_access(alsa_device.outhandle, + hw_params, SND_PCM_ACCESS_RW_NONINTERLEAVED); + if (err >= 0) + { + post("using non-interleaved audio"); + alsa_device.outnoninterleave = 1; + } + } + check_error(err, "snd_pcm_hw_params_set_access (output)"); + + // Try to set 32 bit format first err = snd_pcm_hw_params_set_format(alsa_device.outhandle, hw_params, *************** *** 385,395 ****
// set up the buffer ! if (alsa_buf) ! free(alsa_buf); ! alsa_buf = (short *)malloc( sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * (outchans > inchans ? outchans : inchans)); ! memset(alsa_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * (outchans > inchans ? outchans : inchans)); // fill the buffer with silence if (outchans) --- 418,436 ----
// set up the buffer ! if (alsa_snd_buf) ! free(alsa_snd_buf); ! alsa_snd_buf = (void *)malloc( sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * (outchans > inchans ? outchans : inchans)); ! memset(alsa_snd_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * (outchans > inchans ? outchans : inchans)); + /* make an array of pointers too in case we need them */ + if (alsa_buf_ptrs) + free(alsa_buf_ptrs); + alsa_buf_ptrs = (void **)malloc( + sizeof(void *) * (outchans > inchans ? outchans : inchans)); + for (i = 0; i < (outchans > inchans ? outchans : inchans); i++) + alsa_buf_ptrs[i] = (t_alsa_sample32 *)alsa_snd_buf + i * DEFDACBLKSIZE; + // fill the buffer with silence if (outchans) *************** *** 397,403 **** i = (frag_size * nfrags)/DEFDACBLKSIZE + 1; while (i--) ! snd_pcm_writei(alsa_device.outhandle, alsa_buf, DEFDACBLKSIZE); ! /* apparently we're not suppposed to start it in this case, ! but can (and must) if there's only ADC open (below). */ /* if ((err = snd_pcm_start(alsa_device.outhandle) < 0)) check_error(err, "output start failed\n"); */ --- 438,449 ---- i = (frag_size * nfrags)/DEFDACBLKSIZE + 1; while (i--) ! { ! if (alsa_device.outnoninterleave) ! snd_pcm_writen(alsa_device.outhandle, alsa_buf_ptrs, ! DEFDACBLKSIZE); ! else snd_pcm_writei(alsa_device.outhandle, alsa_snd_buf, ! DEFDACBLKSIZE); ! } ! /* confused about this: */ /* if ((err = snd_pcm_start(alsa_device.outhandle) < 0)) check_error(err, "output start failed\n"); */ *************** *** 485,496 **** if (alsa_samplewidth == 4) { ! for (i = 0, fp1 = fp; i < outchannels; i++, fp1 += DEFDACBLKSIZE) { ! for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; ! j += alsa_outchannels, fp2++) { ! float s1 = *fp2 * INT32_MAX; ! ((t_alsa_sample32 *)alsa_buf)[j] = CLIP32(s1); ! } } } --- 531,558 ---- if (alsa_samplewidth == 4) { ! if (alsa_device.outnoninterleave) { ! int n = outchannels * DEFDACBLKSIZE; ! for (i = 0, fp1 = fp; i < n; i++) { ! float s1 = *fp1 * INT32_MAX; ! ((t_alsa_sample32 *)alsa_snd_buf)[i] = CLIP32(s1); ! } ! n = alsa_outchannels * DEFDACBLKSIZE; ! for (; i < n; i++) ! ((t_alsa_sample32 *)alsa_snd_buf)[i] = 0; ! } ! else ! { ! for (i = 0, fp1 = fp; i < outchannels; i++, ! fp1 += DEFDACBLKSIZE) ! { ! for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; ! j += alsa_outchannels, fp2++) ! { ! float s1 = *fp2 * INT32_MAX; ! ((t_alsa_sample32 *)alsa_snd_buf)[j] = CLIP32(s1); ! } ! } } } *************** *** 507,517 **** else if (s < -32767) s = -32767; ! ((t_alsa_sample16 *)alsa_buf)[j] = s; } } }
! result = snd_pcm_writei(alsa_device.outhandle, alsa_buf, ! outtransfersize); if (result != (int)outtransfersize) { --- 569,583 ---- else if (s < -32767) s = -32767; ! ((t_alsa_sample16 *)alsa_snd_buf)[j] = s; } } }
! if (alsa_device.outnoninterleave) ! result = snd_pcm_writen(alsa_device.outhandle, alsa_buf_ptrs, ! outtransfersize); ! else result = snd_pcm_writei(alsa_device.outhandle, alsa_snd_buf, ! outtransfersize); ! if (result != (int)outtransfersize) { *************** *** 548,552 **** if (alsa_inchannels) { ! result = snd_pcm_readi(alsa_device.inhandle, alsa_buf, intransfersize); if (result < (int)intransfersize) { --- 614,622 ---- if (alsa_inchannels) { ! if (alsa_device.innoninterleave) ! result = snd_pcm_readn(alsa_device.inhandle, alsa_buf_ptrs, ! intransfersize); ! else result = snd_pcm_readi(alsa_device.inhandle, alsa_snd_buf, ! intransfersize); if (result < (int)intransfersize) { *************** *** 571,580 **** if (alsa_samplewidth == 4) { ! for (i = 0, fp1 = fp; i < inchannels; i++, fp1 += DEFDACBLKSIZE) { ! for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; ! j += alsa_inchannels, fp2++) ! *fp2 = (float) ((t_alsa_sample32 *)alsa_buf)[j] ! * (1./ INT32_MAX); } } --- 641,661 ---- if (alsa_samplewidth == 4) { ! if (alsa_device.innoninterleave) { ! int n = inchannels * DEFDACBLKSIZE; ! for (i = 0, fp1 = fp; i < n; i++) ! *fp1 = (float) ((t_alsa_sample32 *)alsa_snd_buf)[i] ! * (1./ INT32_MAX); ! } ! else ! { ! for (i = 0, fp1 = fp; i < inchannels; ! i++, fp1 += DEFDACBLKSIZE) ! { ! for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; ! j += alsa_inchannels, fp2++) ! *fp2 = (float) ((t_alsa_sample32 *)alsa_snd_buf)[j] ! * (1./ INT32_MAX); ! } } } *************** *** 585,589 **** for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; j += alsa_inchannels, fp2++) ! *fp2 = (float) ((t_alsa_sample16 *)alsa_buf)[j] * 3.051850e-05; } --- 666,670 ---- for (j = i, k = DEFDACBLKSIZE, fp2 = fp1; k--; j += alsa_inchannels, fp2++) ! *fp2 = (float) ((t_alsa_sample16 *)alsa_snd_buf)[j] * 3.051850e-05; } *************** *** 639,648 **** return; } ! memset(alsa_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * sys_outchannels); for (i = 0; i < 1000000; i++) { ! result = snd_pcm_writei(alsa_device.outhandle, alsa_buf, ! DEFDACBLKSIZE); if (result != (int)DEFDACBLKSIZE) break; --- 720,732 ---- return; } ! memset(alsa_snd_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * sys_outchannels); for (i = 0; i < 1000000; i++) { ! if (alsa_device.outnoninterleave) ! result = snd_pcm_writen(alsa_device.outhandle, alsa_buf_ptrs, ! DEFDACBLKSIZE); ! else result = snd_pcm_writei(alsa_device.outhandle, alsa_snd_buf, ! DEFDACBLKSIZE); if (result != (int)DEFDACBLKSIZE) break; *************** *** 654,662 **** { int i, result; ! memset(alsa_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * alsa_outchannels); for (i = 0; i < n; i++) { ! result = snd_pcm_writei(alsa_device.outhandle, alsa_buf, DEFDACBLKSIZE); #if 0 if (result != DEFDACBLKSIZE) --- 738,750 ---- { int i, result; ! memset(alsa_snd_buf, 0, sizeof(char) * alsa_samplewidth * DEFDACBLKSIZE * alsa_outchannels); for (i = 0; i < n; i++) { ! if (alsa_device.outnoninterleave) ! result = snd_pcm_writen(alsa_device.outhandle, alsa_buf_ptrs, ! DEFDACBLKSIZE); ! else result = snd_pcm_writei(alsa_device.outhandle, alsa_snd_buf, ! DEFDACBLKSIZE); #if 0 if (result != DEFDACBLKSIZE) *************** *** 671,675 **** for (i = 0; i < n; i++) { ! result = snd_pcm_readi(alsa_device.inhandle, alsa_buf, DEFDACBLKSIZE); #if 0 if (result != DEFDACBLKSIZE) --- 759,764 ---- for (i = 0; i < n; i++) { ! result = snd_pcm_readi(alsa_device.inhandle, alsa_snd_buf, ! DEFDACBLKSIZE); #if 0 if (result != DEFDACBLKSIZE)
Index: s_audio_oss.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_oss.c,v retrieving revision 1.1.1.1.2.3 retrieving revision 1.1.1.1.2.4 diff -C2 -d -r1.1.1.1.2.3 -r1.1.1.1.2.4 *** s_audio_oss.c 12 Sep 2003 21:02:15 -0000 1.1.1.1.2.3 --- s_audio_oss.c 18 Nov 2003 10:34:10 -0000 1.1.1.1.2.4 *************** *** 266,270 **** }
! #define O_AUDIOFLAG 0 /* O_NDELAY */
int oss_open_audio(int nindev, int *indev, int nchin, int *chin, --- 266,270 ---- }
! #define O_AUDIOFLAG O_NDELAY
int oss_open_audio(int nindev, int *indev, int nchin, int *chin, *************** *** 274,278 **** int inchannels = 0, outchannels = 0; char devname[20]; ! int n, i, fd; char buf[OSS_MAXSAMPLEWIDTH * DEFDACBLKSIZE * OSS_MAXCHPERDEV]; int num_devs = 0; --- 274,278 ---- int inchannels = 0, outchannels = 0; char devname[20]; ! int n, i, fd, flags; char buf[OSS_MAXSAMPLEWIDTH * DEFDACBLKSIZE * OSS_MAXCHPERDEV]; int num_devs = 0; *************** *** 321,324 **** --- 321,330 ---- else { + if (fcntl(fd, F_SETFD, 1) < 0) + post("couldn't set close-on-exec flag on audio"); + if ((flags = fcntl(fd, F_GETFL)) < 0) + post("couldn't get audio device flags"); + else if (fcntl(fd, F_SETFL, flags & (!O_NDELAY)) < 0) + post("couldn't set audio device flags"); if (sys_verbose) post("opened %s for reading and writing\n", devname); *************** *** 336,339 **** --- 342,351 ---- break; } + if (fcntl(fd, F_SETFD, 1) < 0) + post("couldn't set close-on-exec flag on audio"); + if ((flags = fcntl(fd, F_GETFL)) < 0) + post("couldn't get audio device flags"); + else if (fcntl(fd, F_SETFL, flags & (!O_NDELAY)) < 0) + post("couldn't set audio device flags"); if (sys_verbose) post("opened %s for writing only\n", devname); *************** *** 406,409 **** --- 418,427 ---- goto end_in_loop; } + if (fcntl(fd, F_SETFD, 1) < 0) + post("couldn't set close-on-exec flag on audio"); + if ((flags = fcntl(fd, F_GETFL)) < 0) + post("couldn't get audio device flags"); + else if (fcntl(fd, F_SETFL, flags & (!O_NDELAY)) < 0) + post("couldn't set audio device flags"); if (sys_verbose) post("opened %s for reading only\n", devname);
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.1.1.4.2.7 retrieving revision 1.1.1.4.2.8 diff -C2 -d -r1.1.1.4.2.7 -r1.1.1.4.2.8 *** s_main.c 23 Sep 2003 00:55:28 -0000 1.1.1.4.2.7 --- s_main.c 18 Nov 2003 10:34:10 -0000 1.1.1.4.2.8 *************** *** 8,12 **** */
! char pd_version[] = "Pd version 0.37.0 devel\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; --- 8,12 ---- */
! char pd_version[] = "Pd version 0.37.1 devel\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; *************** *** 51,54 **** --- 51,55 ---- static t_namelist *sys_messagelist; static int sys_version; + int sys_oldtclversion; /* hack to warn g_rtext.c about old text sel */
int sys_nmidiout = 1; *************** *** 182,186 **** t_namelist *nl; unsigned int i, j; ! if (argc != 1 + 3 * NHOSTFONT) bug("glob_initfromgui"); for (i = 0; i < NFONT; i++) { --- 183,187 ---- t_namelist *nl; unsigned int i, j; ! if (argc != 2 + 3 * NHOSTFONT) bug("glob_initfromgui"); for (i = 0; i < NFONT; i++) { *************** *** 226,229 **** --- 227,231 ---- namelist_free(sys_messagelist); sys_messagelist = 0; + sys_oldtclversion = atom_getfloatarg(1 + 3 * NHOSTFONT, argc, argv); }
Index: s_midi.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_midi.c,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3 *** s_midi.c 12 Sep 2003 21:07:02 -0000 1.1.1.1.2.2 --- s_midi.c 18 Nov 2003 10:34:10 -0000 1.1.1.1.2.3 *************** *** 226,241 **** { int mp_status; - int mp_sysex; int mp_gotbyte1; int mp_byte1; } t_midiparser;
! #define MIDINOTEOFF 0x80 ! #define MIDINOTEON 0x90 ! #define MIDIPOLYTOUCH 0xa0 ! #define MIDICONTROLCHANGE 0xb0 ! #define MIDIPROGRAMCHANGE 0xc0 ! #define MIDICHANNELTOUCH 0xd0 ! #define MIDIPITCHBEND 0xe0 /* functions in x_midi.c */ void inmidi_realtimein(int portno, int cmd); --- 226,256 ---- { int mp_status; int mp_gotbyte1; int mp_byte1; } t_midiparser;
! #define MIDINOTEOFF 0x80 /* 2 following 'data bytes' */ ! #define MIDINOTEON 0x90 /* 2 */ ! #define MIDIPOLYTOUCH 0xa0 /* 2 */ ! #define MIDICONTROLCHANGE 0xb0 /* 2 */ ! #define MIDIPROGRAMCHANGE 0xc0 /* 1 */ ! #define MIDICHANNELTOUCH 0xd0 /* 1 */ ! #define MIDIPITCHBEND 0xe0 /* 2 */ ! #define MIDISTARTSYSEX 0xf0 /* (until F7) */ ! #define MIDITIMECODE 0xf1 /* 1 */ ! #define MIDISONGPOS 0xf2 /* 2 */ ! #define MIDISONGSELECT 0xf3 /* 1 */ ! #define MIDIRESERVED1 0xf4 /* ? */ ! #define MIDIRESERVED2 0xf5 /* ? */ ! #define MIDITUNEREQUEST 0xf6 /* 0 */ ! #define MIDIENDSYSEX 0xf7 /* 0 */ ! #define MIDICLOCK 0xf8 /* 0 */ ! #define MIDITICK 0xf9 /* 0 */ ! #define MIDISTART 0xfa /* 0 */ ! #define MIDICONT 0xfb /* 0 */ ! #define MIDISTOP 0xfc /* 0 */ ! #define MIDIACTIVESENSE 0xfe /* 0 */ ! #define MIDIRESET 0xff /* 0 */ ! /* functions in x_midi.c */ void inmidi_realtimein(int portno, int cmd); *************** *** 266,322 **** { inmidi_byte(portno, byte); ! if (byte < 0xf0) { ! if (byte & 0x80) { parserp->mp_status = byte; ! parserp->mp_gotbyte1 = 0; } else { ! int cmd = (parserp->mp_status & 0xf0); ! int chan = (parserp->mp_status & 0xf); ! int byte1 = parserp->mp_byte1, gotbyte1 = parserp->mp_gotbyte1; ! switch (cmd) ! { ! case MIDINOTEOFF: ! if (gotbyte1) ! inmidi_noteon(portno, chan, byte1, 0), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDINOTEON: ! if (gotbyte1) ! inmidi_noteon(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDIPOLYTOUCH: ! if (gotbyte1) ! inmidi_polyaftertouch(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDICONTROLCHANGE: ! if (gotbyte1) ! inmidi_controlchange(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDIPROGRAMCHANGE: ! inmidi_programchange(portno, chan, byte); ! break; ! case MIDICHANNELTOUCH: ! inmidi_aftertouch(portno, chan, byte); ! break; ! case MIDIPITCHBEND: ! if (gotbyte1) ! inmidi_pitchbend(portno, chan, ((byte << 7) + byte1)), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! } } ! } } midi_intail = (midi_intail + 1 == MIDIQSIZE ? 0 : midi_intail + 1); --- 281,364 ---- { inmidi_byte(portno, byte); ! if (byte & 0x80) { ! if (byte == MIDITUNEREQUEST || byte == MIDIRESERVED1 || ! byte == MIDIRESERVED2) ! parserp->mp_status = 0; ! else if (byte == MIDISTARTSYSEX) { + inmidi_sysex(portno, byte); parserp->mp_status = byte; ! } ! else if (byte == MIDIENDSYSEX) ! { ! inmidi_sysex(portno, byte); ! parserp->mp_status = 0; } else { ! parserp->mp_status = byte; } ! parserp->mp_gotbyte1 = 0; ! } ! else ! { ! int cmd = (parserp->mp_status >= 0xf0 ? parserp->mp_status : ! (parserp->mp_status & 0xf0)); ! int chan = (parserp->mp_status & 0xf); ! int byte1 = parserp->mp_byte1, gotbyte1 = parserp->mp_gotbyte1; ! switch (cmd) ! { ! case MIDINOTEOFF: ! if (gotbyte1) ! inmidi_noteon(portno, chan, byte1, 0), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDINOTEON: ! if (gotbyte1) ! inmidi_noteon(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDIPOLYTOUCH: ! if (gotbyte1) ! inmidi_polyaftertouch(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDICONTROLCHANGE: ! if (gotbyte1) ! inmidi_controlchange(portno, chan, byte1, byte), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDIPROGRAMCHANGE: ! inmidi_programchange(portno, chan, byte); ! break; ! case MIDICHANNELTOUCH: ! inmidi_aftertouch(portno, chan, byte); ! break; ! case MIDIPITCHBEND: ! if (gotbyte1) ! inmidi_pitchbend(portno, chan, ((byte << 7) + byte1)), ! parserp->mp_gotbyte1 = 0; ! else parserp->mp_byte1 = byte, parserp->mp_gotbyte1 = 1; ! break; ! case MIDISTARTSYSEX: ! inmidi_sysex(portno, byte); ! break; ! ! /* other kinds of messages are just dropped here. We'll ! need another status byte before we start letting MIDI in ! again (no running status across "system" messages). */ ! case MIDITIMECODE: /* 1 data byte*/ ! break; ! case MIDISONGPOS: /* 2 */ ! break; ! case MIDISONGSELECT: /* 1 */ ! break; ! } ! } } midi_intail = (midi_intail + 1 == MIDIQSIZE ? 0 : midi_intail + 1);
Index: s_midi_pm.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_midi_pm.c,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3 *** s_midi_pm.c 2 Aug 2003 15:37:49 -0000 1.1.1.1.2.2 --- s_midi_pm.c 18 Nov 2003 10:34:10 -0000 1.1.1.1.2.3 *************** *** 133,139 **** }
void sys_putmidibyte(int portno, int byte) { ! post("sorry, no byte-by-byte MIDI output implemented in MAC OSX"); }
--- 133,223 ---- }
+ static int writemidi4(PortMidiStream* stream, int a, int b, int c, int d) + { + PmEvent buffer; + buffer.timestamp = 0; + buffer.message = ((a & 0xff) | ((b & 0xff) << 8) + | ((c & 0xff) << 16) | ((d & 0xff) << 24)); + Pm_Write(stream, &buffer, 1); + } + + void sys_putmidibyte(int portno, int byte) { ! /* try to parse the bytes into MIDI messages so they can ! fit into PortMidi buffers. */ ! static int mess[4]; ! static int nbytes = 0, sysex = 0, i; ! if (byte >= 0xf8) /* MIDI real time */ ! writemidi4(mac_midioutdevlist[portno], byte, 0, 0, 0); ! else if (byte == 0xf0) ! { ! mess[0] = 0xf7; ! nbytes = 1; ! sysex = 1; ! } ! else if (byte == 0xf7) ! { ! mess[nbytes] = byte; ! for (i = nbytes+1; i < 4; i++) ! mess[i] = 0; ! writemidi4(mac_midioutdevlist[portno], ! mess[0], mess[1], mess[2], mess[3]); ! sysex = 0; ! nbytes = 0; ! } ! else if (byte >= 0x80) ! { ! sysex = 0; ! if (byte == 0xf4 || byte == 0xf5 || byte == 0xf6) ! { ! writemidi4(mac_midioutdevlist[portno], byte, 0, 0, 0); ! nbytes = 0; ! } ! else ! { ! mess[0] = byte; ! nbytes = 1; ! } ! } ! else if (sysex) ! { ! mess[nbytes] = byte; ! nbytes++; ! if (nbytes == 4) ! { ! writemidi4(mac_midioutdevlist[portno], ! mess[0], mess[1], mess[2], mess[3]); ! nbytes = 0; ! } ! } ! else if (nbytes) ! { ! int status = mess[0]; ! if (status < 0xf0) ! status &= 0xf0; ! /* 2 byte messages: */ ! if (status == 0xc0 || status == 0xd0 || ! status == 0xf1 || status == 0xf3) ! { ! writemidi4(mac_midioutdevlist[portno], ! mess[0], byte, 0, 0); ! nbytes = (status < 0xf0 ? 1 : 0); ! } ! else ! { ! if (nbytes == 1) ! { ! mess[1] = byte; ! nbytes = 2; ! } ! else ! { ! writemidi4(mac_midioutdevlist[portno], ! mess[0], mess[1], byte, 0); ! nbytes = (status < 0xf0 ? 1 : 0); ! } ! } ! } }
Index: x_midi.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_midi.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.2.2.1 diff -C2 -d -r1.1.1.2 -r1.1.1.2.2.1 *** x_midi.c 9 May 2003 16:03:45 -0000 1.1.1.2 --- x_midi.c 18 Nov 2003 10:34:10 -0000 1.1.1.2.2.1 *************** *** 86,107 **** void inmidi_byte(int portno, int byte) { - static int sysex; t_atom at[2]; ! if (byte == 0xf0) ! sysex |= (1 << portno); ! if (sysexin_sym->s_thing && (sysex & (1 << portno))) { SETFLOAT(at, byte); SETFLOAT(at+1, portno + 1); ! pd_list(sysexin_sym->s_thing, 0, 2, at); } ! if (byte == 0xf7) ! sysex &= (~(1 << portno));
! if (midiin_sym->s_thing) { SETFLOAT(at, byte); SETFLOAT(at+1, portno + 1); ! pd_list(midiin_sym->s_thing, 0, 2, at); } } --- 86,106 ---- void inmidi_byte(int portno, int byte) { t_atom at[2]; ! if (midiin_sym->s_thing) { SETFLOAT(at, byte); SETFLOAT(at+1, portno + 1); ! pd_list(midiin_sym->s_thing, 0, 2, at); } ! }
! void inmidi_sysex(int portno, int byte) ! { ! t_atom at[2]; ! if (sysexin_sym->s_thing) { SETFLOAT(at, byte); SETFLOAT(at+1, portno + 1); ! pd_list(sysexin_sym->s_thing, 0, 2, at); } }