[PD-cvs] SF.net SVN: pure-data:[10506] branches/pd-extended/0.41/pd/src
eighthave at users.sourceforge.net
eighthave at users.sourceforge.net
Sat Jan 10 20:43:17 CET 2009
Revision: 10506
http://pure-data.svn.sourceforge.net/pure-data/?rev=10506&view=rev
Author: eighthave
Date: 2009-01-10 19:43:17 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
- merged all conflicts, built and ran. it makes sound! We now have
Pd-extended 0.41-4!
- removed 64bit_arrays-0.40.1.patch, Miller implemented 64-bit support in a
different way
Modified Paths:
--------------
branches/pd-extended/0.41/pd/src/configure.in
branches/pd-extended/0.41/pd/src/d_array.c
branches/pd-extended/0.41/pd/src/d_soundfile.c
branches/pd-extended/0.41/pd/src/g_canvas.c
branches/pd-extended/0.41/pd/src/g_graph.c
branches/pd-extended/0.41/pd/src/g_hdial.c
branches/pd-extended/0.41/pd/src/g_hslider.c
branches/pd-extended/0.41/pd/src/g_numbox.c
branches/pd-extended/0.41/pd/src/g_rtext.c
branches/pd-extended/0.41/pd/src/g_template.c
branches/pd-extended/0.41/pd/src/g_toggle.c
branches/pd-extended/0.41/pd/src/g_vdial.c
branches/pd-extended/0.41/pd/src/g_vslider.c
branches/pd-extended/0.41/pd/src/g_vumeter.c
branches/pd-extended/0.41/pd/src/m_binbuf.c
branches/pd-extended/0.41/pd/src/m_obj.c
branches/pd-extended/0.41/pd/src/s_audio_jack.c
branches/pd-extended/0.41/pd/src/s_entry.c
branches/pd-extended/0.41/pd/src/s_file.c
branches/pd-extended/0.41/pd/src/s_inter.c
branches/pd-extended/0.41/pd/src/s_main.c
branches/pd-extended/0.41/pd/src/s_path.c
branches/pd-extended/0.41/pd/src/u_main.tk
Property Changed:
----------------
branches/pd-extended/0.41/pd/src/
branches/pd-extended/0.41/pd/src/d_soundfile.c
branches/pd-extended/0.41/pd/src/g_graph.c
branches/pd-extended/0.41/pd/src/g_numbox.c
branches/pd-extended/0.41/pd/src/g_template.c
branches/pd-extended/0.41/pd/src/g_toggle.c
branches/pd-extended/0.41/pd/src/g_vslider.c
branches/pd-extended/0.41/pd/src/g_vumeter.c
branches/pd-extended/0.41/pd/src/makefile.in
Property changes on: branches/pd-extended/0.41/pd/src
___________________________________________________________________
Modified: svn:mergeinfo
- /tags/pd/0.41-4/src:9670-10494
/tags/pd/pd-0.41-4/src:9603-9669
/trunk/pd/src:6083-9602
+ /tags/pd/0.41-4/src:9670-10497
/tags/pd/pd-0.41-4/src:9603-9669
/trunk/pd/src:6083-9602
Modified: branches/pd-extended/0.41/pd/src/configure.in
===================================================================
--- branches/pd-extended/0.41/pd/src/configure.in 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/configure.in 2009-01-10 19:43:17 UTC (rev 10506)
@@ -9,6 +9,7 @@
AC_SUBST(portmidi, no)
AC_SUBST(binarymode, -m755)
AC_SUBST(fftw, no)
+AC_SUBST(tk, yes)
AC_SUBST(PDLIB)
AC_SUBST(CPPFLAGS)
AC_SUBST(MORECFLAGS)
@@ -23,6 +24,7 @@
AC_SUBST(OSNUMBER)
AC_SUBST(EXTERNTARGET)
AC_SUBST(ASIOSRC)
+AC_SUBST(GUISRC)
dnl other defaults
@@ -42,7 +44,7 @@
static=$enableval)
AC_ARG_ENABLE(setuid, [ --enable-setuid install as setuid (linux)],
setuid=$enableval)
-AC_ARG_ENABLE(fftw, [ --enable-fftw use FFTW package],
+AC_ARG_ENABLE(fftw, [ --enable-fftw use FFTW package],
fftw=$enableval)
AC_ARG_ENABLE(fat, [ --disable-fat build fat binary on Mac OS X],
fat=$enableval, fat="yes")
@@ -81,7 +83,7 @@
dnl Checking for `sin' function in -lm:
AC_CHECK_LIB(m, sin,PDLIB="$PDLIB -lm",
- echo "math library required" || exit 1)
+ echo "math library required" || exit 1)
dnl Checking for `pthread_create' function in -pthread
AC_CHECK_LIB(pthread, pthread_create,PDLIB="$PDLIB -lpthread",
@@ -91,7 +93,7 @@
echo "pthreads required"; exit 1))))
dnl Check for fftw package
-if test x$fftw == "xyes";
+if test x$fftw = "xyes";
then
AC_CHECK_LIB(fftw, fftw_one,PDLIB="$PDLIB -lfftw",
echo "fftw package not found - using built-in FFT"; fftw=no)
@@ -100,83 +102,89 @@
dnl look for tcl 8.x... do I really have to go through all this!?
foundit=no
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl.h,foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.7/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.7";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.7";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.6/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.6";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.6";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.5/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.5";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.5";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.4/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.4";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.4";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.4/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.4";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.4";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.3/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.3";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.3";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
AC_CHECK_HEADER(tcl8.2/tcl.h,
- GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.2";foundit=yes,)
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.2";foundit=yes,)
fi
-if test $foundit == "no";
+if test $foundit = "no";
then
echo no tcl header found
- echo bolding trying without...
+ echo bolding trying without...
# exit -1
fi
AC_CHECK_LIB(tcl85, main,,
- AC_CHECK_LIB(tcl8.5, main,,
+ AC_CHECK_LIB(tcl8.5, main,,
AC_CHECK_LIB(tcl84, 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,,
+ 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(tk85, main,,
- AC_CHECK_LIB(tk8.5, main,,
+ AC_CHECK_LIB(tk8.5, main,,
AC_CHECK_LIB(tk84, 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,,
+ 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;
+if test x$tk != "xno"; then
+GUISRC="t_main.c t_tkcmd.c"
+else
+GUISRC=
+fi
+
+if test `uname -s` = Linux;
then
dnl Ckecking for ALSA
echo .................... alsa= $alsa
dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
- if test x$alsa == xyes; then
- AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound" ; alsa="yes",alsa="no")
+ if test x$alsa = xyes; then
+ AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound" ; alsa="yes",alsa="no")
fi
dnl Checking for JACK
- if test x$jack == xyes; then
+ if test x$jack = xyes; then
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)
@@ -187,114 +195,124 @@
LDFLAGS="$LDFLAGS -static"
fi
EXT=pd_linux
- CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX\
- -DUSEAPI_OSS \
- -I../portaudio/pa_common -I../portaudio/pablio \
- -I../portmidi/pm_common \
- -I../portmidi/pm_linux \
- -fno-strict-aliasing"
+ CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD\
+ -DUSEAPI_OSS \
+ -fno-strict-aliasing"
SYSSRC="s_midi_oss.c s_audio_oss.c"
- if test x$alsa == "xyes";
+ if test x$alsa = "xyes";
then
- SYSSRC=$SYSSRC" s_audio_alsa.c s_audio_alsamm.c s_midi_alsa.c"
- CPPFLAGS=$CPPFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA"
- LDFLAGS=$LDFLAGS" -lasound"
+ SYSSRC=$SYSSRC" s_audio_alsa.c s_audio_alsamm.c s_midi_alsa.c"
+ CPPFLAGS=$CPPFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA"
+ LDFLAGS=$LDFLAGS" -lasound"
fi
-
- if test x$portaudio == "xyes";
-
-
+ if test x$portaudio = "xyes";
then
- CPPFLAGS=$CPPFLAGS" -DUSEAPI_PORTAUDIO -DPA19"
- SYSSRC="s_audio_pa.c \
- s_audio_pablio.c \
- s_audio_paring.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/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/pa_linux_alsa.c"
- CPPFLAGS=$CPPFLAGS" -Wno-error"
- fi
+ CPPFLAGS=$CPPFLAGS" -DUSEAPI_PORTAUDIO -DHAVE_SYS_SOUNDCARD_H \
+ -Wno-error \
+ -I../portaudio/include -I../portaudio/src/common \
+ -I../portaudio/src/os/unix/ \
+ -I../portmidi/pm_common \
+ -I../portmidi/pm_linux"
+ SYSSRC="s_audio_pa.c \
+ s_audio_pablio.c \
+ s_audio_paring.c \
+ ../portaudio/src/common/pa_allocation.c \
+ ../portaudio/src/common/pa_converters.c \
+ ../portaudio/src/common/pa_cpuload.c \
+ ../portaudio/src/common/pa_dither.c \
+ ../portaudio/src/common/pa_front.c \
+ ../portaudio/src/common/pa_process.c \
+ ../portaudio/src/common/pa_skeleton.c \
+ ../portaudio/src/common/pa_stream.c \
+ ../portaudio/src/common/pa_trace.c \
+ ../portaudio/src/common/pa_debugprint.c \
+ ../portaudio/src/common/pa_ringbuffer.c \
+ ../portaudio/src/os/unix/pa_unix_hostapis.c \
+ ../portaudio/src/os/unix/pa_unix_util.c \
+ ../portaudio/src/hostapi/oss/pa_unix_oss.c "$SYSSRC
+ if test x$alsa = "xyes";
+ then
+ SYSSRC="../portaudio/src/hostapi/alsa/pa_linux_alsa.c "$SYSSRC
+ CPPFLAGS=$CPPFLAGS" -DPA_USE_ALSA"
+ fi
+ if test x$jack = "xyes";
+ then
+ SYSSRC="../portaudio/src/hostapi/jack/pa_jack.c "$SYSSRC
+ CPPFLAGS=$CPPFLAGS" -DPA_USE_JACK"
+ fi
fi
- if test x$setuid == "xyes";
+ if test x$setuid = "xyes";
then
- binarymode="-m4755"
+ binarymode="-m4755"
fi
STRIPFLAG=-s
GUINAME="pd-gui"
- if test x$USE_DEBUG_CFLAGS == "xyes";
+ if test x$USE_DEBUG_CFLAGS = "xyes";
then
- MORECFLAGS=$MORECFLAGS" -g"
+ MORECFLAGS=$MORECFLAGS" -g"
else
- MORECFLAGS=$MORECFLAGS" -O6 -funroll-loops -fomit-frame-pointer"
+ MORECFLAGS=$MORECFLAGS" -O6 -funroll-loops -fomit-frame-pointer"
fi
- if test x$jack == "xyes";
+ if test x$jack = "xyes";
then
LDFLAGS=$LDFLAGS" -lrt -ljack"
fi
- if test x$jack == "xrun";
+ if test x$jack = "xrun";
then
LDFLAGS=$LDFLAGS" -lrt -ljack"
fi
- echo MORECFLAGS --------------- $MORECFLAGS
OSNUMBER=0
fi
-if test `uname -s` == Darwin;
+if test `uname -s` = Darwin;
then
LDFLAGS="-Wl -framework CoreAudio \
-framework AudioUnit -framework AudioToolbox \
-framework Carbon -framework CoreMIDI"
EXT=pd_darwin
- CPPFLAGS="-DDL_OPEN -DMACOSX -I/usr/X11R6/include \
- -I../portaudio/pa_common -I../portaudio/pablio \
- -I../portmidi/pm_common -I../portmidi/pm_mac \
- -I../portmidi/porttime \
- -DUSEAPI_PORTAUDIO -DPA19 -DPA_USE_COREAUDIO"
-dnl for Mac OS X 10.3 (i.e. < 10.4)
+ CPPFLAGS="-DDL_OPEN -DMACOSX -DUNISTD -I/usr/X11R6/include \
+ -I../portaudio/include -I../portaudio/src/common \
+ -I../portaudio/src/os/mac_osx/ \
+ -I../portmidi/pm_common -I../portmidi/pm_mac \
+ -I../portmidi/porttime \
+ -DUSEAPI_PORTAUDIO -DPA19 -DPA_USE_COREAUDIO -DNEWBUFFER"
+ dnl for Mac OS X 10.3 (i.e. < 10.4)
if test `uname -r` = 7.9.0;
then
- fat="no"
+ fat="no"
fi
if test "x$fat" == "xyes";
then
MORECFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk \
-arch i386 -arch ppc -Wno-error"
- EXTERNTARGET=d_fat
+ EXTERNTARGET=d_fat
LDFLAGS=$LDFLAGS" -arch i386 -arch ppc"
else
- MORECFLAGS="-DMACOSX3 -Wno-error"
- EXTERNTARGET=d_ppc
+ MORECFLAGS="-DMACOSX3 -DPA_BIG_ENDIAN -Wno-error"
+ EXTERNTARGET=d_ppc
fi
SYSSRC="s_midi_pm.c s_audio_pa.c \
- s_audio_pablio.c \
- s_audio_paring.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/pa_unix/pa_unix_util.c \
- ../portaudio/pa_mac_core/pa_mac_core.c \
- ../portaudio/pa_mac/pa_mac_hostapis.c \
+ s_audio_pablio.c \
+ s_audio_paring.c \
+ ../portaudio/src/common/pa_allocation.c \
+ ../portaudio/src/common/pa_converters.c \
+ ../portaudio/src/common/pa_cpuload.c \
+ ../portaudio/src/common/pa_dither.c \
+ ../portaudio/src/common/pa_front.c \
+ ../portaudio/src/common/pa_process.c \
+ ../portaudio/src/common/pa_skeleton.c \
+ ../portaudio/src/common/pa_stream.c \
+ ../portaudio/src/common/pa_trace.c \
+ ../portaudio/src/common/pa_debugprint.c \
+ ../portaudio/src/common/pa_ringbuffer.c \
+ ../portaudio/src/os/unix/pa_unix_util.c \
+ ../portaudio/src/os/mac_osx/pa_mac_hostapis.c \
+ ../portaudio/src/hostapi/coreaudio/pa_mac_core.c \
+ ../portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c \
+ ../portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c \
../portmidi/pm_mac/pmmac.c \
../portmidi/pm_mac/pmmacosxcm.c \
../portmidi/pm_common/pmutil.c \
@@ -304,34 +322,34 @@
GUINAME="libPdTcl.dylib"
# find the Tcl/Tk Frameworks
- if test -d "../../Frameworks";
+ if test -d "../../Frameworks";
then
# Miller's location
TCLTK_FRAMEWORKS_PATH="../../Frameworks"
- elif test -d "/Library/Frameworks";
- then
+ elif test -d "/Library/Frameworks";
+ then
# get it from the default install location
TCLTK_FRAMEWORKS_PATH="/Library/Frameworks"
else
# Panther has Tcl here; Tiger has Tcl and Tk here
TCLTK_FRAMEWORKS_PATH="/System/Library/Frameworks"
- fi
+ fi
GUIFLAGS="-F$TCLTK_FRAMEWORKS_PATH -framework Tcl -framework Tk \
-I$TCLTK_FRAMEWORKS_PATH/Tk.framework/Versions/Current/Headers \
-I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/Current/Headers \
-I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/8.4/PrivateHeaders"
- if test x$USE_DEBUG_CFLAGS == "xyes";
+ if test x$USE_DEBUG_CFLAGS = "xyes";
then
- MORECFLAGS=$MORECFLAGS" -g"
+ MORECFLAGS=$MORECFLAGS" -g"
else
- MORECFLAGS=$MORECFLAGS" -O2"
+ MORECFLAGS=$MORECFLAGS" -O2"
fi
OSNUMBER=2
- if test x$jack == "xyes";
+ if test x$jack = "xyes";
then
LDFLAGS=$LDFLAGS" -weak_framework Jackmp"
fi
- if test x$jack == "xrun";
+ if test x$jack = "xrun";
then
LDFLAGS=$LDFLAGS" -weak_framework Jackmp"
fi
@@ -340,31 +358,35 @@
# only Windows uses ASIO, for the rest, set to blank
ASIOSRC=
-if test `uname -s` == MINGW32_NT-5.0;
+if test `uname -s` = MINGW32_NT-5.0;
then
EXT=dll
MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -DPD_INTERNAL \
- -I../portaudio/pa_common -I../portaudio/pablio \
+ -I../portaudio/include -I../portaudio/src/common \
+ -I../portaudio/src/os/win/ \
-mwindows -mms-bitfields "$MORECFLAGS
PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++"
SYSSRC="s_audio_pa.c s_audio_pablio.c s_audio_paring.c \
s_audio_mmio.c s_midi_mmio.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/pa_win/pa_win_util.c \
- ../portaudio/pa_win/pa_win_hostapis.c \
- ../portaudio/pa_win_wmme/pa_win_wmme.c"
- ASIOSRC="../portaudio/pa_asio/iasiothiscallresolver.cpp \
- ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \
- ../asio/asiodrivers.cpp ../asio/asiolist.cpp"
+ ../portaudio/src/common/pa_allocation.c \
+ ../portaudio/src/common/pa_converters.c \
+ ../portaudio/src/common/pa_cpuload.c \
+ ../portaudio/src/common/pa_dither.c \
+ ../portaudio/src/common/pa_front.c \
+ ../portaudio/src/common/pa_process.c \
+ ../portaudio/src/common/pa_skeleton.c \
+ ../portaudio/src/common/pa_stream.c \
+ ../portaudio/src/common/pa_trace.c \
+ ../portaudio/src/common/pa_debugprint.c \
+ ../portaudio/src/common/pa_ringbuffer.c \
+ ../portaudio/src/os/win/pa_win_util.c \
+ ../portaudio/src/os/win/pa_win_hostapis.c \
+ ../portaudio/src/os/win/pa_x86_plain_converters.c \
+ ../portaudio/src/hostapi/wmme/pa_win_wmme.c"
+ ASIOSRC="../portaudio/src/hostapi/asio/iasiothiscallresolver.cpp \
+ ../portaudio/src/hostapi/pa_asio/asio.cpp ../asio/asio.cpp \
+ ../asio/asiodrivers.cpp ../asio/asiolist.cpp"
STRIPFLAG="--strip-unneeded"
GUINAME="pdtcl.dll"
GUIFLAGS=
@@ -372,18 +394,18 @@
# support for jack, on either linux or darwin:
-if test x$jack == "xyes";
+if test x$jack = "xyes";
then
MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK"
SYSSRC=$SYSSRC" s_audio_jack.c"
fi
-if test x$jack == "xrun";
+if test x$jack = "xrun";
then
MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK -DJACK_XRUN"
SYSSRC=$SYSSRC" s_audio_jack.c"
fi
-if test x$fftw == "xyes";
+if test x$fftw = "xyes";
then
SYSSRC=$SYSSRC" d_fft_fftw.c d_fftroutine.c"
LDFLAGS=$LDFLAGS" -lfftw"
@@ -391,18 +413,6 @@
SYSSRC=$SYSSRC" d_fft_mayer.c d_fftroutine.c"
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
-
## JMZ{
## this does not do very much, but i guess it is a good idea to use it...
AC_SYS_LARGEFILE
@@ -428,6 +438,16 @@
fi
## }JMZ: end of large-file support section
+if test -d ../obj
+then echo -n
+else mkdir ../obj
+fi
+
+if test -d ../bin
+then echo -n
+else mkdir ../bin
+fi
+
AST_EXT_LIB_CHECK([SINF], [m], [sinf])
AST_EXT_LIB_CHECK([COSF], [m], [cosf])
AST_EXT_LIB_CHECK([ATANF], [m], [atanf])
Modified: branches/pd-extended/0.41/pd/src/d_array.c
===================================================================
--- branches/pd-extended/0.41/pd/src/d_array.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/d_array.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -8,7 +8,6 @@
#include "m_pd.h"
-#define ASTRIDE (sizeof(union word)/sizeof(t_sample))
/* ------------------------- tabwrite~ -------------------------- */
@@ -53,16 +52,15 @@
if (endphase > phase)
{
int nxfer = endphase - phase;
- float *fp = x->x_vec + phase*ASTRIDE;
+ float *fp = x->x_vec + phase;
if (nxfer > n) nxfer = n;
- phase += nxfer*ASTRIDE;
+ phase += nxfer;
while (nxfer--)
{
float f = *in++;
if (PD_BIGORSMALL(f))
f = 0;
- *fp = f;
- fp += ASTRIDE;
+ *fp++ = f;
}
if (phase >= endphase)
{
@@ -178,15 +176,13 @@
goto zero;
nxfer = endphase - phase;
- fp = x->x_vec + phase*ASTRIDE;
+ fp = x->x_vec + phase;
if (nxfer > n)
nxfer = n;
n3 = n - nxfer;
phase += nxfer;
- while (nxfer--) {
- *out++ = *fp;
- fp += ASTRIDE;
- }
+ while (nxfer--)
+ *out++ = *fp++;
if (phase >= endphase)
{
clock_delay(x->x_clock, 0);
@@ -312,7 +308,7 @@
index = 0;
else if (index > maxindex)
index = maxindex;
- *out++ = buf[index* ASTRIDE];
+ *out++ = buf[index];
}
return (w+5);
zero:
@@ -429,11 +425,11 @@
else if (index > maxindex)
index = maxindex, frac = 1;
else frac = findex - index;
- fp = buf + index* ASTRIDE;
- a = fp[-1* ASTRIDE];
+ fp = buf + index;
+ a = fp[-1];
b = fp[0];
- c = fp[1* ASTRIDE];
- d = fp[2* ASTRIDE];
+ c = fp[1];
+ d = fp[2];
/* if (!i && !(count++ & 1023))
post("fp = %lx, shit = %lx, b = %f", fp, buf->b_shit, b); */
cminusb = c-b;
@@ -597,13 +593,13 @@
float frac, a, b, c, d, cminusb;
tf.tf_d = dphase;
dphase += *in++ * conv;
- addr = tab + (tf.tf_i[HIOFFSET] & mask)* ASTRIDE;
+ addr = tab + (tf.tf_i[HIOFFSET] & mask);
tf.tf_i[HIOFFSET] = normhipart;
frac = tf.tf_d - UNITBIT32;
a = addr[0];
- b = addr[1* ASTRIDE];
- c = addr[2* ASTRIDE];
- d = addr[3* ASTRIDE];
+ b = addr[1];
+ c = addr[2];
+ d = addr[3];
cminusb = c-b;
*out++ = b + frac * (
cminusb - 0.1666667f * (1.-frac) * (
@@ -724,8 +720,7 @@
float f = *in++;
if (PD_BIGORSMALL(f))
f = 0;
- *dest = f;
- dest += ASTRIDE;
+ *dest++ = f;
}
if (!i--)
{
@@ -794,10 +789,8 @@
if (from)
{
int vecsize = x->x_vecsize;
- while (vecsize--){
- *out++ = *from;
- from += ASTRIDE;
- }
+ while (vecsize--)
+ *out++ = *from++;
vecsize = n - x->x_vecsize;
while (vecsize--)
*out++ = 0;
@@ -867,7 +860,7 @@
int n = f;
if (n < 0) n = 0;
else if (n >= npoints) n = npoints - 1;
- outlet_float(x->x_obj.ob_outlet, (npoints ? vec[n*ASTRIDE] : 0));
+ outlet_float(x->x_obj.ob_outlet, (npoints ? vec[n] : 0));
}
}
@@ -916,21 +909,21 @@
else if (npoints < 4)
outlet_float(x->x_obj.ob_outlet, 0);
else if (f <= 1)
- outlet_float(x->x_obj.ob_outlet, vec[ 1*ASTRIDE]);
+ outlet_float(x->x_obj.ob_outlet, vec[1]);
else if (f >= npoints - 2)
- outlet_float(x->x_obj.ob_outlet, vec[(npoints - 2)* ASTRIDE]);
+ outlet_float(x->x_obj.ob_outlet, vec[npoints - 2]);
else
{
int n = f;
float a, b, c, d, cminusb, frac, *fp;
if (n >= npoints - 2)
n = npoints - 3;
- fp = vec + n* ASTRIDE;
+ fp = vec + n;
frac = f - n;
- a = fp[-1*ASTRIDE];
- b = fp[0*ASTRIDE];
- c = fp[1*ASTRIDE];
- d = fp[2*ASTRIDE];
+ a = fp[-1];
+ b = fp[0];
+ c = fp[1];
+ d = fp[2];
cminusb = c-b;
outlet_float(x->x_obj.ob_outlet, b + frac * (
cminusb - 0.1666667f * (1.-frac) * (
@@ -988,7 +981,7 @@
n = 0;
else if (n >= vecsize)
n = vecsize-1;
- vec[n*ASTRIDE] = f;
+ vec[n] = f;
garray_redraw(a);
}
}
Modified: branches/pd-extended/0.41/pd/src/d_soundfile.c
===================================================================
--- branches/pd-extended/0.41/pd/src/d_soundfile.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/d_soundfile.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -34,12 +34,14 @@
#define MAXSFCHANS 64
-#define ASTRIDE (sizeof(union word)/sizeof(t_sample))
-
#ifdef _LARGEFILE64_SOURCE
# define open open64
# define lseek lseek64
+#define off_t __off64_t
#endif
+#ifdef MSW
+#define off_t long
+#endif
/***************** soundfile header structures ************************/
@@ -378,7 +380,8 @@
}
}
/* seek past header and any sample frames to skip */
- sysrtn = lseek(fd, nchannels * bytespersamp * skipframes + headersize, 0);
+ sysrtn = lseek(fd,
+ ((off_t)nchannels) * bytespersamp * skipframes + headersize, 0);
if (sysrtn != nchannels * bytespersamp * skipframes + headersize)
return (-1);
bytelimit -= nchannels * bytespersamp * skipframes;
@@ -429,13 +432,13 @@
p_bigendian, p_nchannels, p_bytelimit, skipframes));
}
-static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
+static void soundfile_xferin_sample(int sfchannels, int nvecs, t_sample **vecs,
long itemsread, unsigned char *buf, int nitems, int bytespersamp,
- int bigendian)
+ int bigendian, int spread)
{
int i, j;
unsigned char *sp, *sp2;
- float *fp;
+ t_sample *fp;
int nchannels = (sfchannels < nvecs ? sfchannels : nvecs);
int bytesperframe = bytespersamp * sfchannels;
for (i = 0, sp = buf; i < nchannels; i++, sp += bytespersamp)
@@ -444,14 +447,14 @@
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16));
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[1] << 24) | (sp2[0] << 16));
}
}
@@ -459,15 +462,15 @@
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16)
| (sp2[2] << 8));
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*fp = SCALE * ((sp2[2] << 24) | (sp2[1] << 16)
| (sp2[0] << 8));
}
@@ -476,15 +479,15 @@
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*(long *)fp = ((sp2[0] << 24) | (sp2[1] << 16)
| (sp2[2] << 8) | sp2[3]);
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + itemsread*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
*(long *)fp = ((sp2[3] << 24) | (sp2[2] << 16)
| (sp2[1] << 8) | sp2[0]);
}
@@ -492,11 +495,79 @@
}
/* zero out other outputs */
for (i = sfchannels; i < nvecs; i++)
- for (j = nitems, fp = vecs[i*ASTRIDE]; j--; )
- *fp = 0,fp += ASTRIDE;
+ for (j = nitems, fp = vecs[i]; j--; )
+ *fp++ = 0;
}
+static void soundfile_xferin_float(int sfchannels, int nvecs, t_float **vecs,
+ long itemsread, unsigned char *buf, int nitems, int bytespersamp,
+ int bigendian, int spread)
+{
+ int i, j;
+ unsigned char *sp, *sp2;
+ t_float *fp;
+ int nchannels = (sfchannels < nvecs ? sfchannels : nvecs);
+ int bytesperframe = bytespersamp * sfchannels;
+ for (i = 0, sp = buf; i < nchannels; i++, sp += bytespersamp)
+ {
+ if (bytespersamp == 2)
+ {
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16));
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *fp = SCALE * ((sp2[1] << 24) | (sp2[0] << 16));
+ }
+ }
+ else if (bytespersamp == 3)
+ {
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *fp = SCALE * ((sp2[0] << 24) | (sp2[1] << 16)
+ | (sp2[2] << 8));
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *fp = SCALE * ((sp2[2] << 24) | (sp2[1] << 16)
+ | (sp2[0] << 8));
+ }
+ }
+ else if (bytespersamp == 4)
+ {
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *(long *)fp = ((sp2[0] << 24) | (sp2[1] << 16)
+ | (sp2[2] << 8) | sp2[3]);
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + spread * itemsread;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ *(long *)fp = ((sp2[3] << 24) | (sp2[2] << 16)
+ | (sp2[1] << 8) | sp2[0]);
+ }
+ }
+ }
+ /* zero out other outputs */
+ for (i = sfchannels; i < nvecs; i++)
+ for (j = nitems, fp = vecs[i]; j--; )
+ *fp++ = 0;
+
+}
+
/* soundfiler_write ...
usage: write [flags] filename table ...
@@ -522,7 +593,7 @@
static int soundfiler_writeargparse(void *obj, int *p_argc, t_atom **p_argv,
t_symbol **p_filesym,
int *p_filetype, int *p_bytespersamp, int *p_swap, int *p_bigendian,
- int *p_normalize, long *p_onset, long *p_nframes, float *p_rate)
+ int *p_normalize, long *p_onset, long *p_nframes, t_float *p_rate)
{
int argc = *p_argc;
t_atom *argv = *p_argv;
@@ -530,7 +601,7 @@
endianness = -1, swap, filetype = -1, normalize = 0;
long onset = 0, nframes = 0x7fffffff;
t_symbol *filesym;
- float rate = -1;
+ t_float rate = -1;
while (argc > 0 && argv->a_type == A_SYMBOL &&
*argv->a_w.w_symbol->s_name == '-')
@@ -672,7 +743,7 @@
static int create_soundfile(t_canvas *canvas, const char *filename,
int filetype, int nframes, int bytespersamp,
- int bigendian, int nchannels, int swap, float samplerate)
+ int bigendian, int nchannels, int swap, t_float samplerate)
{
char filenamebuf[FILENAME_MAX], buf2[FILENAME_MAX];
char headerbuf[WRITEHDRSIZE];
@@ -831,24 +902,24 @@
post("%s: %s", filename, strerror(errno));
}
-static void soundfile_xferout(int nchannels, float **vecs,
+static void soundfile_xferout_sample(int nchannels, t_sample **vecs,
unsigned char *buf, int nitems, long onset, int bytespersamp,
- int bigendian, float normalfactor)
+ int bigendian, t_sample normalfactor, int spread)
{
int i, j;
unsigned char *sp, *sp2;
- float *fp;
+ t_sample *fp;
int bytesperframe = bytespersamp * nchannels;
long xx;
for (i = 0, sp = buf; i < nchannels; i++, sp += bytespersamp)
{
if (bytespersamp == 2)
{
- float ff = normalfactor * 32768.;
+ t_sample ff = normalfactor * 32768.;
if (bigendian)
{
- for (j = 0, sp2 = sp, fp = vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp = vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 32768. + (*fp * ff);
xx -= 32768;
@@ -862,8 +933,8 @@
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 32768. + (*fp * ff);
xx -= 32768;
@@ -878,11 +949,11 @@
}
else if (bytespersamp == 3)
{
- float ff = normalfactor * 8388608.;
+ t_sample ff = normalfactor * 8388608.;
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 8388608. + (*fp * ff);
xx -= 8388608;
@@ -897,8 +968,8 @@
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
int xx = 8388608. + (*fp * ff);
xx -= 8388608;
@@ -916,10 +987,10 @@
{
if (bigendian)
{
- for (j = 0, sp2 = sp, fp=vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
- float f2 = *fp * normalfactor;
+ t_sample f2 = *fp * normalfactor;
xx = *(long *)&f2;
sp2[0] = (xx >> 24); sp2[1] = (xx >> 16);
sp2[2] = (xx >> 8); sp2[3] = xx;
@@ -927,10 +998,10 @@
}
else
{
- for (j = 0, sp2 = sp, fp=vecs[i] + onset*ASTRIDE;
- j < nitems; j++, sp2 += bytesperframe, fp+=ASTRIDE)
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
{
- float f2 = *fp * normalfactor;
+ t_sample f2 = *fp * normalfactor;
xx = *(long *)&f2;
sp2[3] = (xx >> 24); sp2[2] = (xx >> 16);
sp2[1] = (xx >> 8); sp2[0] = xx;
@@ -939,8 +1010,115 @@
}
}
}
+static void soundfile_xferout_float(int nchannels, t_float **vecs,
+ unsigned char *buf, int nitems, long onset, int bytespersamp,
+ int bigendian, t_sample normalfactor, int spread)
+{
+ int i, j;
+ unsigned char *sp, *sp2;
+ t_float *fp;
+ int bytesperframe = bytespersamp * nchannels;
+ long xx;
+ for (i = 0, sp = buf; i < nchannels; i++, sp += bytespersamp)
+ {
+ if (bytespersamp == 2)
+ {
+ t_sample ff = normalfactor * 32768.;
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp = vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ int xx = 32768. + (*fp * ff);
+ xx -= 32768;
+ if (xx < -32767)
+ xx = -32767;
+ if (xx > 32767)
+ xx = 32767;
+ sp2[0] = (xx >> 8);
+ sp2[1] = xx;
+ }
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ int xx = 32768. + (*fp * ff);
+ xx -= 32768;
+ if (xx < -32767)
+ xx = -32767;
+ if (xx > 32767)
+ xx = 32767;
+ sp2[1] = (xx >> 8);
+ sp2[0] = xx;
+ }
+ }
+ }
+ else if (bytespersamp == 3)
+ {
+ t_sample ff = normalfactor * 8388608.;
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ int xx = 8388608. + (*fp * ff);
+ xx -= 8388608;
+ if (xx < -8388607)
+ xx = -8388607;
+ if (xx > 8388607)
+ xx = 8388607;
+ sp2[0] = (xx >> 16);
+ sp2[1] = (xx >> 8);
+ sp2[2] = xx;
+ }
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ int xx = 8388608. + (*fp * ff);
+ xx -= 8388608;
+ if (xx < -8388607)
+ xx = -8388607;
+ if (xx > 8388607)
+ xx = 8388607;
+ sp2[2] = (xx >> 16);
+ sp2[1] = (xx >> 8);
+ sp2[0] = xx;
+ }
+ }
+ }
+ else if (bytespersamp == 4)
+ {
+ if (bigendian)
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ t_sample f2 = *fp * normalfactor;
+ xx = *(long *)&f2;
+ sp2[0] = (xx >> 24); sp2[1] = (xx >> 16);
+ sp2[2] = (xx >> 8); sp2[3] = xx;
+ }
+ }
+ else
+ {
+ for (j = 0, sp2 = sp, fp=vecs[i] + onset;
+ j < nitems; j++, sp2 += bytesperframe, fp += spread)
+ {
+ t_sample f2 = *fp * normalfactor;
+ xx = *(long *)&f2;
+ sp2[3] = (xx >> 24); sp2[2] = (xx >> 16);
+ sp2[1] = (xx >> 8); sp2[0] = xx;
+ }
+ }
+ }
+ }
+}
-
/* ------- soundfiler - reads and writes soundfiles to/from "garrays" ---- */
#define DEFMAXSIZE 4000000 /* default maximum 16 MB per channel */
#define SAMPBUFSIZE 1024
@@ -967,7 +1145,6 @@
usage: read [flags] filename table ...
flags:
-skip <frames> ... frames to skip in file
- -nframes <frames>
-onset <frames> ... onset in table to read into (NOT DONE YET)
-raw <headersize channels bytes endian>
-resize
@@ -979,12 +1156,12 @@
{
int headersize = -1, channels = 0, bytespersamp = 0, bigendian = 0,
resize = 0, i, j;
- long skipframes = 0, nframes = 0, finalsize = 0, itemsleft,
+ long skipframes = 0, finalsize = 0, itemsleft,
maxsize = DEFMAXSIZE, itemsread = 0, bytelimit = 0x7fffffff;
int fd = -1;
char endianness, *filename;
t_garray *garrays[MAXSFCHANS];
- t_float *vecs[MAXSFCHANS];
+ t_word *vecs[MAXSFCHANS];
char sampbuf[SAMPBUFSIZE];
int bufframes, nitems;
FILE *fp;
@@ -999,13 +1176,6 @@
goto usage;
argc -= 2; argv += 2;
}
- else if (!strcmp(flag, "nframes"))
- {
- if (argc < 2 || argv[1].a_type != A_FLOAT ||
- ((nframes = argv[1].a_w.w_float) < 0))
- goto usage;
- argc -= 2; argv += 2;
- }
else if (!strcmp(flag, "raw"))
{
if (argc < 5 ||
@@ -1060,7 +1230,8 @@
pd_error(x, "%s: no such table", argv[i].a_w.w_symbol->s_name);
goto done;
}
- else if (!garray_getfloatarray(garrays[i], &vecsize, &vecs[i]))
+ else if (!garray_getfloatwords(garrays[i], &vecsize,
+ &vecs[i]))
error("%s: bad template for tabwrite",
argv[i].a_w.w_symbol->s_name);
if (finalsize && finalsize != vecsize && !resize)
@@ -1110,7 +1281,8 @@
garray_resize(garrays[i], finalsize);
/* for sanity's sake let's clear the save-in-patch flag here */
garray_setsaveit(garrays[i], 0);
- garray_getfloatarray(garrays[i], &vecsize, &vecs[i]);
+ garray_getfloatwords(garrays[i], &vecsize,
+ &vecs[i]);
/* if the resize failed, garray_resize reported the error */
if (vecsize != framesinfile)
{
@@ -1131,8 +1303,9 @@
thisread = (thisread > bufframes ? bufframes : thisread);
nitems = fread(sampbuf, channels * bytespersamp, thisread, fp);
if (nitems <= 0) break;
- soundfile_xferin(channels, argc, vecs, itemsread,
- (unsigned char *)sampbuf, nitems, bytespersamp, bigendian);
+ soundfile_xferin_float(channels, argc, (t_float **)vecs, itemsread,
+ (unsigned char *)sampbuf, nitems, bytespersamp, bigendian,
+ sizeof(t_word)/sizeof(t_sample));
itemsread += nitems;
}
/* zero out remaining elements of vectors */
@@ -1140,18 +1313,18 @@
for (i = 0; i < argc; i++)
{
int nzero, vecsize;
- garray_getfloatarray(garrays[i], &vecsize, &vecs[i]);
+ garray_getfloatwords(garrays[i], &vecsize, &vecs[i]);
for (j = itemsread; j < vecsize; j++)
- vecs[i][j] = 0;
+ vecs[i][j].w_float = 0;
}
/* zero out vectors in excess of number of channels */
for (i = channels; i < argc; i++)
{
int vecsize;
- float *foo;
- garray_getfloatarray(garrays[i], &vecsize, &foo);
+ t_word *foo;
+ garray_getfloatwords(garrays[i], &vecsize, &foo);
for (j = 0; j < vecsize; j++)
- foo[j] = 0;
+ foo[j].w_float = 0;
}
/* do all graphics updates */
for (i = 0; i < argc; i++)
@@ -1166,7 +1339,7 @@
done:
if (fd >= 0)
close (fd);
- outlet_float(x->x_obj.ob_outlet, (float)itemsread);
+ outlet_float(x->x_obj.ob_outlet, (t_float)itemsread);
}
/* this is broken out from soundfiler_write below so garray_write can
@@ -1180,11 +1353,12 @@
long onset, nframes, itemsleft,
maxsize = DEFMAXSIZE, itemswritten = 0;
t_garray *garrays[MAXSFCHANS];
- t_float *vecs[MAXSFCHANS];
+ t_word *vecs[MAXSFCHANS];
char sampbuf[SAMPBUFSIZE];
int bufframes, nitems;
int fd = -1;
- float normfactor, biggest = 0, samplerate;
+ t_sample normfactor, biggest = 0;
+ t_float samplerate;
t_symbol *filesym;
if (soundfiler_writeargparse(obj, &argc, &argv, &filesym, &filetype,
@@ -1207,7 +1381,7 @@
pd_error(obj, "%s: no such table", argv[i].a_w.w_symbol->s_name);
goto fail;
}
- else if (!garray_getfloatarray(garrays[i], &vecsize, &vecs[i]))
+ else if (!garray_getfloatwords(garrays[i], &vecsize, &vecs[i]))
error("%s: bad template for tabwrite",
argv[i].a_w.w_symbol->s_name);
if (nframes > vecsize - onset)
@@ -1215,10 +1389,10 @@
for (j = 0; j < vecsize; j++)
{
- if (vecs[i][j] > biggest)
- biggest = vecs[i][j];
- else if (-vecs[i][j] > biggest)
- biggest = -vecs[i][j];
+ if (vecs[i][j].w_float > biggest)
+ biggest = vecs[i][j].w_float;
+ else if (-vecs[i][j].w_float > biggest)
+ biggest = -vecs[i][j].w_float;
}
}
if (nframes <= 0)
@@ -1253,8 +1427,9 @@
{
int thiswrite = nframes - itemswritten, nitems, nbytes;
thiswrite = (thiswrite > bufframes ? bufframes : thiswrite);
- soundfile_xferout(argc, vecs, (unsigned char *)sampbuf, thiswrite,
- onset, bytespersamp, bigendian, normfactor);
+ soundfile_xferout_float(argc, (t_float **)vecs, (unsigned char *)sampbuf,
+ thiswrite, onset, bytespersamp, bigendian, normfactor,
+ sizeof(t_word)/sizeof(t_sample));
nbytes = write(fd, sampbuf, nchannels * bytespersamp * thiswrite);
if (nbytes < nchannels * bytespersamp * thiswrite)
{
@@ -1264,7 +1439,7 @@
break;
}
itemswritten += thiswrite;
- onset += thiswrite;
+ onset += thiswrite * (sizeof(t_word)/sizeof(float));
}
if (fd >= 0)
{
@@ -1289,7 +1464,7 @@
{
long bozo = soundfiler_dowrite(x, x->x_canvas,
argc, argv);
- outlet_float(x->x_obj.ob_outlet, (float)bozo);
+ outlet_float(x->x_obj.ob_outlet, (t_float)bozo);
}
static void soundfiler_setup(void)
@@ -1351,7 +1526,7 @@
int x_vecsize; /* vector size for transfers */
t_outlet *x_bangout; /* bang-on-done outlet */
int x_state; /* opened, running, or idle */
- float x_insamplerate; /* sample rate of input signal if known */
+ t_float x_insamplerate; /* sample rate of input signal if known */
/* parameters to communicate with subthread */
int x_requestcode; /* pending request from parent to I/O thread */
char *x_filename; /* file to open (string is permanently allocated) */
@@ -1360,7 +1535,7 @@
int x_bytespersample; /* bytes per sample (2 or 3) */
int x_bigendian; /* true if file is big-endian */
int x_sfchannels; /* number of channels in soundfile */
- float x_samplerate; /* sample rate of soundfile */
+ t_float x_samplerate; /* sample rate of soundfile */
long x_onsetframes; /* number of sample frames to skip */
long x_bytelimit; /* max number of data bytes to read */
int x_fd; /* filedesc */
@@ -1373,7 +1548,7 @@
int x_filetype; /* writesf~ only; type of file to create */
int x_itemswritten; /* writesf~ only; items writen */
int x_swap; /* writesf~ only; true if byte swapping */
- float x_f; /* writesf~ only; scalar for signal inlet */
+ t_float x_f; /* writesf~ only; scalar for signal inlet */
pthread_mutex_t x_mutex;
pthread_cond_t x_requestcondition;
pthread_cond_t x_answercondition;
@@ -1752,7 +1927,7 @@
int vecsize = x->x_vecsize, noutlets = x->x_noutlets, i, j,
bytespersample = x->x_bytespersample,
bigendian = x->x_bigendian;
- float *fp;
+ t_sample *fp;
if (x->x_state == STATE_STREAM)
{
int wantbytes, nchannels, sfchannels = x->x_sfchannels;
@@ -1796,9 +1971,9 @@
(sfchannels * bytespersample);
if (xfersize)
{
- soundfile_xferin(sfchannels, noutlets, x->x_outvec, 0,
+ soundfile_xferin_sample(sfchannels, noutlets, x->x_outvec, 0,
(unsigned char *)(x->x_buf + x->x_fifotail), xfersize,
- bytespersample, bigendian);
+ bytespersample, bigendian, 1);
vecsize -= xfersize;
}
/* then zero out the (rest of the) output */
@@ -1811,9 +1986,9 @@
return (w+2);
}
- soundfile_xferin(sfchannels, noutlets, x->x_outvec, 0,
+ soundfile_xferin_sample(sfchannels, noutlets, x->x_outvec, 0,
(unsigned char *)(x->x_buf + x->x_fifotail), vecsize,
- bytespersample, bigendian);
+ bytespersample, bigendian, 1);
x->x_fifotail += wantbytes;
if (x->x_fifotail >= x->x_fifosize)
@@ -2007,7 +2182,7 @@
int filetype = x->x_filetype;
char *filename = x->x_filename;
t_canvas *canvas = x->x_canvas;
- float samplerate = x->x_samplerate;
+ t_float samplerate = x->x_samplerate;
/* alter the request code so that an ensuing "open" will get
noticed. */
@@ -2252,7 +2427,7 @@
int vecsize = x->x_vecsize, sfchannels = x->x_sfchannels, i, j,
bytespersample = x->x_bytespersample,
bigendian = x->x_bigendian;
- float *fp;
+ t_sample *fp;
if (x->x_state == STATE_STREAM)
{
int wantbytes;
@@ -2271,9 +2446,9 @@
#endif
}
- soundfile_xferout(sfchannels, x->x_outvec,
+ soundfile_xferout_sample(sfchannels, x->x_outvec,
(unsigned char *)(x->x_buf + x->x_fifohead), vecsize, 0,
- bytespersample, bigendian, 1.);
+ bytespersample, bigendian, 1., 1);
x->x_fifohead += wantbytes;
if (x->x_fifohead >= x->x_fifosize)
@@ -2324,7 +2499,7 @@
t_symbol *filesym;
int filetype, bytespersamp, swap, bigendian, normalize;
long onset, nframes;
- float samplerate;
+ t_float samplerate;
if (x->x_state != STATE_IDLE)
{
writesf_stop(x);
Property changes on: branches/pd-extended/0.41/pd/src/d_soundfile.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/d_soundfile.c:9670-10498
/tags/pd/pd-0.41-4/src/d_soundfile.c:9603-9669
/trunk/pd/src/d_soundfile.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_canvas.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_canvas.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_canvas.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -448,8 +448,8 @@
/* make a new glist and add it to this glist. It will appear as
a "graph", not a text object. */
t_glist *glist_addglist(t_glist *g, t_symbol *sym,
- float x1, float y1, float x2, float y2,
- float px1, float py1, float px2, float py2)
+ t_float x1, t_float y1, t_float x2, t_float y2,
+ t_float px1, t_float py1, t_float px2, t_float py2)
{
static int gcount = 0;
int zz;
@@ -474,7 +474,7 @@
that is higher on the screen. */
if (py2 < py1)
{
- float zz;
+ t_float zz;
zz = y2;
y2 = y1;
y1 = zz;
@@ -520,14 +520,14 @@
void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv)
{
t_symbol *sym = atom_getsymbolarg(0, argc, argv);
- float x1 = atom_getfloatarg(1, argc, argv);
- float y1 = atom_getfloatarg(2, argc, argv);
- float x2 = atom_getfloatarg(3, argc, argv);
- float y2 = atom_getfloatarg(4, argc, argv);
- float px1 = atom_getfloatarg(5, argc, argv);
- float py1 = atom_getfloatarg(6, argc, argv);
- float px2 = atom_getfloatarg(7, argc, argv);
- float py2 = atom_getfloatarg(8, argc, argv);
+ t_float x1 = atom_getfloatarg(1, argc, argv);
+ t_float y1 = atom_getfloatarg(2, argc, argv);
+ t_float x2 = atom_getfloatarg(3, argc, argv);
+ t_float y2 = atom_getfloatarg(4, argc, argv);
+ t_float px1 = atom_getfloatarg(5, argc, argv);
+ t_float py1 = atom_getfloatarg(6, argc, argv);
+ t_float px2 = atom_getfloatarg(7, argc, argv);
+ t_float py2 = atom_getfloatarg(8, argc, argv);
glist_addglist(g, sym, x1, y1, x2, y2, px1, py1, px2, py2);
}
@@ -557,7 +557,7 @@
fix so that zero is bottom edge and redraw. This is
only appropriate if we're a regular "text" object on the
parent. */
- float diff = x->gl_y1 - x->gl_y2;
+ t_float diff = x->gl_y1 - x->gl_y2;
t_gobj *y;
x->gl_y1 = heightwas * diff;
x->gl_y2 = x->gl_y1 - diff;
@@ -744,7 +744,7 @@
}
for (y = x->gl_list; y; y = y->g_next)
if (pd_class(&y->g_pd) == canvas_class &&
- ((t_canvas *)y)->gl_isgraph)
+ ((t_canvas *)y)->gl_isgraph && !((t_canvas *)y)->gl_havewindow)
canvas_create_editor((t_canvas *)y, createit);
}
@@ -814,7 +814,8 @@
if (glist_isgraph(x) && x->gl_owner)
{
t_glist *gl2 = x->gl_owner;
- canvas_create_editor(x, 1);
+ if (!x->gl_owner->gl_isdeleting)
+ canvas_create_editor(x, 1);
if (glist_isvisible(gl2))
gobj_vis(&x->gl_gobj, gl2, 0);
x->gl_havewindow = 0;
@@ -1499,9 +1500,6 @@
void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b)
{
- int i, argc;
- t_atom *argv;
- char savename[FILENAME_MAX];
t_gobj *y;
for (y = x->gl_list; y; y = y->g_next)
@@ -1514,6 +1512,8 @@
}
else if (pd_class(&y->g_pd) == import_class)
{
+ int i, argc;
+ t_atom *argv;
binbuf_addv(b, "s", gensym("#X"));
binbuf_addv(b, "s", gensym("declare"));
argc = binbuf_getnatom(((t_object *)y)->te_binbuf) - 1;
@@ -1537,7 +1537,7 @@
to[0] = '\0';
}
else
- { // if not absolute path, append Pd lib dir
+ { /* if not absolute path, append Pd lib dir */
strncpy(to, sys_libdir->s_name, FILENAME_MAX-4);
to[FILENAME_MAX-3] = '\0';
strcat(to, "/");
@@ -1629,7 +1629,7 @@
realname[0] = '\0';
}
else
- { // if not absolute path, append parent canvas' current dir
+ { /* if not absolute path, append Pd lib dir */
strncpy(realname, dir, FILENAME_MAX);
realname[FILENAME_MAX-3] = 0;
strcat(realname, "/");
Modified: branches/pd-extended/0.41/pd/src/g_graph.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_graph.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_graph.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -189,11 +189,11 @@
return((t_canvas *)x);
}
-static float gobj_getxforsort(t_gobj *g)
+static t_float gobj_getxforsort(t_gobj *g)
{
if (pd_class(&g->g_pd) == scalar_class)
{
- float x1, y1;
+ t_float x1, y1;
scalar_getbasexy((t_scalar *)g, &x1, &y1);
return(x1);
}
@@ -203,7 +203,7 @@
static t_gobj *glist_merge(t_glist *x, t_gobj *g1, t_gobj *g2)
{
t_gobj *g = 0, *g9 = 0;
- float f1 = 0, f2 = 0;
+ t_float f1 = 0, f2 = 0;
if (g1)
f1 = gobj_getxforsort(g1);
if (g2)
@@ -265,11 +265,11 @@
void glist_sort(t_glist *x)
{
int nitems = 0, foo = 0;
- float lastx = -1e37;
+ t_float lastx = -1e37;
t_gobj *g;
for (g = x->gl_list; g; g = g->g_next)
{
- float x1 = gobj_getxforsort(g);
+ t_float x1 = gobj_getxforsort(g);
if (x1 < lastx)
foo = 1;
lastx = x1;
@@ -513,7 +513,7 @@
/****** routines to convert pixels to X or Y value and vice versa ******/
/* convert an x pixel value to an x coordinate value */
-float glist_pixelstox(t_glist *x, float xpix)
+t_float glist_pixelstox(t_glist *x, t_float xpix)
{
/* if we appear as a text box on parent, our range in our
coordinates (x1, etc.) specifies the coordinate range
@@ -541,7 +541,7 @@
}
}
-float glist_pixelstoy(t_glist *x, float ypix)
+t_float glist_pixelstoy(t_glist *x, t_float ypix)
{
if (!x->gl_isgraph)
return (x->gl_y1 + (x->gl_y2 - x->gl_y1) * ypix);
@@ -560,7 +560,7 @@
}
/* convert an x coordinate value to an x pixel location in window */
-float glist_xtopixels(t_glist *x, float xval)
+t_float glist_xtopixels(t_glist *x, t_float xval)
{
if (!x->gl_isgraph)
return ((xval - x->gl_x1) / (x->gl_x2 - x->gl_x1));
@@ -577,7 +577,7 @@
}
}
-float glist_ytopixels(t_glist *x, float yval)
+t_float glist_ytopixels(t_glist *x, t_float yval)
{
if (!x->gl_isgraph)
return ((yval - x->gl_y1) / (x->gl_y2 - x->gl_y1));
@@ -597,12 +597,12 @@
/* convert an X screen distance to an X coordinate increment.
This is terribly inefficient;
but probably not a big enough CPU hog to warrant optimizing. */
-float glist_dpixtodx(t_glist *x, float dxpix)
+t_float glist_dpixtodx(t_glist *x, t_float dxpix)
{
return (dxpix * (glist_pixelstox(x, 1) - glist_pixelstox(x, 0)));
}
-float glist_dpixtody(t_glist *x, float dypix)
+t_float glist_dpixtody(t_glist *x, t_float dypix)
{
return (dypix * (glist_pixelstoy(x, 1) - glist_pixelstoy(x, 0)));
}
@@ -731,7 +731,7 @@
if (vis)
{
int i;
- float f;
+ t_float f;
t_gobj *g;
t_symbol *arrayname;
t_garray *ga;
@@ -758,7 +758,7 @@
zero, this is disabled. */
if (x->gl_xtick.k_lperb)
{
- float upix, lpix;
+ t_float upix, lpix;
if (y2 < y1)
upix = y1, lpix = y2;
else upix = y2, lpix = y1;
@@ -795,7 +795,7 @@
/* draw ticks in vertical borders*/
if (x->gl_ytick.k_lperb)
{
- float ubound, lbound;
+ t_float ubound, lbound;
if (x->gl_y2 < x->gl_y1)
ubound = x->gl_y1, lbound = x->gl_y2;
else ubound = x->gl_y2, lbound = x->gl_y1;
@@ -836,7 +836,7 @@
(int)glist_xtopixels(x, atof(x->gl_xlabel[i]->s_name)),
(int)glist_ytopixels(x, x->gl_xlabely),
x->gl_xlabel[i]->s_name, sys_font,
- glist_getfont(x), sys_fontweight, tag);
+ glist_getfont(x), sys_fontweight, tag);
/* draw y labels */
for (i = 0; i < x->gl_nylabels; i++)
@@ -1000,25 +1000,25 @@
glist_delete(x, y);
}
-static float graph_lastxpix, graph_lastypix;
+static t_float graph_lastxpix, graph_lastypix;
static void graph_motion(void *z, t_floatarg dx, t_floatarg dy)
{
t_glist *x = (t_glist *)z;
- float newxpix = graph_lastxpix + dx, newypix = graph_lastypix + dy;
+ t_float newxpix = graph_lastxpix + dx, newypix = graph_lastypix + dy;
t_garray *a = (t_garray *)(x->gl_list);
int oldx = 0.5 + glist_pixelstox(x, graph_lastxpix);
int newx = 0.5 + glist_pixelstox(x, newxpix);
- t_float *vec;
+ t_word *vec;
int nelem, i;
- float oldy = glist_pixelstoy(x, graph_lastypix);
- float newy = glist_pixelstoy(x, newypix);
+ t_float oldy = glist_pixelstoy(x, graph_lastypix);
+ t_float newy = glist_pixelstoy(x, newypix);
graph_lastxpix = newxpix;
graph_lastypix = newypix;
/* verify that the array is OK */
if (!a || pd_class((t_pd *)a) != garray_class)
return;
- if (!garray_getfloatarray(a, &nelem, &vec))
+ if (!garray_getfloatwords(a, &nelem, &vec))
return;
if (oldx < 0) oldx = 0;
if (oldx >= nelem)
@@ -1029,16 +1029,16 @@
if (oldx < newx - 1)
{
for (i = oldx + 1; i <= newx; i++)
- vec[i*sizeof(union word)/sizeof(t_sample)] = newy + (oldy - newy) *
- ((float)(newx - i))/(float)(newx - oldx);
+ vec[i].w_float = newy + (oldy - newy) *
+ ((t_float)(newx - i))/(t_float)(newx - oldx);
}
else if (oldx > newx + 1)
{
for (i = oldx - 1; i >= newx; i--)
- vec[i*sizeof(union word)/sizeof(t_sample)] = newy + (oldy - newy) *
- ((float)(newx - i))/(float)(newx - oldx);
+ vec[i].w_float = newy + (oldy - newy) *
+ ((t_float)(newx - i))/(t_float)(newx - oldx);
}
- else vec[newx*sizeof(union word)/sizeof(t_sample)] = newy;
+ else vec[newx].w_float = newy;
garray_redraw(a);
}
Property changes on: branches/pd-extended/0.41/pd/src/g_graph.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_graph.c:9670-10503
/tags/pd/pd-0.41-4/src/g_graph.c:9603-9669
/trunk/pd/src/g_graph.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_hdial.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_hdial.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_hdial.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -351,14 +351,14 @@
{
if((x->x_change)&&(x->x_on != x->x_on_old))
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
x->x_on_old = x->x_on;
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -385,7 +385,7 @@
{
if((x->x_change)&&(i != x->x_on_old))
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -396,7 +396,7 @@
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
x->x_on_old = x->x_on;
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -429,7 +429,7 @@
{
if(x->x_gui.x_fsf.x_put_in2out)
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -443,7 +443,7 @@
x->x_on_old = x->x_on;
if(x->x_gui.x_fsf.x_put_in2out)
{
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -468,7 +468,7 @@
{
int xx = (int)xpos - (int)text_xpix(&x->x_gui.x_obj, x->x_gui.x_glist);
- hradio_fout(x, (float)(xx / x->x_gui.x_w));
+ hradio_fout(x, (t_float)(xx / x->x_gui.x_w));
}
static int hradio_newclick(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit)
Modified: branches/pd-extended/0.41/pd/src/g_hslider.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_hslider.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_hslider.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -226,7 +226,7 @@
binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("hsl"), x->x_gui.x_w, x->x_gui.x_h,
- (float)x->x_min, (float)x->x_max,
+ (t_float)x->x_min, (t_float)x->x_max,
x->x_lin0_log1, iem_symargstoint(&x->x_gui.x_isa),
srl[0], srl[1], srl[2],
x->x_gui.x_ldx, x->x_gui.x_ldy,
Modified: branches/pd-extended/0.41/pd/src/g_numbox.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_numbox.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_numbox.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -203,7 +203,7 @@
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
- x->x_gui.x_lcol, x);
+ x->x_gui.x_lcol, x);
my_numbox_ftoa(x);
sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \
-font {{%s} %d %s} -fill #%6.6x -tags %lxNUMBER\n",
@@ -395,7 +395,7 @@
binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("nbx"), x->x_gui.x_w, x->x_gui.x_h,
- (float)x->x_min, (float)x->x_max,
+ (t_float)x->x_min, (t_float)x->x_max,
x->x_lin0_log1, iem_symargstoint(&x->x_gui.x_isa),
srl[0], srl[1], srl[2],
x->x_gui.x_ldx, x->x_gui.x_ldy,
Property changes on: branches/pd-extended/0.41/pd/src/g_numbox.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_numbox.c:9670-10504
/tags/pd/pd-0.41-4/src/g_numbox.c:9603-9669
/trunk/pd/src/g_numbox.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_rtext.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_rtext.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_rtext.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -156,7 +156,7 @@
static void rtext_senditup(t_rtext *x, int action, int *widthp, int *heightp,
int *indexp)
{
- float dispx, dispy;
+ t_float dispx, dispy;
char smallbuf[200], *tempbuf;
int outchars = 0, nlines = 0, ncolumns = 0,
pixwide, pixhigh, font, fontwidth, fontheight, findx, findy;
@@ -445,9 +445,10 @@
x->x_buf = resizebytes(x->x_buf, x->x_bufsize, newsize);
x->x_bufsize = newsize;
-/* at guenter's suggestion, this gets european characters working */
-/* if (n == '\n' || isprint(n)) */
- if ((n == '\n' || n > 31) && n != 127)
+/* at Guenter's suggestion, use 'n>31' to test wither a character might
+be printable in whatever 8-bit character set we find ourselves. */
+
+ if (n == '\n' || (n > 31 && n != 127))
{
newsize = x->x_bufsize+1;
x->x_buf = resizebytes(x->x_buf, x->x_bufsize, newsize);
Modified: branches/pd-extended/0.41/pd/src/g_template.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_template.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_template.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -147,7 +147,7 @@
{
int onset, type;
t_symbol *arraytype;
- float val = 0;
+ t_float val = 0;
if (template_find_field(x, fieldname, &onset, &type, &arraytype))
{
if (type == DT_FLOAT)
@@ -721,14 +721,14 @@
t_symbol *fd_symbol; /* the field is a constant symbol */
t_symbol *fd_varsym; /* the field is variable and this is the name */
} fd_un;
- float fd_v1; /* min and max values */
- float fd_v2;
- float fd_screen1; /* min and max screen values */
- float fd_screen2;
- float fd_quantum; /* quantization in value */
+ t_float fd_v1; /* min and max values */
+ t_float fd_v2;
+ t_float fd_screen1; /* min and max screen values */
+ t_float fd_screen2;
+ t_float fd_quantum; /* quantization in value */
};
-static void fielddesc_setfloat_const(t_fielddesc *fd, float f)
+static void fielddesc_setfloat_const(t_fielddesc *fd, t_float f)
{
fd->fd_type = A_FLOAT;
fd->fd_var = 0;
@@ -851,9 +851,9 @@
}
/* convert a variable's value to a screen coordinate via its fielddesc */
-t_float fielddesc_cvttocoord(t_fielddesc *f, float val)
+t_float fielddesc_cvttocoord(t_fielddesc *f, t_float val)
{
- float coord, pix, extreme, div;
+ t_float coord, pix, extreme, div;
if (f->fd_v2 == f->fd_v1)
return (val);
div = (f->fd_screen2 - f->fd_screen1)/(f->fd_v2 - f->fd_v1);
@@ -877,7 +877,7 @@
{
if (f->fd_var)
{
- float val = template_getfloat(template,
+ t_float val = template_getfloat(template,
f->fd_un.fd_varsym, wp, loud);
return (fielddesc_cvttocoord(f, val));
}
@@ -909,15 +909,15 @@
}
/* convert from a screen coordinate to a variable value */
-float fielddesc_cvtfromcoord(t_fielddesc *f, float coord)
+t_float fielddesc_cvtfromcoord(t_fielddesc *f, t_float coord)
{
- float val;
+ t_float val;
if (f->fd_screen2 == f->fd_screen1)
val = coord;
else
{
- float div = (f->fd_v2 - f->fd_v1)/(f->fd_screen2 - f->fd_screen1);
- float extreme;
+ t_float div = (f->fd_v2 - f->fd_v1)/(f->fd_screen2 - f->fd_screen1);
+ t_float extreme;
val = f->fd_v1 + (coord - f->fd_screen1) * div;
if (f->fd_quantum != 0)
val = ((int)((val/f->fd_quantum) + 0.5)) * f->fd_quantum;
@@ -932,11 +932,11 @@
}
void fielddesc_setcoord(t_fielddesc *f, t_template *template,
- t_word *wp, float coord, int loud)
+ t_word *wp, t_float coord, int loud)
{
if (f->fd_type == A_FLOAT && f->fd_var)
{
- float val = fielddesc_cvtfromcoord(f, coord);
+ t_float val = fielddesc_cvtfromcoord(f, coord);
template_setfloat(template,
f->fd_un.fd_varsym, wp, val, loud);
}
@@ -1040,7 +1040,7 @@
/* -------------------- widget behavior for curve ------------ */
static void curve_getrect(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int *xp1, int *yp1, int *xp2, int *yp2)
{
t_curve *x = (t_curve *)z;
@@ -1072,21 +1072,21 @@
}
static void curve_displace(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int dx, int dy)
{
/* refuse */
}
static void curve_select(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
/* fill in later */
}
static void curve_activate(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
/* fill in later */
@@ -1122,21 +1122,22 @@
}
static void curve_vis(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int vis)
{
t_curve *x = (t_curve *)z;
int i, n = x->x_npoints;
t_fielddesc *f = x->x_vec;
- if (!fielddesc_getfloat(&x->x_vis, template, data, 0))
+ /* see comment in plot_vis() */
+ if (vis && !fielddesc_getfloat(&x->x_vis, template, data, 0))
return;
if (vis)
{
if (n > 1)
{
int flags = x->x_flags, closed = (flags & CLOSED);
- float width = fielddesc_getfloat(&x->x_width, template, data, 1);
+ t_float width = fielddesc_getfloat(&x->x_width, template, data, 1);
char outline[20], fill[20];
int pix[200];
if (n > 100)
@@ -1184,12 +1185,12 @@
}
static int curve_motion_field;
-static float curve_motion_xcumulative;
-static float curve_motion_xbase;
-static float curve_motion_xper;
-static float curve_motion_ycumulative;
-static float curve_motion_ybase;
-static float curve_motion_yper;
+static t_float curve_motion_xcumulative;
+static t_float curve_motion_xbase;
+static t_float curve_motion_xper;
+static t_float curve_motion_ycumulative;
+static t_float curve_motion_ybase;
+static t_float curve_motion_yper;
static t_glist *curve_motion_glist;
static t_scalar *curve_motion_scalar;
static t_array *curve_motion_array;
@@ -1236,7 +1237,7 @@
static int curve_click(t_gobj *z, t_glist *glist,
t_word *data, t_template *template, t_scalar *sc, t_array *ap,
- float basex, float basey,
+ t_float basex, t_float basey,
int xpix, int ypix, int shift, int alt, int dbl, int doit)
{
t_curve *x = (t_curve *)z;
@@ -1269,7 +1270,7 @@
bestn = i;
}
}
- if (besterror > 10)
+ if (besterror > 6)
return (0);
if (doit)
{
@@ -1437,8 +1438,8 @@
static int plot_readownertemplate(t_plot *x,
t_word *data, t_template *ownertemplate,
t_symbol **elemtemplatesymp, t_array **arrayp,
- float *linewidthp, float *xlocp, float *xincp, float *ylocp, float *stylep,
- float *visp, float *scalarvisp,
+ t_float *linewidthp, t_float *xlocp, t_float *xincp, t_float *ylocp, t_float *stylep,
+ t_float *visp, t_float *scalarvisp,
t_fielddesc **xfield, t_fielddesc **yfield, t_fielddesc **wfield)
{
int arrayonset, type;
@@ -1537,7 +1538,7 @@
}
static void plot_getrect(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int *xp1, int *yp1, int *xp2, int *yp2)
{
t_plot *x = (t_plot *)z;
@@ -1545,11 +1546,11 @@
t_canvas *elemtemplatecanvas;
t_template *elemtemplate;
t_symbol *elemtemplatesym;
- float linewidth, xloc, xinc, yloc, style, xsum, yval, vis, scalarvis;
+ t_float linewidth, xloc, xinc, yloc, style, xsum, yval, vis, scalarvis;
t_array *array;
int x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff;
int i;
- float xpix, ypix, wpix;
+ t_float xpix, ypix, wpix;
t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
if (!plot_readownertemplate(x, data, template,
&elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
@@ -1564,7 +1565,7 @@
int incr = (array->a_n <= 2000 ? 1 : array->a_n / 1000);
for (i = 0, xsum = 0; i < array->a_n; i += incr)
{
- float usexloc, useyloc;
+ t_float usexloc, useyloc;
t_gobj *y;
/* get the coords of the point proper */
array_getcoordinate(glist, (char *)(array->a_vec) + i * elemsize,
@@ -1584,11 +1585,11 @@
/* check also the drawing instructions for the scalar */
if (xonset >= 0)
usexloc = basex + xloc + fielddesc_cvttocoord(xfielddesc,
- *(float *)(((char *)(array->a_vec) + elemsize * i)
+ *(t_float *)(((char *)(array->a_vec) + elemsize * i)
+ xonset));
else usexloc = basex + xsum, xsum += xinc;
if (yonset >= 0)
- yval = *(float *)(((char *)(array->a_vec) + elemsize * i)
+ yval = *(t_float *)(((char *)(array->a_vec) + elemsize * i)
+ yonset);
else yval = 0;
useyloc = basey + yloc + fielddesc_cvttocoord(yfielddesc, yval);
@@ -1621,28 +1622,28 @@
}
static void plot_displace(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int dx, int dy)
{
/* not yet */
}
static void plot_select(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
/* not yet */
}
static void plot_activate(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
/* not yet */
}
static void plot_vis(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int tovis)
{
t_plot *x = (t_plot *)z;
@@ -1650,17 +1651,25 @@
t_canvas *elemtemplatecanvas;
t_template *elemtemplate;
t_symbol *elemtemplatesym;
- float linewidth, xloc, xinc, yloc, style, usexloc, xsum, yval, vis,
+ t_float linewidth, xloc, xinc, yloc, style, usexloc, xsum, yval, vis,
scalarvis;
t_array *array;
int nelem;
char *elem;
t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
-
+ /* even if the array is "invisible", if its visibility is
+ set by an instance variable you have to explicitly erase it,
+ because the flag could earlier have been on when we were getting
+ drawn. Rather than look to try to find out whether we're
+ visible we just do the erasure. At the TK level this should
+ cause no action because the tag matches nobody. LATER we
+ might want to optimize this somehow. Ditto the "vis()" routines
+ for other drawing instructions. */
+
if (plot_readownertemplate(x, data, template,
&elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
&vis, &scalarvis, &xfielddesc, &yfielddesc, &wfielddesc) ||
- ((vis == 0) && tovis) /* FIXME - why is 'tovis' flag necessary? */
+ ((vis == 0) && tovis) /* see above for 'tovis' */
|| array_getfields(elemtemplatesym, &elemtemplatecanvas,
&elemtemplate, &elemsize, xfielddesc, yfielddesc, wfielddesc,
&xonset, &yonset, &wonset))
@@ -1672,17 +1681,17 @@
{
if (style == PLOTSTYLE_POINTS)
{
- float minyval = 1e20, maxyval = -1e20;
+ t_float minyval = 1e20, maxyval = -1e20;
int ndrawn = 0;
for (xsum = basex + xloc, i = 0; i < nelem; i++)
{
- float yval, xpix, ypix, nextxloc;
+ t_float yval, xpix, ypix, nextxloc;
int ixpix, inextx;
if (xonset >= 0)
{
usexloc = basex + xloc +
- *(float *)((elem + elemsize * i) + xonset);
+ *(t_float *)((elem + elemsize * i) + xonset);
ixpix = glist_xtopixels(glist,
fielddesc_cvttocoord(xfielddesc, usexloc));
inextx = ixpix + 2;
@@ -1698,7 +1707,7 @@
}
if (yonset >= 0)
- yval = yloc + *(float *)((elem + elemsize * i) + yonset);
+ yval = yloc + *(t_float *)((elem + elemsize * i) + yonset);
else yval = 0;
if (yval > maxyval)
maxyval = yval;
@@ -1725,7 +1734,7 @@
{
char outline[20];
int lastpixel = -1, ndrawn = 0;
- float yval = 0, wval = 0, xpix;
+ t_float yval = 0, wval = 0, xpix;
int ixpix = 0;
/* draw the trace */
numbertocolor(fielddesc_getfloat(&x->x_outlinecolor, template,
@@ -1740,13 +1749,13 @@
for (i = 0, xsum = xloc; i < nelem; i++)
{
if (xonset >= 0)
- usexloc = xloc + *(float *)((elem + elemsize * i)
+ usexloc = xloc + *(t_float *)((elem + elemsize * i)
+ xonset);
else usexloc = xsum, xsum += xinc;
if (yonset >= 0)
- yval = *(float *)((elem + elemsize * i) + yonset);
+ yval = *(t_float *)((elem + elemsize * i) + yonset);
else yval = 0;
- wval = *(float *)((elem + elemsize * i) + wonset);
+ wval = *(t_float *)((elem + elemsize * i) + wonset);
xpix = glist_xtopixels(glist,
basex + fielddesc_cvttocoord(xfielddesc, usexloc));
ixpix = xpix + 0.5;
@@ -1765,15 +1774,15 @@
lastpixel = -1;
for (i = nelem-1; i >= 0; i--)
{
- float usexloc;
+ t_float usexloc;
if (xonset >= 0)
- usexloc = xloc + *(float *)((elem + elemsize * i)
+ usexloc = xloc + *(t_float *)((elem + elemsize * i)
+ xonset);
else xsum -= xinc, usexloc = xsum;
if (yonset >= 0)
- yval = *(float *)((elem + elemsize * i) + yonset);
+ yval = *(t_float *)((elem + elemsize * i) + yonset);
else yval = 0;
- wval = *(float *)((elem + elemsize * i) + wonset);
+ wval = *(t_float *)((elem + elemsize * i) + wonset);
xpix = glist_xtopixels(glist,
basex + fielddesc_cvttocoord(xfielddesc, usexloc));
ixpix = xpix + 0.5;
@@ -1817,13 +1826,13 @@
for (xsum = xloc, i = 0; i < nelem; i++)
{
- float usexloc;
+ t_float usexloc;
if (xonset >= 0)
- usexloc = xloc + *(float *)((elem + elemsize * i) +
+ usexloc = xloc + *(t_float *)((elem + elemsize * i) +
xonset);
else usexloc = xsum, xsum += xinc;
if (yonset >= 0)
- yval = *(float *)((elem + elemsize * i) + yonset);
+ yval = *(t_float *)((elem + elemsize * i) + yonset);
else yval = 0;
xpix = glist_xtopixels(glist,
basex + fielddesc_cvttocoord(xfielddesc, usexloc));
@@ -1859,14 +1868,14 @@
{
for (xsum = xloc, i = 0; i < nelem; i++)
{
- float usexloc, useyloc;
+ t_float usexloc, useyloc;
t_gobj *y;
if (xonset >= 0)
usexloc = basex + xloc +
- *(float *)((elem + elemsize * i) + xonset);
+ *(t_float *)((elem + elemsize * i) + xonset);
else usexloc = basex + xsum, xsum += xinc;
if (yonset >= 0)
- yval = *(float *)((elem + elemsize * i) + yonset);
+ yval = *(t_float *)((elem + elemsize * i) + yonset);
else yval = 0;
useyloc = basey + yloc +
fielddesc_cvttocoord(yfielddesc, yval);
@@ -1908,12 +1917,12 @@
static int plot_click(t_gobj *z, t_glist *glist,
t_word *data, t_template *template, t_scalar *sc, t_array *ap,
- float basex, float basey,
+ t_float basex, t_float basey,
int xpix, int ypix, int shift, int alt, int dbl, int doit)
{
t_plot *x = (t_plot *)z;
t_symbol *elemtemplatesym;
- float linewidth, xloc, xinc, yloc, style, vis, scalarvis;
+ t_float linewidth, xloc, xinc, yloc, style, vis, scalarvis;
t_array *array;
t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
@@ -2049,7 +2058,7 @@
}
static void drawnumber_getrect(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int *xp1, int *yp1, int *xp2, int *yp2)
{
t_drawnumber *x = (t_drawnumber *)z;
@@ -2081,14 +2090,14 @@
}
static void drawnumber_displace(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int dx, int dy)
{
/* refuse */
}
static void drawnumber_select(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
post("drawnumber_select %d", state);
@@ -2096,19 +2105,20 @@
}
static void drawnumber_activate(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int state)
{
post("drawnumber_activate %d", state);
}
static void drawnumber_vis(t_gobj *z, t_glist *glist,
- t_word *data, t_template *template, float basex, float basey,
+ t_word *data, t_template *template, t_float basex, t_float basey,
int vis)
{
t_drawnumber *x = (t_drawnumber *)z;
- if (!fielddesc_getfloat(&x->x_vis, template, data, 0))
+ /* see comment in plot_vis() */
+ if (vis && !fielddesc_getfloat(&x->x_vis, template, data, 0))
return;
if (vis)
{
@@ -2133,7 +2143,7 @@
else sys_vgui(".x%lx.c delete drawnumber%lx\n", glist_getcanvas(glist), data);
}
-static float drawnumber_motion_ycumulative;
+static t_float drawnumber_motion_ycumulative;
static t_glist *drawnumber_motion_glist;
static t_scalar *drawnumber_motion_scalar;
static t_array *drawnumber_motion_array;
@@ -2215,7 +2225,7 @@
else
{
/* key entry for a numeric field. This is just a stopgap. */
- float newf;
+ t_float newf;
if (drawnumber_motion_firstkey)
sbuf[0] = 0;
else sprintf(sbuf, "%g", template_getfloat(drawnumber_motion_template,
@@ -2248,7 +2258,7 @@
static int drawnumber_click(t_gobj *z, t_glist *glist,
t_word *data, t_template *template, t_scalar *sc, t_array *ap,
- float basex, float basey,
+ t_float basex, t_float basey,
int xpix, int ypix, int shift, int alt, int dbl, int doit)
{
t_drawnumber *x = (t_drawnumber *)z;
Property changes on: branches/pd-extended/0.41/pd/src/g_template.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_template.c:9670-10504
/tags/pd/pd-0.41-4/src/g_template.c:9603-9669
/trunk/pd/src/g_template.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_toggle.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_toggle.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_toggle.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -69,7 +69,7 @@
yy+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
- x->x_gui.x_lcol, x);
+ x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas, xx, yy + x->x_gui.x_h-1, xx + IOWIDTH, yy + x->x_gui.x_h, x, 0);
@@ -260,7 +260,7 @@
{
t_symbol *srl[3];
int a = (int)atom_getintarg(0, argc, argv);
- float nonzero = (float)atom_getfloatarg(2, argc, argv);
+ t_float nonzero = (t_float)atom_getfloatarg(2, argc, argv);
int sr_flags;
if(nonzero == 0.0)
@@ -317,7 +317,7 @@
static void toggle_loadbang(t_toggle *x)
{
if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit)
- toggle_fout(x, (float)x->x_on);
+ toggle_fout(x, (t_float)x->x_on);
}
static void toggle_size(t_toggle *x, t_symbol *s, int ac, t_atom *av)
@@ -369,7 +369,7 @@
int a=IEM_GUI_DEFAULTSIZE, f=0;
int ldx=17, ldy=7;
int fs=10;
- float on=0.0, nonzero=1.0;
+ t_float on=0.0, nonzero=1.0;
char str[144];
iem_inttosymargs(&x->x_gui.x_isa, 0);
@@ -394,11 +394,11 @@
bflcol[0] = (int)atom_getintarg(9, argc, argv);
bflcol[1] = (int)atom_getintarg(10, argc, argv);
bflcol[2] = (int)atom_getintarg(11, argc, argv);
- on = (float)atom_getfloatarg(12, argc, argv);
+ on = (t_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);
+ nonzero = (t_float)atom_getfloatarg(13, argc, argv);
x->x_gui.x_draw = (t_iemfunptr)toggle_draw;
x->x_gui.x_fsf.x_snd_able = 1;
Property changes on: branches/pd-extended/0.41/pd/src/g_toggle.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_toggle.c:9670-10504
/tags/pd/pd-0.41-4/src/g_toggle.c:9603-9669
/trunk/pd/src/g_toggle.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_vdial.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_vdial.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_vdial.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -347,14 +347,14 @@
{
if((x->x_change)&&(x->x_on != x->x_on_old))
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
pd_list(x->x_gui.x_snd->s_thing, &s_list, 2, x->x_at);
}
x->x_on_old = x->x_on;
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -382,7 +382,7 @@
/* compatibility with earlier "vdial" behavior */
if((x->x_change)&&(i != x->x_on_old))
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -393,7 +393,7 @@
x->x_on = i;
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
x->x_on_old = x->x_on;
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -426,7 +426,7 @@
{
if(x->x_gui.x_fsf.x_put_in2out)
{
- SETFLOAT(x->x_at, (float)x->x_on_old);
+ SETFLOAT(x->x_at, (t_float)x->x_on_old);
SETFLOAT(x->x_at+1, 0.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -440,7 +440,7 @@
x->x_on_old = x->x_on;
if(x->x_gui.x_fsf.x_put_in2out)
{
- SETFLOAT(x->x_at, (float)x->x_on);
+ SETFLOAT(x->x_at, (t_float)x->x_on);
SETFLOAT(x->x_at+1, 1.0);
outlet_list(x->x_gui.x_obj.ob_outlet, &s_list, 2, x->x_at);
if(x->x_gui.x_fsf.x_snd_able && x->x_gui.x_snd->s_thing)
@@ -466,7 +466,7 @@
{
int yy = (int)ypos - text_ypix(&x->x_gui.x_obj, x->x_gui.x_glist);
- vradio_fout(x, (float)(yy / x->x_gui.x_h));
+ vradio_fout(x, (t_float)(yy / x->x_gui.x_h));
}
static int vradio_newclick(t_gobj *z, struct _glist *glist,
Modified: branches/pd-extended/0.41/pd/src/g_vslider.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_vslider.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_vslider.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -25,7 +25,6 @@
#include <io.h>
#endif
-
/* ------------ vsl gui-vertical slider ----------------------- */
t_widgetbehavior vslider_widgetbehavior;
@@ -66,7 +65,7 @@
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
- x->x_gui.x_lcol, x);
+ x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
canvas,
@@ -218,7 +217,7 @@
binbuf_addv(b, "ssiisiiffiisssiiiiiiiii", gensym("#X"),gensym("obj"),
(int)x->x_gui.x_obj.te_xpix, (int)x->x_gui.x_obj.te_ypix,
gensym("vsl"), x->x_gui.x_w, x->x_gui.x_h,
- (float)x->x_min, (float)x->x_max,
+ (t_float)x->x_min, (t_float)x->x_max,
x->x_lin0_log1, iem_symargstoint(&x->x_gui.x_isa),
srl[0], srl[1], srl[2],
x->x_gui.x_ldx, x->x_gui.x_ldy,
Property changes on: branches/pd-extended/0.41/pd/src/g_vslider.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_vslider.c:9670-10504
/tags/pd/pd-0.41-4/src/g_vslider.c:9603-9669
/trunk/pd/src/g_vslider.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/g_vumeter.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_vumeter.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/g_vumeter.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -145,7 +145,7 @@
canvas, xpos+x->x_gui.x_ldx, ypos+x->x_gui.x_ldy,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
- x->x_gui.x_lcol, x);
+ x->x_gui.x_lcol, x);
if(!x->x_gui.x_fsf.x_snd_able)
{
sys_vgui(".x%lx.c create rectangle %d %d %d %d -tags %lxOUT%d\n",
@@ -541,7 +541,7 @@
vu_check_height(x, h);
if(scale != 0)
scale = 1;
- vu_scale(x, (float)scale);
+ vu_scale(x, (t_float)scale);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_CONFIG);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_IO + sr_flags);
(*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_MOVE);
@@ -596,7 +596,7 @@
x->x_rms = iemgui_vu_db2i[i];
}
i = (int)(100.0*rms + 10000.5);
- rms = 0.01*(float)(i - 10000);
+ rms = 0.01*(t_float)(i - 10000);
x->x_fr = rms;
outlet_float(x->x_out_rms, rms);
x->x_updaterms = 1;
@@ -617,7 +617,7 @@
x->x_peak = iemgui_vu_db2i[i];
}
i = (int)(100.0*peak + 10000.5);
- peak = 0.01*(float)(i - 10000);
+ peak = 0.01*(t_float)(i - 10000);
x->x_fp = peak;
x->x_updatepeak = 1;
sys_queuegui(x, x->x_gui.x_glist, vu_draw_update);
Property changes on: branches/pd-extended/0.41/pd/src/g_vumeter.c
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/g_vumeter.c:9670-10504
/tags/pd/pd-0.41-4/src/g_vumeter.c:9603-9669
/trunk/pd/src/g_vumeter.c:6083-9602
Modified: branches/pd-extended/0.41/pd/src/m_binbuf.c
===================================================================
--- branches/pd-extended/0.41/pd/src/m_binbuf.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/m_binbuf.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -725,14 +725,14 @@
case A_SYMBOL:
typedmess(target, mstack->a_w.w_symbol, nargs-1, mstack+1);
break;
- case A_BLOB: /* MP 20070106 blob type */
- if (nargs == 1) pd_blob(target, stackwas->a_w.w_blob);
- else pd_list(target, 0, nargs, stackwas);
- break;
case A_FLOAT:
if (nargs == 1) pd_float(target, mstack->a_w.w_float);
else pd_list(target, 0, nargs, mstack);
break;
+ case A_BLOB: /* MP 20070106 blob type */
+ if (nargs == 1) pd_blob(target, mstack->a_w.w_blob);
+ else pd_list(target, 0, nargs, mstack);
+ break;
}
}
msp = mstack;
Modified: branches/pd-extended/0.41/pd/src/m_obj.c
===================================================================
--- branches/pd-extended/0.41/pd/src/m_obj.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/m_obj.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -16,7 +16,7 @@
t_float *iu_floatslot;
t_symbol **iu_symslot;
t_blob **iu_blobslot; /* MP 20061226 blob type */
- t_sample iu_floatsignalvalue;
+ t_float iu_floatsignalvalue;
};
struct _inlet
@@ -290,14 +290,17 @@
pointerinlet_class = class_new(gensym("inlet"), 0, 0,
sizeof(t_inlet), CLASS_PD, 0);
class_addpointer(pointerinlet_class, pointerinlet_pointer);
-
+ class_addanything(pointerinlet_class, inlet_wrong);
+
floatinlet_class = class_new(gensym("inlet"), 0, 0,
sizeof(t_inlet), CLASS_PD, 0);
class_addfloat(floatinlet_class, (t_method)floatinlet_float);
+ class_addanything(floatinlet_class, inlet_wrong);
symbolinlet_class = class_new(gensym("inlet"), 0, 0,
sizeof(t_inlet), CLASS_PD, 0);
class_addsymbol(symbolinlet_class, symbolinlet_symbol);
+ class_addanything(symbolinlet_class, inlet_wrong);
}
@@ -709,7 +712,7 @@
return (o2 && (o2->o_sym == &s_signal));
}
-t_sample *obj_findsignalscalar(t_object *x, int m)
+t_float *obj_findsignalscalar(t_object *x, int m)
{
int n = 0;
t_inlet *i;
@@ -717,7 +720,7 @@
{
if (!m--)
return (x->ob_pd->c_floatsignalin > 0 ?
- (t_sample *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0);
+ (t_float *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0);
n++;
}
for (i = x->ob_inlet; i; i = i->i_next, m--)
Property changes on: branches/pd-extended/0.41/pd/src/makefile.in
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/pd/0.41-4/src/makefile.in:9670-10505
/tags/pd/pd-0.41-4/src/makefile.in:9603-9669
/trunk/pd/src/makefile.in:6083-9602
Modified: branches/pd-extended/0.41/pd/src/s_audio_jack.c
===================================================================
--- branches/pd-extended/0.41/pd/src/s_audio_jack.c 2009-01-10 19:00:24 UTC (rev 10505)
+++ branches/pd-extended/0.41/pd/src/s_audio_jack.c 2009-01-10 19:43:17 UTC (rev 10506)
@@ -18,8 +18,8 @@
static jack_nframes_t jack_out_max;
#define JACK_OUT_MAX 64
static jack_nframes_t jack_filled = 0;
-static float jack_outbuf[NUM_JACK_PORTS*BUF_JACK];
-static float jack_inbuf[NUM_JACK_PORTS*BUF_JACK];
+static t_sample jack_outbuf[NUM_JACK_PORTS*BUF_JACK];
+static t_sample jack_inbuf[NUM_JACK_PORTS*BUF_JACK];
static int jack_started = 0;
@@ -39,22 +39,42 @@
process (jack_nframes_t nframes, void *arg)
{
int j;
- float *out;
- float *in;
+ jack_default_audio_sample_t *out, *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");
-
- for (j = 0; j < sys_outchannels; j++) {
+ /* hmm, how to find out whether 't_sample' and 'jack_default_audio_sample_t' are actually the same type??? */
+ if(sizeof(t_sample)==sizeof(jack_default_audio_sample_t))
+ {
+ for (j = 0; j < sys_outchannels; j++) {
out = jack_port_get_buffer (output_port[j], nframes);
- memcpy(out, jack_outbuf + (j * BUF_JACK), sizeof (float) * nframes);
- }
- for (j = 0; j < sys_inchannels; j++) {
+ memcpy(out, jack_outbuf + (j * BUF_JACK), sizeof (jack_default_audio_sample_t) * nframes);
+ }
+ for (j = 0; j < sys_inchannels; j++) {
in = jack_port_get_buffer( input_port[j], nframes);
- memcpy(jack_inbuf + (j * BUF_JACK), in, sizeof (float) * nframes);
+ memcpy(jack_inbuf + (j * BUF_JACK), in, sizeof (jack_default_audio_sample_t) * nframes);
+ }
+ }
+ else
+ {
+ unsigned int frame=0;
+ t_sample*data;
+ for (j = 0; j < sys_outchannels; j++) {
+ out = jack_port_get_buffer (output_port[j], nframes);
+ data=jack_outbuf + (j * BUF_JACK);
+ for(frame=0; frame<nframes; frame++) {
+ *out++=*data++;
+ }
+ }
+ for (j = 0; j < sys_inchannels; j++) {
+ in = jack_port_get_buffer( input_port[j], nframes);
+ data=jack_inbuf+(j*BUF_JACK);
+ for(frame=0; frame<nframes; frame++) {
+ *data++=*in++;
+ }
+ }
}
jack_filled -= nframes;
} else { /* PD could not keep up ! */
@@ -351,7 +371,7 @@
int jack_send_dacs(void)
{
- float * fp;
+ t_sample * fp;
int j;
int rtnval = SENDDACS_YES;
int timenow;
@@ -372,12 +392,12 @@
fp = sys_soundout;
for (j = 0; j < sys_outchannels; j++) {
- memcpy(jack_outbuf + (j * BUF_JACK) + jack_filled,fp, DEFDACBLKSIZE*sizeof(float));
+ memcpy(jack_outbuf + (j * BUF_JACK) + jack_filled,fp, DEFDACBLKSIZE*sizeof(t_sample));
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Pd-cvs
mailing list