Commit 2b015d09 authored by Miller Puckette's avatar Miller Puckette
Browse files

several patches from sourceforge

parent 05212d63
......@@ -25,7 +25,7 @@ are described in the next chapter. To learn digital audio processing basics
such as how to generate time-varying sounds that don't click or fold over, try
the on-line book,
<A HREF="http://www.crca.ucsd.edu/~msp/techniques.htm"
<I> Theory and Techniques of Electronic Music </I>.
<I> Theory and Techniques of Electronic Music </I></A>.
<H3> <A name=s1> 2.1 overview </A> </H3>
......
#N canvas 258 107 701 742 12;
#X obj 195 318 until;
#X obj 221 284 max 0;
#X floatatom 221 263 5 0 0 1 times - -;
#X text 229 234 times;
#X obj 195 342 print repetition;
#X msg 195 234 5;
#X obj 175 571 + 1;
#X obj 118 572 float;
#X obj 118 546 until;
#X obj 118 606 moses 10;
#X obj 233 558 bang;
#X obj 118 639 print number;
#X msg 118 524 bang;
#X msg 196 529 0;
#X text 241 529 reset;
#X text 277 560 stop "until" when counter reaches 10;
#X text 479 711 updated for Pd 0.41;
#X text 31 16 Looping with the "until" object;
#X text 52 47 It is sometimes desirable to make a loop without an embedded
delay (as in 06.more.counters.pd") but rather to make the entire loop
take place in the context of a single incoming message. The "until"
object is provided to make this possible.;
#X text 273 285 make nonnegative;
#X text 56 445 Conditional loops get started with a "bang" to until's
left inlet. Make sure you stop the loop with a "bang" to until's right
inlet \, otherwise it will try to run forever and Pd will freeze!;
#X text 48 131 "until" has two modes: It can either run automatically
for a certain number of times (a "counting" loop) or it can run forever
until stopped through its right inlet (a "conditional" loop).;
#X text 47 196 You can perform a counting loop by sending a positive
number to until:;
#X text 55 398 (As of version 0.41 \, "until" silently interprets negative
numbers to be equivalent to zero.);
#X text 62 667 In pseudo-code: "x=0 \; do print x++ until x>=10";
#X text 57 368 In pseudo-code: "for i = 1 to 5 do print end";
#X connect 0 0 4 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 5 0 0 0;
#X connect 6 0 7 1;
#X connect 7 0 6 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 9 0 11 0;
#X connect 9 1 10 0;
#X connect 10 0 8 1;
#X connect 12 0 8 0;
#X connect 13 0 7 1;
......@@ -42,6 +42,8 @@ AC_ARG_ENABLE(setuid, [ --enable-setuid install as setuid (linux)],
setuid=$enableval)
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")
dnl Checks for programs.
AC_PROG_CC
......@@ -77,7 +79,7 @@ AC_CHECK_LIB(ffm, sin,PDLIB="$PDLIB -lffm")
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",
......@@ -87,7 +89,7 @@ AC_CHECK_LIB(pthread, pthread_create,PDLIB="$PDLIB -lpthread",
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)
......@@ -96,83 +98,83 @@ fi
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 `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)
......@@ -184,69 +186,69 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
fi
EXT=pd_linux
CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD\
-DUSEAPI_OSS \
-fno-strict-aliasing"
-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 -DHAVE_SYS_SOUNDCARD_H \
-Wno-error \
CPPFLAGS=$CPPFLAGS" -DUSEAPI_PORTAUDIO -DHAVE_SYS_SOUNDCARD_H \
-Wno-error \
-I../portaudio/include -I../portaudio/src/common \
-I../portaudio/src/os/unix/ \
-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
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
......@@ -255,47 +257,52 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
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 -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"
-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
MORECFLAGS="-DMACOSX3 -DPA_BIG_ENDIAN -Wno-error"
EXTERNTARGET=d_ppc
else
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 -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/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 \
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 \
......@@ -305,34 +312,34 @@ then
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 Jack"
LDFLAGS=$LDFLAGS" -weak_framework Jack"
fi
if test x$jack == "xrun";
if test x$jack = "xrun";
then
LDFLAGS=$LDFLAGS" -weak_framework Jack"
fi
......@@ -341,35 +348,35 @@ fi
# 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/include -I../portaudio/src/common \
-I../portaudio/src/os/win/ \
-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/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/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"
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=
......@@ -377,18 +384,18 @@ fi
# 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"
......
......@@ -27,18 +27,13 @@ static t_int *print_perform(t_int *w)
int n = (int)(w[3]);
if (x->x_count)
{
post("%s:", x->x_sym->s_name);
if (n == 1) post("%8g", in[0]);
else if (n == 2) post("%8g %8g", in[0], in[1]);
else if (n == 4) post("%8g %8g %8g %8g",
in[0], in[1], in[2], in[3]);
else while (n > 0)
{
post("%-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g %-8.5g",
in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]);
n -= 8;
in += 8;
int i=0;
startpost("%s:", x->x_sym->s_name);
for(i=0; i<n; i++) {
if(i%8==0)endpost();
startpost("%-8.5g", in[i]);
}
endpost();
x->x_count--;
}
return (w+4);
......
......@@ -522,11 +522,16 @@ void glob_start_path_dialog(t_pd *dummy)
char buf[MAXPDSTRING];
int i;
t_namelist *nl;
for (nl = sys_searchpath, i = 0; nl && i < 10; nl = nl->nl_next, i++)
sys_vgui("pd_set pd_path%d \"%s\"\n", i, nl->nl_string);
for (; i < 10; i++)
sys_vgui("pd_set pd_path%d \"\"\n", i);
sprintf(buf, "list");
for (nl = sys_searchpath, i = 0; nl; nl = nl->nl_next, i++) {
if(nl->nl_string){
strcat(buf, " \"");
strcat(buf, nl->nl_string);
strcat(buf, "\"");
}
}
sys_vgui("pd_set pd_path [%s]\n", buf);
sprintf(buf, "pdtk_path_dialog %%s %d %d\n", sys_usestdpath, sys_verbose);
gfxstub_new(&glob_pdobject, (void *)glob_start_path_dialog, buf);
......@@ -554,11 +559,16 @@ void glob_start_startup_dialog(t_pd *dummy)
char buf[MAXPDSTRING];
int i;
t_namelist *nl;
for (nl = sys_externlist, i = 0; nl && i < 10; nl = nl->nl_next, i++)
sys_vgui("pd_set pd_startup%d \"%s\"\n", i, nl->nl_string);
for (; i < 10; i++)
sys_vgui("pd_set pd_startup%d \"\"\n", i);
sprintf(buf, "list");
for (nl = sys_externlist, i = 0; nl; nl = nl->nl_next, i++) {
if(nl->nl_string){
strcat(buf, " \"");
strcat(buf, nl->nl_string);
strcat(buf, "\"");
}
}
sys_vgui("pd_set pd_startup [%s]\n", buf);
sprintf(buf, "pdtk_startup_dialog %%s %d \"%s\"\n", sys_defeatrt,
sys_flags->s_name);
......
......@@ -415,9 +415,16 @@ proc menu_openhtml {filename} {
global pd_nt
if {$pd_nt == 0} {
exec sh -c \
[format "firefox file:%s || mozilla file:%s " \
$filename $filename] &
foreach candidate \
{ gnome-open xdg-open sensible-browser iceweasel firefox mozilla \
galeon konqueror netscape lynx } {
set browser [lindex [auto_execok $candidate] 0]
if {[string length $browser]} {
puts stderr [format "%s %s" $browser $filename]
exec -- sh -c [format "%s %s" $browser $filename] &
break
}
}
} elseif {$pd_nt == 2} {
puts stderr [format "open %s" $filename]
exec sh -c [format "open %s" $filename]
......@@ -4209,15 +4216,16 @@ proc pdtk_alsa_midi_dialog {id indev1 indev2 indev3 indev4 \
proc path_apply {id} {
global pd_extrapath pd_verbose
global pd_path0 pd_path1 pd_path2 pd_path3 pd_path4
global pd_path5 pd_path6 pd_path7 pd_path8 pd_path9
global pd_path_count
set pd_path {}
pd [concat pd path-dialog $pd_extrapath $pd_verbose \
[pdtk_encodedialog $pd_path0] [pdtk_encodedialog $pd_path1] \
[pdtk_encodedialog $pd_path2] [pdtk_encodedialog $pd_path3] \
[pdtk_encodedialog $pd_path4] [pdtk_encodedialog $pd_path5] \
[pdtk_encodedialog $pd_path6] [pdtk_encodedialog $pd_path7] \
[pdtk_encodedialog $pd_path8] [pdtk_encodedialog $pd_path9] \;]
for {set x 0} {$x < $pd_path_count} {incr x} {
global pd_path$x
set this_path [set pd_path$x]
if {0==[string match "" $this_path]} {lappend pd_path [pdtk_encodedialog $this_path]}
}
pd [concat pd path-dialog $pd_extrapath $pd_verbose $pd_path \;]
}
proc path_cancel {id} {
......@@ -4231,8 +4239,16 @@ proc path_ok {id} {
proc pdtk_path_dialog {id extrapath verbose} {
global pd_extrapath pd_verbose
global pd_path0 pd_path1 pd_path2 pd_path3 pd_path4
global pd_path5 pd_path6 pd_path7 pd_path8 pd_path9
global pd_path
global pd_path_count
set pd_path_count [expr [llength $pd_path] + 2]
if { $pd_path_count < 10 } { set pd_path_count 10 }
for {set x 0} {$x < $pd_path_count} {incr x} {
global pd_path$x
set pd_path$x [lindex $pd_path $x]
}
set pd_extrapath $extrapath
set pd_verbose $verbose
......@@ -4262,8 +4278,8 @@ proc pdtk_path_dialog {id extrapath verbose} {
-command "path_apply $id \; pd pd save-preferences \\;"