Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23869
Modified Files:
configure.in g_all_guis.c g_all_guis.h g_bang.c g_canvas.c
g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c g_rtext.c
g_scalar.c g_template.c g_toggle.c g_vdial.c g_vslider.c
g_vumeter.c m_binbuf.c m_pd.h m_sched.c makefile makefile.in
notes.txt s_audio.c s_audio_alsa.c s_audio_jack.c
s_audio_oss.c s_audio_pa.c s_inter.c s_loader.c s_main.c
s_midi.c s_midi_mmio.c s_midi_pm.c s_stuff.h u_main.tk
Log Message:
merged in version 0.37-1test6
Index: configure.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/configure.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** configure.in 12 Nov 2003 18:39:13 -0000 1.3
--- configure.in 22 Feb 2004 15:59:56 -0000 1.4
***************
*** 2,13 ****
AC_INIT(d_arithmetic.c)
! AC_SUBST(alsa)
! AC_SUBST(jack)
AC_SUBST(PDLIB)
- AC_SUBST(DEFINES)
AC_SUBST(MORECFLAGS)
AC_SUBST(EXT)
AC_SUBST(OPT_CFLAGS)
! AC_SUBST(USE_OPT_CFLAGS)
AC_SUBST(SYSSRC)
AC_SUBST(STRIPFLAG)
--- 2,13 ----
AC_INIT(d_arithmetic.c)
! AC_SUBST(alsa, yes)
! AC_SUBST(jack, no)
! AC_SUBST(portaudio, no)
AC_SUBST(PDLIB)
AC_SUBST(MORECFLAGS)
AC_SUBST(EXT)
AC_SUBST(OPT_CFLAGS)
! AC_SUBST(USE_OPT_CFLAGS, yes)
AC_SUBST(SYSSRC)
AC_SUBST(STRIPFLAG)
***************
*** 25,30 ****
AC_ARG_ENABLE(jack, [ --enable-jack jack audio server],
jack="yes")
AC_ARG_ENABLE(debug, [ --enable-debug debugging support],
! USE_OPT_CFLAGS="NO", USE_OPT_CFLAGS="YES")
dnl Checks for programs.
--- 25,34 ----
AC_ARG_ENABLE(jack, [ --enable-jack jack audio server],
jack="yes")
+ AC_ARG_ENABLE(portaudio, [ --enable-portaudio portaudio],
+ portaudio="yes")
AC_ARG_ENABLE(debug, [ --enable-debug debugging support],
! USE_OPT_CFLAGS="no")
! AC_ARG_ENABLE(static, [ --enable-static link statically],
! static=yes)
dnl Checks for programs.
***************
*** 68,75 ****
echo "pthreads required" || exit 1)
- dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
- if test "$alsa" != no; then
- AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound" ; alsa="yes",alsa="")
- fi
dnl Find paths to includes and libraries for X11
--- 72,75 ----
***************
*** 81,89 ****
dnl look for tcl 8.x... do I really have to go through all this!?
- #AC_CHECK_HEADER(tcl.h,, echo "no tcl/tk header found" || exit 1)
-
- # FreeBSD has lots of libs there ...
- LIBS="$LIBS -L/usr/local/lib"
-
foundit=no
if test $foundit == "no";
--- 81,84 ----
***************
*** 91,95 ****
AC_CHECK_HEADER(tcl.h,foundit=yes,)
fi
-
if test $foundit == "no";
then
--- 86,89 ----
***************
*** 99,107 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.7/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.7 -I/usr/local/include/tk8.7";foundit=yes,)
- fi
- if test $foundit == "no";
- then
AC_CHECK_HEADER(tcl8.6/tcl.h,
GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.6";foundit=yes,)
--- 93,96 ----
***************
*** 109,118 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.6/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.6 -I/usr/local/include/tk8.6";foundit=yes,)
- fi
-
- if test $foundit == "no";
- then
AC_CHECK_HEADER(tcl8.5/tcl.h,
GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.5";foundit=yes,)
--- 98,101 ----
***************
*** 120,129 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.5/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.5 -I/usr/local/include/tk8.5";foundit=yes,)
- fi
-
- if test $foundit == "no";
- then
AC_CHECK_HEADER(tcl8.4/tcl.h,
GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.4";foundit=yes,)
--- 103,106 ----
***************
*** 131,140 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.4/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.4 -I/usr/local/include/tk8.4";foundit=yes,)
- fi
-
- if test $foundit == "no";
- then
AC_CHECK_HEADER(tcl8.3/tcl.h,
GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.3";foundit=yes,)
--- 108,111 ----
***************
*** 142,151 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.3/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.3 -I/usr/local/include/tk8.3";foundit=yes,)
- fi
-
- if test $foundit == "no";
- then
AC_CHECK_HEADER(tcl8.2/tcl.h,
GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.2";foundit=yes,)
--- 113,116 ----
***************
*** 153,217 ****
if test $foundit == "no";
then
- AC_CHECK_HEADER(/usr/local/include/tcl8.2/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.2 -I/usr/local/include/tk8.2";foundit=yes,)
- fi
-
- if test $foundit == "no";
- then
echo no tcl header found
exit -1
fi
-
-
AC_CHECK_LIB(tcl8.7, main,,
- AC_CHECK_LIB(tcl87, main,LIBS="$LIBS -ltcl87",
AC_CHECK_LIB(tcl8.6, main,,
! AC_CHECK_LIB(tcl86, main,LIBS="$LIBS -ltcl86",
! AC_CHECK_LIB(tcl8.5, main,,
! AC_CHECK_LIB(tcl85, main,LIBS="$LIBS -ltcl85",
! AC_CHECK_LIB(tcl8.4, main,,
! AC_CHECK_LIB(tcl84, main,LIBS="$LIBS -ltcl84",
! AC_CHECK_LIB(tcl8.3, main,,
! AC_CHECK_LIB(tcl83, main,LIBS="$LIBS -ltcl83",
! AC_CHECK_LIB(tcl8.2, main,,
! AC_CHECK_LIB(tcl82, main,LIBS="$LIBS -ltcl82",
! AC_CHECK_LIB(tcl81, main,,
! AC_CHECK_LIB(tcl81, main,LIBS="$LIBS -ltcl81",
! AC_CHECK_LIB(tcl80, main,LIBS="$LIBS -ltcl80",
! AC_CHECK_LIB(tcl8.0, main))))))))))))))))
!
AC_CHECK_LIB(tk8.7, main,,
- AC_CHECK_LIB(tk87, main,LIBS="$LIBS -ltk87",
AC_CHECK_LIB(tk8.6, main,,
! AC_CHECK_LIB(tk86, main,LIBS="$LIBS -ltk86",
! AC_CHECK_LIB(tk8.5, main,,
! AC_CHECK_LIB(tk85, main,LIBS="$LIBS -ltk85",
! AC_CHECK_LIB(tk8.4, main,,
! AC_CHECK_LIB(tk84, main,LIBS="$LIBS -ltk84",
! AC_CHECK_LIB(tk8.3, main,,
! AC_CHECK_LIB(tk83, main,LIBS="$LIBS -ltk83",
! AC_CHECK_LIB(tk8.2, main,,
! AC_CHECK_LIB(tk82, main,LIBS="$LIBS -ltk82",
! AC_CHECK_LIB(tk81, main,,
! AC_CHECK_LIB(tk81, main,LIBS="$LIBS -ltk81",
! AC_CHECK_LIB(tk80, main,LIBS="$LIBS -ltk80",
! AC_CHECK_LIB(tk8.0, main))))))))))))))))
!
- dnl Checking for tk.h or tkstep.h - not used at the moment
- dnl AC_CHECK_HEADER(tk.h,DEFINES="$DEFINES -DTKINC=\\\"tk.h\\\"")
- dnl AC_CHECK_HEADER(tkstep.h,DEFINES="$DEFINES -DTKINC=\\\"tkstep.h\\\"")
if test `uname -s` = Linux;
then
LDFLAGS="-Wl,-export-dynamic"
EXT=pd_linux
! MORECFLAGS="-DDL_OPEN -DUSEAPI_PORTAUDIO -DPA_USE_OSS -DPA_LITTLE_ENDIAN \
-DUSEAPI_OSS \
-I../portaudio/pa_common \
! -I../portaudio/pablio -I../portaudio/portmidi-macosx -Werror"
! SYSSRC="s_midi_oss.c s_audio_pa.c s_audio_oss.c \
../portaudio/pa_common/pa_allocation.c \
../portaudio/pa_common/pa_converters.c \
--- 118,179 ----
if test $foundit == "no";
then
echo no tcl header found
exit -1
fi
AC_CHECK_LIB(tcl8.7, main,,
AC_CHECK_LIB(tcl8.6, main,,
! AC_CHECK_LIB(tcl8.5, main,,
! AC_CHECK_LIB(tcl8.4, main,,
! AC_CHECK_LIB(tcl8.3, main,,
! AC_CHECK_LIB(tcl8.2, main,,
! AC_CHECK_LIB(tcl8.0, main,,echo no tcl library found || exit 1)))))))
AC_CHECK_LIB(tk8.7, main,,
AC_CHECK_LIB(tk8.6, main,,
! AC_CHECK_LIB(tk8.5, main,,
! AC_CHECK_LIB(tk8.4, main,,
! AC_CHECK_LIB(tk8.3, main,,
! AC_CHECK_LIB(tk8.2, main,,
! AC_CHECK_LIB(tk8.0, main,,echo no tk library found || exit 1)))))))
if test `uname -s` = Linux;
then
+ dnl Ckecking for ALSA
+
+ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
+ if test x$alsa == xyes; then
+ echo yes ... alsa is... $alsa
+ AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound" ; alsa="yes",alsa="no")
+ fi
+
+ dnl Checking for JACK
+
+ AC_CHECK_LIB(rt,shm_open,LIBS="$LIBS -lrt")
+ AC_CHECK_LIB(jack,jack_set_xrun_callback,LIBS="$LIBS -ljack";jack=xrun,jack=no)
+ AC_CHECK_LIB(jack,jack_set_error_function,LIBS="$LIBS -ljack";jack=yes,jack=no)
+
LDFLAGS="-Wl,-export-dynamic"
+ if test "$static" = "yes"; then
+ LDFLAGS="$LDFLAGS -static"
+ fi
EXT=pd_linux
! MORECFLAGS="-DDL_OPEN -DPA_USE_OSS -DPA_LITTLE_ENDIAN \
-DUSEAPI_OSS \
-I../portaudio/pa_common \
! -I../portaudio/pablio -I../portaudio/portmidi-macosx \
! -fno-strict-aliasing"
! SYSSRC="s_midi_oss.c s_audio_oss.c"
! if test x$alsa == "xyes";
! then
! SYSSRC=$SYSSRC" s_audio_alsa.c"
! MORECFLAGS=$MORECFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA"
! LDFLAGS=$LDFLAGS" -lasound"
! fi
! if test x$portaudio == "xyes";
! then
! MORECFLAGS="-DUSEAPI_PORTAUDIO "$MORECFLAGS
! SYSSRC="s_audio_pa.c \
../portaudio/pa_common/pa_allocation.c \
../portaudio/pa_common/pa_converters.c \
***************
*** 227,254 ****
../portaudio/pa_unix/pa_unix_hostapis.c \
../portaudio/pa_unix/pa_unix_util.c \
! ../portaudio/pa_unix_oss/pa_unix_oss.c "
! STRIPFLAG=-s
! GUINAME="pd-gui"
! if test $USE_OPT_CFLAGS == "YES";
! then
! OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
! else
! OPT_CFLAGS="-g"
fi
- OSNUMBER=0
- fi
-
- dnl FreeBSD hack
- if test `uname -s` = FreeBSD;
- then
- LDFLAGS="-Wl,-export-dynamic -L/usr/local/lib/pth -lpthread"
- EXT=pd_linux
- MORECFLAGS="-DDL_OPEN -DUSEAPI_OSS"
- CFLAGS="$CFLAGS -I/usr/local/include"
- SYSSRC="s_midi_oss.c s_audio_oss.c "
STRIPFLAG=-s
GUINAME="pd-gui"
! GUIFLAGS="$GUIFLAGS -I/usr/X11R6/include -I/usr/local/include"
! if test $USE_OPT_CFLAGS == "YES";
then
OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
--- 189,204 ----
../portaudio/pa_unix/pa_unix_hostapis.c \
../portaudio/pa_unix/pa_unix_util.c \
! ../portaudio/pa_unix_oss/pa_unix_oss.c "$SYSSRC
! if test x$alsa == "xyes";
! then
! SYSSRC=$SYSSRC" \
! ../portaudio/pa_linux_alsa/callback_thread.c \
! ../portaudio/pa_linux_alsa/pa_linux_alsa.c \
! ../portaudio/pa_linux_alsa/blocking_calls.c "
! fi
fi
STRIPFLAG=-s
GUINAME="pd-gui"
! if test x$USE_OPT_CFLAGS == "xyes";
then
OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
***************
*** 256,286 ****
OPT_CFLAGS="-g"
fi
! OSNUMBER=0
! fi
!
!
! dnl **** note -- SGI/IRIX code is broken here!!! ***
!
! if test `uname -s` = IRIX64;
! then
! LDFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
! -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
! -shared -rdata_shared"
! EXT=pd_irix6
! MORECFLAGS=-DDL_OPEN
! SYSSRC=s_sgi.c
! STRIPFLAG=-s
! GUINAME="pd-gui"
! OSNUMBER=0
! fi
!
! if test `uname -s` = IRIX32;
! then
! LDFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared"
! EXT=pd_irix5
! MORECFLAGS=-DDL_OPEN
! SYSSRC=s_sgi.c
! STRIPFLAG=-s
! GUINAME="pd-gui"
OSNUMBER=0
fi
--- 206,210 ----
OPT_CFLAGS="-g"
fi
! echo OPT_CFLAGS --------------- $OPT_CFLAGS
OSNUMBER=0
fi
***************
*** 316,320 ****
-I/Library/Frameworks/Tcl.framework/Versions/Current/Headers \
-I/Library/Frameworks/Tcl.framework/Versions/8.4/PrivateHeaders"
! if test $USE_OPT_CFLAGS == "YES";
then
OPT_CFLAGS="-O2"
--- 240,244 ----
-I/Library/Frameworks/Tcl.framework/Versions/Current/Headers \
-I/Library/Frameworks/Tcl.framework/Versions/8.4/PrivateHeaders"
! if test x$USE_OPT_CFLAGS == "xyes";
then
OPT_CFLAGS="-O2"
***************
*** 324,327 ****
--- 248,283 ----
OSNUMBER=2
EXTERNTARGET=pd_darwin
+ if test x$jack == "xyes";
+ then
+ LDFLAGS=$LDFLAGS" -framework Jack"
+ MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK"
+ SYSSRC=$SYSSRC" s_audio_jack.c"
+ fi
+ fi
+
+ # support for jack, on either linux or darwin:
+ if test x$jack == "xyes";
+ then
+ MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK"
+ SYSSRC=$SYSSRC" s_audio_jack.c"
+ LDFLAGS=$LDFLAGS" -lrt -ljack"
+ fi
+ if test x$jack == "xrun";
+ then
+ MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK -DJACK_XRUN"
+ SYSSRC=$SYSSRC" s_audio_jack.c"
+ LDFLAGS=$LDFLAGS" -lrt -ljack"
+ fi
+
+ # extra flags for alpha machines
+ if test `uname -m | awk '{print $1}'` = alpha;
+ then
+ MORECFLAGS=$MORECFLAGS" -mieee -mcpu=ev56"
+ fi
+
+ # test for compaq compiler---not sure what this does or how to test it.
+ if test x$CC == xccc;
+ then
+ MORECFLAGS=$MORECFLAGS" -g3 -D__COMPAQC__ -arch host"
fi
Index: g_all_guis.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_all_guis.c 23 Sep 2003 00:18:13 -0000 1.2
--- g_all_guis.c 22 Feb 2004 16:00:02 -0000 1.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", 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,266 ----
}
! 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 + 3;
}
! /* 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 the
! fallback; if still nothing, set to "empty". */
! static void iemgui_init_sym2dollararg(t_iemgui *iemgui, t_symbol **symp,
! int indx, t_symbol *fallback)
{
! if (!*symp)
{
! t_binbuf *b = iemgui->x_obj.ob_binbuf;
! if (binbuf_getnatom(b) > indx)
{
! char buf[80];
! atom_string(binbuf_getvec(b) + indx, buf, 80);
! *symp = gensym(buf);
}
! else if (fallback)
! *symp = fallback;
! else *symp = gensym("empty");
}
}
! /* 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->x_snd);
! iemgui_init_sym2dollararg(iemgui, &iemgui->x_rcv_unexpanded,
! iemgui->x_binbufindex+2, iemgui->x_rcv);
! iemgui_init_sym2dollararg(iemgui, &iemgui->x_lab_unexpanded,
! iemgui->x_labelbindex, iemgui->x_lab);
! 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);
--- 351,360 ----
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)
{
--- 375,380 ----
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",
--- 404,410 ----
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);
--- 528,531 ----
***************
*** 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);
--- 537,540 ----
***************
*** 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)
--- 584,587 ----
***************
*** 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);
}
--- 628,636 ----
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
! );
}
--- 638,643 ----
{
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
! );
}
--- 646,662 ----
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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_all_guis.h 23 Sep 2003 00:18:13 -0000 1.2
--- g_all_guis.h 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_bang.c 23 Sep 2003 00:18:13 -0000 1.2
--- g_bang.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_canvas.c 23 Sep 2003 00:18:13 -0000 1.2
--- g_canvas.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 1029,1037 ****
/* When you ask a canvas its size the result is 2 pixels more than what
you gave it to open it; perhaps there's a 1-pixel border all around it
! or something. Anyway, we just add the 2 pixels back here: */
#ifdef MSW
! #define HORIZBORDER 2
! #define VERTBORDER 2
#else
#define HORIZBORDER 2
--- 1029,1038 ----
/* When you ask a canvas its size the result is 2 pixels more than what
you gave it to open it; perhaps there's a 1-pixel border all around it
! or something. Anyway, we just add the 2 pixels back here; seems we
! have to do this for linux but not MSW; not sure about MacOS. */
#ifdef MSW
! #define HORIZBORDER 0
! #define VERTBORDER 0
#else
#define HORIZBORDER 2
***************
*** 1302,1307 ****
if (newstate && !canvas_dspstate)
{
- canvas_start_dsp();
sys_set_audio_state(1);
}
else if (!newstate && canvas_dspstate)
--- 1303,1308 ----
if (newstate && !canvas_dspstate)
{
sys_set_audio_state(1);
+ canvas_start_dsp();
}
else if (!newstate && canvas_dspstate)
Index: g_hdial.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_hdial.c 23 Sep 2003 00:18:13 -0000 1.2
--- g_hdial.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_hslider.c 23 Sep 2003 00:18:13 -0000 1.2
--- g_hslider.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** g_mycanvas.c 2 Feb 2004 14:31:34 -0000 1.3
--- g_mycanvas.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 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))
***************
*** 337,343 ****
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;
***************
*** 354,362 ****
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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_numbox.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_numbox.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_rtext.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_rtext.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_scalar.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_scalar.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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_template.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_template.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_template.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_template.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 609,616 ****
if (!warned)
{
! post("warning -- 'template' is obsolete; replace with 'struct'");
warned = 1;
}
- post("name: %s", sym->s_name);
return (gtemplate_donew(sym, argc, argv));
}
--- 609,616 ----
if (!warned)
{
! post("warning -- 'template' (%s) is obsolete; replace with 'struct'",
! sym->s_name);
warned = 1;
}
return (gtemplate_donew(sym, argc, argv));
}
Index: g_toggle.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_toggle.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_toggle.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_toggle.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_vdial.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_vdial.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_vslider.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_vslider.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** g_vumeter.c 23 Sep 2003 00:18:14 -0000 1.2
--- g_vumeter.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** m_binbuf.c 23 Sep 2003 00:18:14 -0000 1.2
--- m_binbuf.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 447,451 ****
int ac = x->b_n;
int nargs;
-
while (1)
{
--- 447,450 ----
Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** m_pd.h 23 Sep 2003 00:18:14 -0000 1.2
--- m_pd.h 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 624,632 ****
#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)
--- 624,635 ----
#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: m_sched.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** m_sched.c 2 Feb 2004 14:31:34 -0000 1.3
--- m_sched.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 361,364 ****
--- 361,366 ----
sys_pollgui();
}
+ if (sys_quit)
+ return;
}
sys_time = next_sys_time;
***************
*** 400,404 ****
sys_sleepgrain = 5000;
sys_initmidiqueue();
! while (1)
{
int didsomething = 0;
--- 402,406 ----
sys_sleepgrain = 5000;
sys_initmidiqueue();
! while (!sys_quit)
{
int didsomething = 0;
Index: makefile
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** makefile 2 Feb 2004 14:31:34 -0000 1.5
--- makefile 22 Feb 2004 16:00:02 -0000 1.6
***************
*** 1,222 ****
! VPATH = ../obj:./
! OBJ_DIR = ../obj
! BIN_DIR = ../bin
! PDEXEC = $(BIN_DIR)/pd
! EXT= pd_linux
! GUINAME= pd-gui
!
! INSTALL_PREFIX = /usr/local
! GFLAGS = -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
!
! # there should be a better way to do this...
! prefix = /usr/local
! MANDIR = ${prefix}/man
!
! # ALSA compilation
!
! SOUND_ALSA = yes
!
! DEFINES =
! MORECFLAGS = -DDL_OPEN -DUSEAPI_PORTAUDIO -DPA_USE_OSS -DPA_LITTLE_ENDIAN -DUSEAPI_OSS -I../portaudio/pa_common -I../portaudio/pablio -I../portaudio/portmidi-macosx -Werror
!
! INCLUDE = -I.
! GINCLUDE = $(INCLUDE) -I/usr/include/tcl8.4
! GLIB = -ltk8.4 -ltcl8.4 -lX11 -L/usr/X11R6/lib -L/usr/local/lib
!
! LDFLAGS = -Wl,-export-dynamic
! LIB = -ldl -lm -lpthread -lasound
!
! #select either the DBG and OPT compiler flags below:
! OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
! WARN_CFLAGS = -Wall -W -Wstrict-prototypes -Werror \
! -Wno-unused -Wno-parentheses -Wno-switch
! ARCH_CFLAGS = -DPD -DUNIX
!
! CFLAGS = $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(DEFINES) $(MORECFLAGS)
!
! # you might want ALSA linked in non-shared because
! # many Linux machines don't have the ALSA shared library. To link
! # ALSA non-shared, move the # sign below.
!
! ifeq (${SOUND_ALSA},yes)
! CFLAGS += -DPA_USE_ALSA -DUSEAPI_ALSA
! SYSSRC += s_audio_alsa.c \
! ../portaudio/pa_linux_alsa/callback_thread.c \
! ../portaudio/pa_linux_alsa/pa_linux_alsa.c \
! ../portaudio/pa_linux_alsa/blocking_calls.c
! endif
!
! # Which system
!
! SYSTEM = $(shell uname -m)
!
! ifeq (${SYSTEM},alpha)
! #LIB += -lffm -lm
! CFLAGS += -mieee -mcpu=ev56
! endif
!
! # Which compiler
!
! ifeq (${CC},ccc)
! CFLAGS += -g3 -D__COMPAQC__ -arch host
! endif
!
! # the sources
!
! SYSSRC += s_midi_oss.c s_audio_pa.c s_audio_oss.c ../portaudio/pa_common/pa_allocation.c ../portaudio/pa_common/pa_converters.c ../portaudio/pa_common/pa_cpuload.c ../portaudio/pa_common/pa_dither.c ../portaudio/pa_common/pa_front.c ../portaudio/pa_common/pa_process.c ../portaudio/pa_common/pa_skeleton.c ../portaudio/pa_common/pa_stream.c ../portaudio/pa_common/pa_trace.c ../portaudio/pablio/pablio_pd.c ../portaudio/pablio/ringbuffer_pd.c ../portaudio/pa_unix/pa_unix_hostapis.c ../portaudio/pa_unix/pa_unix_util.c ../portaudio/pa_unix_oss/pa_unix_oss.c
!
! SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
! g_scalar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c \
! g_all_guis.c g_bang.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c \
! g_toggle.c g_vdial.c g_vslider.c g_vumeter.c \
! m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c \
! m_conf.c m_glob.c m_sched.c \
! s_main.c s_inter.c s_file.c s_print.c \
! s_loader.c s_path.c s_entry.c s_audio.c s_midi.c \
! d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \
! d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \
! d_delay.c d_resample.c \
! x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
! x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c d_soundfile.c \
! $(SYSSRC)
!
!
! OBJ = $(SRC:.c=.o)
! EXTERNS = ../extra/*/*.$(EXT)
!
! GSRC = t_main.c t_tkcmd.c
!
! GOBJ = $(GSRC:.c=.o)
!
! #
! # ------------------ targets ------------------------------------
! #
!
! .PHONY: pd gui externs all
!
! all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
! $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
!
! bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
! $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
!
! $(OBJ) : %.o : %.c
! $(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
!
! $(GOBJ) : %.o : %.c
! $(CC) $(CFLAGS) $(GFLAGS) $(GINCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
!
! pd: $(PDEXEC)
!
! gui: $(BIN_DIR)/$(GUINAME)
!
! pd-watchdog: $(BIN_DIR)/pd-watchdog
!
! $(BIN_DIR)/pd-watchdog: s_watchdog.c
! cc -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
!
! $(BIN_DIR)/pdsend: u_pdsend.c
! cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
!
! $(BIN_DIR)/pdreceive: u_pdreceive.c
! cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
!
! $(PDEXEC): $(OBJ)
! cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \
! $(LIB)
!
! $(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
! cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
! $(GLIB)
!
! $(BIN_DIR)/pd.tk: u_main.tk
! echo set pd_nt 0 > $(BIN_DIR)/pd.tk
! grep -v "set pd_nt" < u_main.tk >> $(BIN_DIR)/pd.tk
!
! #this is for Max OSX only...
! $(BIN_DIR)/pdtcl: $(GOBJ) $(GSRC)
! cd ../obj; libtool -dynamic -o $(BIN_DIR)/pdtcl $(GOBJ) \
! /Library/Frameworks/Tk.framework/Versions/Current/Tk \
! /Library/Frameworks/Tcl.framework/Versions/Current/Tcl \
! /usr/lib/libSystem.B.dylib
!
! externs:
! cd ../extra/bonk~;make
! cd ../extra/choice;make
! cd ../extra/expr~;make
! cd ../extra/fiddle~;make
! cd ../extra/loop~;make
! cd ../extra/lrshift~;make
! cd ../extra/pique;make
!
! INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)
! MANINSTDIR = $(DESTDIR)/$(MANDIR)
!
! install: all
! install -d $(INSTDIR)/lib/pd/bin
! install $(BIN_DIR)/$(GUINAME) $(INSTDIR)/lib/pd/bin/$(GUINAME)
! install $(BIN_DIR)/pd-watchdog $(INSTDIR)/lib/pd/bin/pd-watchdog
! install -m644 $(BIN_DIR)/pd.tk $(INSTDIR)/lib/pd/bin/pd.tk
! install -d $(INSTDIR)/bin
! install -m755 $(PDEXEC) $(INSTDIR)/bin/pd
! install -m 755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend
! install -m 755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive
! install -d $(INSTDIR)/lib/pd/extra
! install -d $(INSTDIR)/lib/pd/externs
! install -m 644 $(EXTERNS) $(INSTDIR)/lib/pd/extra
! cp -r ../doc $(INSTDIR)/lib/pd/
! install -d $(INSTDIR)/include
! install -m644 m_pd.h $(INSTDIR)/include/m_pd.h
! install -d $(MANINSTDIR)/man1
! gzip < ../man/pd.1 > $(MANINSTDIR)/man1/pd.1.gz
! chmod 644 $(MANINSTDIR)/man1/pd.1.gz
! gzip < ../man/pdsend.1 > $(MANINSTDIR)/man1/pdsend.1.gz
! chmod 644 $(MANINSTDIR)/man1/pdsend.1.gz
! gzip < ../man/pdreceive.1 > $(MANINSTDIR)/man1/pdreceive.1.gz
! chmod 644 $(MANINSTDIR)/man1/pdreceive.1.gz
!
! local-clean:
! -rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
! $(BIN_DIR)/pdreceive $(BIN_DIR)/pd-watchdog m_stamp.c
! -rm -f *~
! -rm -f $(BIN_DIR)/pdsend $(BIN_DIR)/pdreceive
! -(cd ../doc/6.externs; rm -f *.pd_linux)
! -rm -f makefile.dependencies
! touch makefile.dependencies
! chmod 666 makefile.dependencies
!
! extra-clean:
! -rm -f `find ../extra/ -name "*.pd_*"`
! -rm -f tags
!
! clean: extra-clean local-clean
!
! distclean: clean
! -rm config.cache config.log config.status makefile tags
! echo all: > makefile
! echo -e "\t./configure" >> makefile
! echo -e "\tmake" >> makefile
!
! tags: $(SRC) $(GSRC); ctags *.[ch]
!
! depend:
! $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
!
! uninstall:
! -rm -r $(INSTDIR)/lib/pd
! -rm $(INSTDIR)/bin/pd
! -rm $(INSTDIR)/bin/pdsend
! -rm $(INSTDIR)/bin/pdreceive
! -rm $(INSTDIR)/include/m_pd.h
! -rm $(MANINSTDIR)/man/man1/pd.1.gz
! -rm $(MANINSTDIR)/man/man1/pdsend.1.gz
! -rm $(MANINSTDIR)/man/man1/pdreceive.1.gz
!
! include makefile.dependencies
!
!
!
!
!
!
!
--- 1,3 ----
! all:
! ./configure
! make
Index: makefile.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** makefile.in 14 Oct 2003 10:05:28 -0000 1.2
--- makefile.in 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 9,21 ****
GFLAGS = -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
- # there should be a better way to do this...
- prefix = @prefix@
MANDIR = @mandir@
- # ALSA compilation
-
- SOUND_ALSA = @alsa@
-
- DEFINES = @DEFINES@
MORECFLAGS = @MORECFLAGS@
--- 9,14 ----
***************
*** 27,64 ****
LIB = @PDLIB@
- #select either the DBG and OPT compiler flags below:
OPT_CFLAGS = @OPT_CFLAGS@
! WARN_CFLAGS = -Wall -W -Wstrict-prototypes -Werror \
-Wno-unused -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD -DUNIX
! CFLAGS = $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(DEFINES) $(MORECFLAGS)
!
! # you might want ALSA linked in non-shared because
! # many Linux machines don't have the ALSA shared library. To link
! # ALSA non-shared, move the # sign below.
!
! ifeq (${SOUND_ALSA},yes)
! CFLAGS += -DPA_USE_ALSA -DUSEAPI_ALSA
! SYSSRC += s_audio_alsa.c \
! ../portaudio/pa_linux_alsa/callback_thread.c \
! ../portaudio/pa_linux_alsa/pa_linux_alsa.c \
! ../portaudio/pa_linux_alsa/blocking_calls.c
! endif
!
! # Which system
!
! SYSTEM = $(shell uname -m)
!
! ifeq (${SYSTEM},alpha)
! #LIB += -lffm -lm
! CFLAGS += -mieee -mcpu=ev56
! endif
!
! # Which compiler
!
! ifeq (${CC},ccc)
! CFLAGS += -g3 -D__COMPAQC__ -arch host
! endif
# the sources
--- 20,29 ----
LIB = @PDLIB@
OPT_CFLAGS = @OPT_CFLAGS@
! WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD -DUNIX
! CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS)
# the sources
***************
*** 83,87 ****
OBJ = $(SRC:.c=.o)
- EXTERNS = ../extra/*/*.$(EXT)
GSRC = t_main.c t_tkcmd.c
--- 48,51 ----
***************
*** 114,124 ****
$(BIN_DIR)/pd-watchdog: s_watchdog.c
! cc -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c
! cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
$(BIN_DIR)/pdreceive: u_pdreceive.c
! cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
$(PDEXEC): $(OBJ)
--- 78,88 ----
$(BIN_DIR)/pd-watchdog: s_watchdog.c
! $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c
! $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
$(BIN_DIR)/pdreceive: u_pdreceive.c
! $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
$(PDEXEC): $(OBJ)
***************
*** 151,155 ****
INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)
! MANINSTDIR = $(DESTDIR)/$(MANDIR)
install: all
--- 115,119 ----
INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)
! MANINSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)/$(MANDIR)
install: all
***************
*** 162,169 ****
install -m 755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend
install -m 755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive
! install -d $(INSTDIR)/lib/pd/extra
! install -d $(INSTDIR)/lib/pd/externs
! install -m 644 $(EXTERNS) $(INSTDIR)/lib/pd/extra
! cp -r ../doc $(INSTDIR)/lib/pd/
install -d $(INSTDIR)/include
install -m644 m_pd.h $(INSTDIR)/include/m_pd.h
--- 126,131 ----
install -m 755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend
install -m 755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive
! cp -pr ../doc ../extra $(INSTDIR)/lib/pd/
! rm -f $(INSTDIR)/extra/*/*.o
install -d $(INSTDIR)/include
install -m644 m_pd.h $(INSTDIR)/include/m_pd.h
***************
*** 180,184 ****
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd-watchdog m_stamp.c
-rm -f *~
- -rm -f $(BIN_DIR)/pdsend $(BIN_DIR)/pdreceive
-(cd ../doc/6.externs; rm -f *.pd_linux)
-rm -f makefile.dependencies
--- 142,145 ----
***************
*** 193,197 ****
distclean: clean
! -rm config.cache config.log config.status makefile tags
echo all: > makefile
echo -e "\t./configure" >> makefile
--- 154,159 ----
distclean: clean
! rm -rf config.cache config.log config.status makefile tags \
! autom4te-*.cache
echo all: > makefile
echo -e "\t./configure" >> makefile
***************
*** 204,215 ****
uninstall:
! -rm -r $(INSTDIR)/lib/pd
! -rm $(INSTDIR)/bin/pd
! -rm $(INSTDIR)/bin/pdsend
! -rm $(INSTDIR)/bin/pdreceive
! -rm $(INSTDIR)/include/m_pd.h
! -rm $(MANINSTDIR)/man/man1/pd.1.gz
! -rm $(MANINSTDIR)/man/man1/pdsend.1.gz
! -rm $(MANINSTDIR)/man/man1/pdreceive.1.gz
include makefile.dependencies
--- 166,177 ----
uninstall:
! rm -f -r $(INSTDIR)/lib/pd
! rm -f $(INSTDIR)/bin/pd
! rm -f $(INSTDIR)/bin/pdsend
! rm -f $(INSTDIR)/bin/pdreceive
! rm -f $(INSTDIR)/include/m_pd.h
! rm -f $(MANINSTDIR)/man1/pd.1.gz
! rm -f $(MANINSTDIR)/man1/pdsend.1.gz
! rm -f $(MANINSTDIR)/man1/pdreceive.1.gz
include makefile.dependencies
Index: notes.txt
===================================================================
RCS file: /cvsroot/pure-data/pd/src/notes.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** notes.txt 2 Feb 2004 14:31:34 -0000 1.3
--- notes.txt 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 14,18 ****
--- 14,27 ----
plug-in support
portaudio_pd files into src
+ settings saver (registry in Windows; .pdrc in linux; defaults system in OSX?)
+ text cut/copy/paste
GOP bounding box object
+ signal inlets to sense signals; fix +~ etc, vcf~, biquad~, and make a vcfb~
+
+ 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
+ message dialog not to disappear
+ sprout inlets/outlets on objects whose creation failed.
pd $1 bug ($1 is saved as it was evaluated, not as '$1')
why does changing the name of an explode in jupiter patch take so long?
***************
*** 20,30 ****
trouble typing into number boxes
abstraction reload doesn't have to vis everyone??
- check MIDI device numbering on MSW
show results of opening audio and MIDI on dialogs
- settings saver
- latency testing
windows escape from control-C
add standard bindings (ctl-o, etc) to dialogs
-
settable netsend and netreceive port numbers
suspend/resume graphics updates
--- 29,35 ----
***************
*** 32,36 ****
scheduler to do DSP computations even if no audio
hook to scheduler to let others get called for DSP I/O
- figure out how to avoid "dac freeze" if nosound
new: mline~, msnapshot~, abs~
flags to defeat adding specified classes from libraries
--- 37,40 ----
***************
*** 43,46 ****
--- 47,51 ----
problems:
+ qlist - 'next 1' seems not to work
arrays of non-existent templates crash
don't draw in/outlets on gui objects in graphs
***************
*** 60,63 ****
--- 65,69 ----
data:
+ allow field*2+5 etc. in drawing commands
vget, vset traversal objects
cursor to show (x, y) location
***************
*** 76,80 ****
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???
--- 82,85 ----
Index: s_audio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_audio.c 2 Feb 2004 14:31:34 -0000 1.3
--- s_audio.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 28,31 ****
--- 28,33 ----
#define SYS_XFERSIZE (SYS_SAMPLEWIDTH * SYS_XFERSAMPS)
+ /* these are set in this file when opening audio, but then may be reduced,
+ even to zero, in the system dependent open_audio routines. */
int sys_inchannels;
int sys_outchannels;
***************
*** 190,194 ****
{
for (i = 0; i < MAXAUDIOINDEV; i++)
! audioindev[i] = i+1;
naudioindev = nchindev;
}
--- 192,196 ----
{
for (i = 0; i < MAXAUDIOINDEV; i++)
! audioindev[i] = i;
naudioindev = nchindev;
}
***************
*** 236,240 ****
{
for (i = 0; i < MAXAUDIOOUTDEV; i++)
! audiooutdev[i] = i+1;
naudiooutdev = nchoutdev;
}
--- 238,242 ----
{
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.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_audio_alsa.c 2 Feb 2004 14:31:34 -0000 1.3
--- s_audio_alsa.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 39,50 ****
#endif
typedef struct _alsa_dev
{
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;
--- 39,57 ----
#endif
+ #if (SND_LIB_MAJOR < 1)
+ #define ALSAAPI9
+ #endif
+
typedef struct _alsa_dev
{
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;
***************
*** 61,64 ****
--- 68,72 ----
static void alsa_checkiosync( void);
+ static void alsa_numbertoname(int devno, char *devname, int nchar);
/* don't assume we can turn all 31 bits when doing float-to-fix;
***************
*** 90,93 ****
--- 98,102 ----
short* tmp_buf;
unsigned int tmp_uint;
+ snd_pcm_uframes_t tmp_snd_pcm_uframes;
int wantinchans, wantoutchans, devno;
***************
*** 106,113 ****
(naudiooutdev > 0 ? audiooutdev[0] : 0));
! /* device names are hw:0, plughw:0, hw:1, and so on. */
! if (devno & 1)
! sprintf(devname, "plughw:%d", devno/2);
! else sprintf(devname, "hw:%d", devno/2);
if (sys_verbose)
--- 115,119 ----
(naudiooutdev > 0 ? audiooutdev[0] : 0));
! alsa_numbertoname(devno, devname, 512);
if (sys_verbose)
***************
*** 122,126 ****
post("audio buffer set to %d", (int)(0.001 * sys_schedadvance));
!
if (wantinchans)
{
--- 128,132 ----
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
--- 167,185 ----
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
***************
*** 213,230 ****
--- 231,266 ----
snd_pcm_hw_params_get_period_size_max(hw_params, 0));
#endif
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_period_size_near(alsa_device.inhandle,
hw_params,
(snd_pcm_uframes_t)
frag_size, 0);
+ #else
+ tmp_snd_pcm_uframes = frag_size;
+ err = snd_pcm_hw_params_set_period_size_near(alsa_device.inhandle,
+ hw_params, &tmp_snd_pcm_uframes, 0);
+ #endif
check_error(err, "snd_pcm_hw_params_set_period_size_near (input)");
// post("fragsize b %d", frag_size);
// set the number of periods - ie numfrags
// post("nfrags a %d", nfrags);
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_periods_near(alsa_device.inhandle,
hw_params, nfrags, 0);
+ #else
+ tmp_uint = nfrags;
+ err = snd_pcm_hw_params_set_periods_near(alsa_device.inhandle,
+ hw_params, &tmp_uint, 0);
+ #endif
check_error(err, "snd_pcm_hw_params_set_periods_near (input)");
// set the buffer size
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_buffer_size_near(alsa_device.inhandle,
hw_params, nfrags * frag_size);
+ #else
+ tmp_snd_pcm_uframes = nfrags * frag_size;
+ err = snd_pcm_hw_params_set_buffer_size_near(alsa_device.inhandle,
+ hw_params, &tmp_snd_pcm_uframes);
+ #endif
check_error(err, "snd_pcm_hw_params_set_buffer_size_near (input)");
***************
*** 277,280 ****
--- 313,334 ----
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,
***************
*** 321,338 ****
#endif
// post("fragsize c %d", frag_size);
err = snd_pcm_hw_params_set_period_size_near(alsa_device.outhandle,
hw_params,
(snd_pcm_uframes_t)
frag_size, 0);
// post("fragsize d %d", frag_size);
check_error(err, "snd_pcm_hw_params_set_period_size_near (output)");
// set the number of periods - ie numfrags
err = snd_pcm_hw_params_set_periods_near(alsa_device.outhandle,
hw_params, nfrags, 0);
check_error(err, "snd_pcm_hw_params_set_periods_near (output)");
// set the buffer size
err = snd_pcm_hw_params_set_buffer_size_near(alsa_device.outhandle,
hw_params, nfrags * frag_size);
!
check_error(err, "snd_pcm_hw_params_set_buffer_size_near (output)");
--- 375,409 ----
#endif
// post("fragsize c %d", frag_size);
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_period_size_near(alsa_device.outhandle,
hw_params,
(snd_pcm_uframes_t)
frag_size, 0);
+ #else
+ tmp_snd_pcm_uframes = frag_size;
+ err = snd_pcm_hw_params_set_period_size_near(alsa_device.outhandle,
+ hw_params, &tmp_snd_pcm_uframes, 0);
+ #endif
// post("fragsize d %d", frag_size);
check_error(err, "snd_pcm_hw_params_set_period_size_near (output)");
// set the number of periods - ie numfrags
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_periods_near(alsa_device.outhandle,
hw_params, nfrags, 0);
+ #else
+ tmp_uint = nfrags;
+ err = snd_pcm_hw_params_set_periods_near(alsa_device.outhandle,
+ hw_params, &tmp_uint, 0);
+ #endif
check_error(err, "snd_pcm_hw_params_set_periods_near (output)");
// set the buffer size
+ #ifdef ALSAAPI9
err = snd_pcm_hw_params_set_buffer_size_near(alsa_device.outhandle,
hw_params, nfrags * frag_size);
! #else
! tmp_snd_pcm_uframes = nfrags * frag_size;
! err = snd_pcm_hw_params_set_buffer_size_near(alsa_device.outhandle,
! hw_params, &tmp_snd_pcm_uframes);
! #endif
check_error(err, "snd_pcm_hw_params_set_buffer_size_near (output)");
***************
*** 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)
--- 456,474 ----
// 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,413 ****
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"); */
}
! else if (snd_pcm_start(alsa_device.inhandle) < 0)
check_error(err, "input start failed\n");
!
alsa_outchannels = outchans;
alsa_inchannels = inchans;
! return 0;
}
--- 476,499 ----
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"); */
}
! else if (inchans)
! {
! if (snd_pcm_start(alsa_device.inhandle) < 0)
check_error(err, "input start failed\n");
! }
alsa_outchannels = outchans;
alsa_inchannels = inchans;
! return (!(inchans || outchans));
}
***************
*** 415,424 ****
{
int err;
! if (sys_inchannels)
{
err = snd_pcm_close(alsa_device.inhandle);
check_error(err, "snd_pcm_close (input)");
}
! if (sys_outchannels)
{
err = snd_pcm_close(alsa_device.outhandle);
--- 501,510 ----
{
int err;
! if (alsa_inchannels)
{
err = snd_pcm_close(alsa_device.inhandle);
check_error(err, "snd_pcm_close (input)");
}
! if (alsa_outchannels)
{
err = snd_pcm_close(alsa_device.outhandle);
***************
*** 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);
! }
}
}
--- 571,598 ----
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)
{
--- 609,623 ----
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)
{
--- 654,662 ----
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);
}
}
--- 681,701 ----
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;
}
--- 706,710 ----
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;
--- 760,772 ----
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)
--- 778,790 ----
{
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)
***************
*** 672,676 ****
for (i = 0; i < n; i++)
{
! result = snd_pcm_readi(alsa_device.inhandle, alsa_buf, DEFDACBLKSIZE);
#if 0
if (result != DEFDACBLKSIZE)
--- 800,805 ----
for (i = 0; i < n; i++)
{
! result = snd_pcm_readi(alsa_device.inhandle, alsa_snd_buf,
! DEFDACBLKSIZE);
#if 0
if (result != DEFDACBLKSIZE)
***************
*** 772,776 ****
int maxndev, int devdescsize)
{
! int ndev = 0, cardno = -1;
*canmulti = 0; /* only one device; must be the same for input&output */
while (!snd_card_next(&cardno) && cardno >= 0)
--- 901,905 ----
int maxndev, int devdescsize)
{
! int ndev = 0, cardno = -1, i, j;
*canmulti = 0; /* only one device; must be the same for input&output */
while (!snd_card_next(&cardno) && cardno >= 0)
***************
*** 806,809 ****
ndev++;
}
! *nindevs = *noutdevs = 2 * ndev;
}
--- 935,945 ----
ndev++;
}
! for (i = 0, j = 2*ndev; i < alsa_nnames; i++, j++)
! {
! if (j >= maxndev)
! break;
! snprintf(indevlist + j * devdescsize, devdescsize, "%s",
! alsa_names[i]);
! }
! *nindevs = *noutdevs = j;
}
Index: s_audio_jack.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_audio_jack.c 2 Feb 2004 14:31:34 -0000 1.3
--- s_audio_jack.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 26,30 ****
static jack_port_t *input_port[NUM_JACK_PORTS];
static jack_port_t *output_port[NUM_JACK_PORTS];
! static jack_client_t *jack_client;
char *jack_client_names[MAX_CLIENTS];
--- 26,31 ----
static jack_port_t *input_port[NUM_JACK_PORTS];
static jack_port_t *output_port[NUM_JACK_PORTS];
! static int outport_count = 0;
! static jack_client_t *jack_client = NULL;
char *jack_client_names[MAX_CLIENTS];
***************
*** 32,35 ****
--- 33,37 ----
pthread_cond_t jack_sem;
+
static int
process (jack_nframes_t nframes, void *arg)
***************
*** 39,45 ****
float *in;
if (nframes > JACK_OUT_MAX) jack_out_max = nframes;
else jack_out_max = JACK_OUT_MAX;
-
if (jack_filled >= nframes) {
if (jack_filled != nframes) fprintf(stderr,"Partial read");
--- 41,47 ----
float *in;
+
if (nframes > JACK_OUT_MAX) jack_out_max = nframes;
else jack_out_max = JACK_OUT_MAX;
if (jack_filled >= nframes) {
if (jack_filled != nframes) fprintf(stderr,"Partial read");
***************
*** 68,74 ****
static int
! srate (jack_nframes_t srate, void *arg)
{
- printf ("jack: sample rate %ld/sec\n", srate);
sys_dacsr = srate;
return 0;
--- 70,75 ----
static int
! jack_srate (jack_nframes_t srate, void *arg)
{
sys_dacsr = srate;
return 0;
***************
*** 203,212 ****
int j;
char port_name[80] = "";
- int samplerate;
int client_iterator = 0;
if ((inchans == 0) && (outchans == 0)) return 0;
- post("Testing for Jack");
if (outchans > NUM_JACK_PORTS) {
fprintf(stderr,"%d output ports not supported, setting to %d\n",outchans, NUM_JACK_PORTS);
--- 204,213 ----
int j;
char port_name[80] = "";
int client_iterator = 0;
+ int new_jack = 0;
+ int srate;
if ((inchans == 0) && (outchans == 0)) return 0;
if (outchans > NUM_JACK_PORTS) {
fprintf(stderr,"%d output ports not supported, setting to %d\n",outchans, NUM_JACK_PORTS);
***************
*** 220,297 ****
/* try to become a client of the JACK server (we allow two pd's)*/
!
! do {
! sprintf(port_name,"pure_data_%d",client_iterator);
! client_iterator++;
! }
! while (((jack_client = jack_client_new (port_name)) == 0) && client_iterator < 2);
!
! if (!jack_client) { // jack spits out enough messages already, do not warn
! return 1;
! }
!
! jack_get_clients();
!
! /* tell the JACK server to call `process()' whenever
! there is work to be done.
! */
!
! jack_set_process_callback (jack_client, process, 0);
! jack_set_error_function (jack_error);
#ifdef JACK_XRUN
! jack_set_xrun_callback (jack_client, jack_xrun, NULL);
#endif
! /* tell the JACK server to call `srate()' whenever
! the sample rate of the system changes.
! */
!
! jack_set_sample_rate_callback (jack_client, srate, 0);
!
! /* tell the JACK server to call `jack_shutdown()' if
! it ever shuts down, either entirely, or if it
! just decides to stop calling us.
! */
!
! jack_on_shutdown (jack_client, jack_shutdown, 0);
!
!
! /* display the current sample rate. once the client is activated
! (see below), you should rely on your own sample rate
! callback (see above) for this value.
! */
!
! samplerate = jack_get_sample_rate (jack_client);
!
/* create the ports */
!
for (j = 0; j < inchans; j++) {
sprintf(port_name, "input%d", j);
! input_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
}
for (j = 0; j < outchans; j++) {
sprintf(port_name, "output%d", j);
! output_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
}
/* tell the JACK server that we are ready to roll */
! if (jack_activate (jack_client)) {
! fprintf (stderr, "cannot activate client");
! return 1;
! }
!
! memset(jack_outbuf,0,sizeof(jack_outbuf));
!
! if (jack_client_names[0])
! jack_connect_ports(jack_client_names[0]);
!
! pthread_mutex_init(&jack_mutex,NULL);
! pthread_cond_init(&jack_sem,NULL);
! post("using JACK audio interface");
return 0;
}
--- 221,308 ----
/* try to become a client of the JACK server (we allow two pd's)*/
! if (!jack_client) {
! do {
! sprintf(port_name,"pure_data_%d",client_iterator);
! client_iterator++;
! } while (((jack_client = jack_client_new (port_name)) == 0) && client_iterator < 2);
!
! if (!jack_client) { // jack spits out enough messages already, do not warn
! return 1;
! }
!
! jack_get_clients();
+ /* tell the JACK server to call `process()' whenever
+ there is work to be done.
+ */
+
+ jack_set_process_callback (jack_client, process, 0);
+
+ jack_set_error_function (jack_error);
+
#ifdef JACK_XRUN
! jack_set_xrun_callback (jack_client, jack_xrun, NULL);
#endif
+
+ /* tell the JACK server to call `srate()' whenever
+ the sample rate of the system changes.
+ */
+
+ jack_set_sample_rate_callback (jack_client, jack_srate, 0);
+
+
+ /* tell the JACK server to call `jack_shutdown()' if
+ it ever shuts down, either entirely, or if it
+ just decides to stop calling us.
+ */
+
+ jack_on_shutdown (jack_client, jack_shutdown, 0);
+
+ for (j=0;j<NUM_JACK_PORTS;j++) {
+ input_port[j]=NULL;
+ output_port[j] = NULL;
+ }
+
+ new_jack = 1;
+ }
! /* display the current sample rate. once the client is activated
! (see below), you should rely on your own sample rate
! callback (see above) for this value.
! */
! srate = jack_get_sample_rate (jack_client);
! sys_dacsr = srate;
!
/* create the ports */
!
for (j = 0; j < inchans; j++) {
sprintf(port_name, "input%d", j);
! if (!input_port[j]) input_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
}
+
for (j = 0; j < outchans; j++) {
sprintf(port_name, "output%d", j);
! if (!output_port[j]) output_port[j] = jack_port_register (jack_client, port_name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
}
+ outport_count = outchans;
/* tell the JACK server that we are ready to roll */
! if (new_jack) {
! if (jack_activate (jack_client)) {
! fprintf (stderr, "cannot activate client");
! return 1;
! }
!
! memset(jack_outbuf,0,sizeof(jack_outbuf));
!
! if (jack_client_names[0])
! jack_connect_ports(jack_client_names[0]);
! pthread_mutex_init(&jack_mutex,NULL);
! pthread_cond_init(&jack_sem,NULL);
! }
return 0;
}
***************
*** 300,305 ****
{
! jack_started = 0;
! /* ignore for now */
}
--- 311,315 ----
{
! jack_started = 0;
}
***************
*** 343,346 ****
--- 353,371 ----
}
+ void jack_getdevs(char *indevlist, int *nindevs,
+ char *outdevlist, int *noutdevs, int *canmulti,
+ int maxndev, int devdescsize)
+ {
+ int i, ndev;
+ *canmulti = 0; /* supports multiple devices */
+ ndev = 1;
+ for (i = 0; i < ndev; i++)
+ {
+ sprintf(indevlist + i * devdescsize, "JACK");
+ sprintf(outdevlist + i * devdescsize, "JACK");
+ }
+ *nindevs = *noutdevs = ndev;
+ }
+
void jack_listdevs( void)
{
Index: s_audio_oss.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_oss.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** s_audio_oss.c 2 Feb 2004 14:31:34 -0000 1.4
--- s_audio_oss.c 22 Feb 2004 16:00:02 -0000 1.5
***************
*** 6,21 ****
/* this file inputs and outputs audio using the OSS API available on linux. */
- #ifdef __linux__
#include <linux/soundcard.h>
- #endif
-
- #ifdef __FreeBSD__
- #include <sys/soundcard.h>
- #include <sys/mman.h>
- #endif
-
-
-
-
#include "m_pd.h"
--- 6,10 ----
***************
*** 277,281 ****
}
! #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,
***************
*** 285,289 ****
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;
***************
*** 332,335 ****
--- 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);
***************
*** 347,350 ****
--- 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,410 ****
if (linux_dacs[n].d_fd >= 0)
{
! fd = linux_dacs[n].d_fd;
alreadyopened = 1;
}
--- 407,411 ----
if (linux_dacs[n].d_fd >= 0)
{
! fd = linux_adcs[n].d_fd;
alreadyopened = 1;
}
***************
*** 417,420 ****
--- 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);
***************
*** 790,794 ****
sp = (t_oss_int16 *)buf; i--; fp1++, sp += nchannels)
{
! for (j=0;j<sys_inchannels;j++)
fp1[j*DEFDACBLKSIZE] = (float)sp[j]*(float)3.051850e-05;
}
--- 797,801 ----
sp = (t_oss_int16 *)buf; i--; fp1++, sp += nchannels)
{
! for (j=0;j<nchannels;j++)
fp1[j*DEFDACBLKSIZE] = (float)sp[j]*(float)3.051850e-05;
}
***************
*** 796,801 ****
thischan += nchannels;
}
- if (thischan != sys_inchannels)
- bug("inchannels");
return (rtnval);
}
--- 803,806 ----
Index: s_audio_pa.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_pa.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** s_audio_pa.c 23 Sep 2003 00:18:14 -0000 1.2
--- s_audio_pa.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 128,131 ****
--- 128,132 ----
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
Pa_Terminate();
+ sys_inchannels = sys_outchannels = 0;
return (1);
}
Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_inter.c 2 Feb 2004 14:31:34 -0000 1.3
--- s_inter.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 48,51 ****
--- 48,60 ----
#define DEBUG_MESSDOWN 2 /* messages down from pd-gui to pd */
+ /* T.Grill - make it a _little_ more adaptable... */
+ #ifndef PDBINDIR
+ #define PDBINDIR "bin/"
+ #endif
+
+ #ifndef WISHAPP
+ #define WISHAPP "wish83.exe"
+ #endif
+
extern char pd_version[];
***************
*** 440,444 ****
action.sa_handler = sigfun;
memset(&action.sa_mask, 0, sizeof(action.sa_mask));
! #ifdef __linux__
action.sa_restorer = 0;
#endif
--- 449,453 ----
action.sa_handler = sigfun;
memset(&action.sa_mask, 0, sizeof(action.sa_mask));
! #if 0 /* GG says: don't use that */
action.sa_restorer = 0;
#endif
***************
*** 571,575 ****
signal(SIGALRM, SIG_IGN);
signal(SIGTERM, SIG_IGN);
! #ifdef __linux__
signal(SIGSTKFLT, sys_exithandler);
#endif
--- 580,584 ----
signal(SIGALRM, SIG_IGN);
signal(SIGTERM, SIG_IGN);
! #if 0 /* GG says: don't use that */
signal(SIGSTKFLT, sys_exithandler);
#endif
***************
*** 597,601 ****
for (i = 1; i < 22; i++)
SETFLOAT(zz + i, defaultfontshit[i-1]);
! glob_initfromgui(0, 0, 22, zz);
}
else
--- 606,611 ----
for (i = 1; i < 22; i++)
SETFLOAT(zz + i, defaultfontshit[i-1]);
! SETFLOAT(zz+22,0);
! glob_initfromgui(0, 0, 23, zz);
}
else
***************
*** 742,746 ****
strcpy(scriptbuf, "\"");
strcat(scriptbuf, sys_libdir->s_name);
! strcat(scriptbuf, "/bin/pd.tk\"");
sys_bashfilename(scriptbuf, scriptbuf);
--- 752,756 ----
strcpy(scriptbuf, "\"");
strcat(scriptbuf, sys_libdir->s_name);
! strcat(scriptbuf, "/" PDBINDIR "pd.tk\"");
sys_bashfilename(scriptbuf, scriptbuf);
***************
*** 748,755 ****
strcpy(wishbuf, sys_libdir->s_name);
! strcat(wishbuf, "/bin/wish83.exe");
sys_bashfilename(wishbuf, wishbuf);
! spawnret = _spawnl(P_NOWAIT, wishbuf, "wish83", scriptbuf, portbuf, 0);
if (spawnret < 0)
{
--- 758,765 ----
strcpy(wishbuf, sys_libdir->s_name);
! strcat(wishbuf, "/" PDBINDIR WISHAPP);
sys_bashfilename(wishbuf, wishbuf);
! spawnret = _spawnl(P_NOWAIT, wishbuf, WISHAPP, scriptbuf, portbuf, 0);
if (spawnret < 0)
{
***************
*** 892,895 ****
--- 902,906 ----
}
+
/* T.Grill - import clean quit function */
extern void sys_exit(void);
***************
*** 898,902 ****
Call glob_quit() below to exit cleanly.
LATER try to save dirty documents even in the bad case. */
-
void sys_bail(int n)
{
--- 909,912 ----
Index: s_loader.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** s_loader.c 10 Nov 2003 16:13:11 -0000 1.2
--- s_loader.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 26,30 ****
static char sys_dllextent[] =
#ifdef __FreeBSD__
! ".pd_linux";
#endif
#ifdef IRIX
--- 26,30 ----
static char sys_dllextent[] =
#ifdef __FreeBSD__
! ".pd_freebsd";
#endif
#ifdef IRIX
Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_main.c 2 Feb 2004 14:31:34 -0000 1.3
--- s_main.c 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 8,12 ****
*/
! char pd_version[] = "Pd version 0.37.1 TEST6 devel\n";
char pd_compiletime[] = __TIME__;
char pd_compiledate[] = __DATE__;
--- 8,12 ----
*/
! char pd_version[] = "Pd version 0.37.1 TEST6\n";
char pd_compiletime[] = __TIME__;
char pd_compiledate[] = __DATE__;
***************
*** 52,55 ****
--- 52,56 ----
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;
***************
*** 183,187 ****
t_namelist *nl;
unsigned int i, j;
! if (argc != 1 + 3 * NHOSTFONT) bug("glob_initfromgui");
for (i = 0; i < NFONT; i++)
{
--- 184,188 ----
t_namelist *nl;
unsigned int i, j;
! if (argc != 2 + 3 * NHOSTFONT) bug("glob_initfromgui");
for (i = 0; i < NFONT; i++)
{
***************
*** 227,230 ****
--- 228,232 ----
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.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** s_midi.c 23 Sep 2003 00:18:14 -0000 1.2
--- s_midi.c 22 Feb 2004 16:00:02 -0000 1.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_mmio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_midi_mmio.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** s_midi_mmio.c 23 Sep 2003 00:18:14 -0000 1.2
--- s_midi_mmio.c 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 80,85 ****
{
MIDIOUTCAPS mocap;
! int devno = (midioutvec[i] == DEFMIDIDEV ?
! MIDI_MAPPER : midioutvec[i]-1);
result = midiOutOpen(&hMidiOut[dev], devno, 0, 0,
CALLBACK_NULL);
--- 80,84 ----
{
MIDIOUTCAPS mocap;
! int devno = midioutvec[i];
result = midiOutOpen(&hMidiOut[dev], devno, 0, 0,
CALLBACK_NULL);
***************
*** 535,539 ****
wRtn = midiInOpen((LPHMIDIIN)&hMidiIn[ndev],
! midiinvec[i] - 1,
(DWORD)midiInputHandler,
(DWORD)lpCallbackInstanceData[ndev],
--- 534,538 ----
wRtn = midiInOpen((LPHMIDIIN)&hMidiIn[ndev],
! midiinvec[i],
(DWORD)midiInputHandler,
(DWORD)lpCallbackInstanceData[ndev],
***************
*** 662,666 ****
}
! void sys_open_midi(int nmidiin, int *midiinvec, int nmidiout, int *midioutvec)
{
if (nmidiout)
--- 661,666 ----
}
! void sys_do_open_midi(int nmidiin, int *midiinvec,
! int nmidiout, int *midioutvec)
{
if (nmidiout)
***************
*** 681,685 ****
}
!
/* list the audio and MIDI device names */
void sys_listmididevs(void)
--- 681,685 ----
}
! #if 0
/* list the audio and MIDI device names */
void sys_listmididevs(void)
***************
*** 714,715 ****
--- 714,745 ----
}
+ #endif
+
+ void midi_getdevs(char *indevlist, int *nindevs,
+ char *outdevlist, int *noutdevs, int maxndev, int devdescsize)
+ {
+ int i, nin = midiInGetNumDevs(), nout = midiOutGetNumDevs();
+ UINT wRtn;
+ if (nin > maxndev)
+ nin = maxndev;
+ for (i = 0; i < nin; i++)
+ {
+ MIDIINCAPS micap;
+ wRtn = midiInGetDevCaps(i, (LPMIDIINCAPS) &micap, sizeof(micap));
+ strncpy(indevlist + i * devdescsize,
+ (wRtn ? "???" : micap.szPname), devdescsize);
+ indevlist[(i+1) * devdescsize - 1] = 0;
+ }
+ if (nout > maxndev)
+ nout = maxndev;
+ for (i = 0; i < nout; i++)
+ {
+ MIDIOUTCAPS mocap;
+ wRtn = midiOutGetDevCaps(i, (LPMIDIOUTCAPS) &mocap, sizeof(mocap));
+ strncpy(outdevlist + i * devdescsize,
+ (wRtn ? "???" : mocap.szPname), devdescsize);
+ outdevlist[(i+1) * devdescsize - 1] = 0;
+ }
+ *nindevs = nin;
+ *noutdevs = nout;
+ }
Index: s_midi_pm.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_midi_pm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** s_midi_pm.c 23 Sep 2003 00:18:14 -0000 1.2
--- s_midi_pm.c 22 Feb 2004 16:00:02 -0000 1.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 void 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: s_stuff.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** s_stuff.h 10 Nov 2003 16:13:11 -0000 1.3
--- s_stuff.h 22 Feb 2004 16:00:02 -0000 1.4
***************
*** 136,143 ****
#define API_DEFSTRING "OSS"
#endif
- #ifdef __FreeBSD__
- #define API_DEFAULT API_OSS
- #define API_DEFSTRING "OSS"
- #endif
#ifdef MSW
#define API_DEFAULT API_MMIO
--- 136,139 ----
Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** u_main.tk 23 Sep 2003 00:18:14 -0000 1.2
--- u_main.tk 22 Feb 2004 16:00:02 -0000 1.3
***************
*** 124,127 ****
--- 124,132 ----
bind . <Control-Key> {pdtk_pd_ctrlkey %W %K 0}
bind . <Control-Shift-Key> {pdtk_pd_ctrlkey %W %K 1}
+ if {$pd_nt == 2} {
+ bind . <Mod1-Key> {pdtk_canvas_ctrlkey %W %K 0}
+ bind . <Mod1-Shift-Key> {pdtk_canvas_ctrlkey %W %K 1}
+ }
+
wm title . "Pd"
***************
*** 925,928 ****
--- 930,937 ----
bind $name.c <Alt-Key> {pdtk_canvas_altkey %W %K %A}
# bind $name.c <Mod1-Key> {puts stderr [concat mod1 %W %K %A]}
+ if {$pd_nt == 2} {
+ bind $name.c <Mod1-Key> {pdtk_canvas_ctrlkey %W %K 0}
+ bind $name.c <Mod1-Shift-Key> {pdtk_canvas_ctrlkey %W %K 1}
+ }
bind $name.c <Key> {pdtk_canvas_key %W %K %A 0}
bind $name.c <Shift-Key> {pdtk_canvas_key %W %K %A 1}
***************
*** 2642,2645 ****
--- 2651,2663 ----
set height7 [lindex [font metrics -*-courier-bold--normal--36-*] 5]
+ set tclpatch [info patchlevel]
+ if {$tclpatch == "8.3.0" || \
+ $tclpatch == "8.3.1" || \
+ $tclpatch == "8.3.2" || \
+ $tclpatch == "8.3.3" } {
+ set oldtclversion 1
+ } else {
+ set oldtclversion 0
+ }
pd [concat pd init [pdtk_enquote [pwd]] \
8 $width1 $height1 \
***************
*** 2650,2654 ****
24 $width6 $height6 \
36 $width7 $height7 \
! \;];
# add the audio and help menus to the Pd window. We delayed this
--- 2668,2672 ----
24 $width6 $height6 \
36 $width7 $height7 \
! $oldtclversion \;];
# add the audio and help menus to the Pd window. We delayed this