diff -ruN TiMidity++-1.2.1/ChangeLog TiMidity++-1.3.0/ChangeLog --- TiMidity++-1.2.1/ChangeLog Mon Jan 25 20:40:11 1999 +++ TiMidity++-1.3.0/ChangeLog Wed Feb 3 07:27:12 1999 @@ -1,7 +1,106 @@ +-- 1.3.0 +Wed Feb 3 1999 +Summary: + * Fixed some problems with the Xaw and Tcl/Tk interfaces. + * Modified to compile on cygnus. + * Made support.c to define missing functions. + * Used `strerror()' instead of `sys_errlist[]'. + * Imported Macintosh source from 1999.1.7 released. + * Defined BIG_ENDIAN or LITTLE_ENDIAN according to WORDS_BIGENDIAN. + * Configure/Makefile modifications: + - Enabled to configure on cygnus. + - Remove -aout compiler flag on FreeBSD. + - Remove -Wall compiler flag. + - Don't use `+=' operation in any Makefiles. Old GNU make may not + recognize append operator. + * Improved XAW interface for trace playing. + * Improved reverb sounds. + * Fixed MIME/Multipart bug. + + +Date: Tue, 2 Feb 1999 21:15:14 +0100 (CET) +From: Peter Kleiweg +Files: interface/{browser.tcl,xaw_i.c,tkmidity.ptcl} + Fixed some problems with the Xaw and Tcl/Tk interfaces: + - With the Xaw interface, in the File Open dialog, the file/directory + listing was unsorted. + - With the Tcl/Tk interface, in the File Open dialog, the directory + listing was sorted, but not the file listing. + - On some machine, there is no 17 point fonts. Changed the use of 17 + point fonts into 18 point fonts. + +Date: Wed Feb 3 1999 +From: Masanao Izumo +Files: timidity/{win_a.c,timidity.c,playmidi.c} + Modified to compile on CYGNUS/gcc. + Fragment optimizations. + +Date: Tue Feb 2 1999 +From: Masanao Izumo +Files: utils/support.c timidity/timidity.h + Defined missing functions. And declared them in timidity.h. +Files: timidity/output.c timidity/output.h + Added output_encoding_string() function to display the name of encoding. +Files: interface/{wrdt_wincon.c,vt100_c.c} + timidity/{playmidi.c,win_a.c} + Modified to compile on CYGNUS/gcc +Files: interface{gtk_p.c,motif_p.c,tk_c.c} libarc/url.c + timidity/{aiff_a.c,au_a.c,audriv_al.c,audriv_sun.c,bsd20_a.c,common.c, + dl_dlopen.c,dl_hpux.c,hpux_d_a.c,linux_a.c,raw_a.c,readmidi.c, + timidity.c,timidity.h,wave_a.c} + Used `strerror()' instead of `sys_errlist[]'. + Included in timidity.h if HAVE_ERRNO_H is true. +Files: timidity/{mac_a.c,mac_com.h,mac_dlog.c,mac_main.c,mac_main.h,mac_qt_a.c, + mac_soundspec.c} + interface/{mac_c.c,mac_c.h,mac_loadBMP.c,mac_loadBMP.h,mac_mag.c, + mac_mag.h,mac_skin.c,mac_skin.h,mac_trace.c,mac_wrdwindow.c, + mac_wrdwindow.h,wrdt_mac.c} + utils/{mac_readdir.c,mac_readdir.h,mac_util.c,mac_util.h} + Imported Macintosh source from 1999.1.7 released. +Files: timidity/timidity.h + If WORDS_BIGENDIAN is defined in config.h, define BIG_ENDIAN, + otherwise define LITTLE_ENDIAN. +Files: utils/timer.c + Use gettimeofday() if HAVE_GETTIMEOFDAY, otherwise Use Windows API. +Files: configure.in utils/Makefile.am libarc/url_dir.c + Modified the implementation about opendir(). + +Date: Mon Feb 1 1999 +From: Yoshishige Arai + Improved XAW interface display in trace mode. + +Date: Fri Jan 29 1999 +From: Masanao Izumo +Files: configure.in + On FreeBSD, There is probrem to make shared object library. + Netscape Plugin needs `aout' format, but I don't have enough + knowledge to build aout format under ELF environment FreeBSD. + So I just removed -aout flag for compiler. +Files: doc/ja_JP.ujis/timidity.cfg.5 + Changed `Kairyouban' to `TiMidity++'. +Files: INSTALL, INSTALL.jp + Added some discriptions. +Files: common.makefile.in + Removed -Wall option from compiler option. + Expanded `+=' macro definition. + Defined @EXTRADEFS@ in CPPFLAGS instead of DEFS. + +Date: Thu, 28 Jan 1999 +From: Masaki Kiryu +Files: timidity/reverb.{c,h} + Improved reverb sounds. + +Date: Wed Jan 27 1999 +From: Masanao Izumo +Files: libarc/arc_mime.c + Fixed bug about MIME archiver for multipart/mixed. + You can play midi in MIME/Multipart file. For example: + % timidity mail:~/Mail/inbox/1234 + I think MIME/Multipart is one of archive file format. :-) + -- 1.2.1 Mon Jan 25 1999 Summary: - * Added missing files. * Fixed some configuration probrems. * Added --enable-dynamic `configure' option. diff -ruN TiMidity++-1.2.1/INSTALL TiMidity++-1.3.0/INSTALL --- TiMidity++-1.2.1/INSTALL Wed Jan 20 18:17:12 1999 +++ TiMidity++-1.3.0/INSTALL Wed Feb 3 07:00:50 1999 @@ -3,7 +3,7 @@ Installation guide Masanao Izumo - Last updated on Jan.6.1999 + Last updated on Feb.3.1999 ============================================================================== This document describes how to install TiMidity++(version 1.0.0 or later) @@ -14,7 +14,7 @@ Installing process: 1. ./configure - 2. edit Makefile and timidity.h (not necessary) + 2. edit common.makefile, Makefile, timidity.h (not necessary) 3. make (required:GNU make) 4. make install (required:GNU make) 5. search for various voice data :) @@ -167,10 +167,10 @@ -2. edits Makefile, timidity.h +2. edits common.makefile, Makefile, timidity.h ------------------------------ If configure failed or compile not complete successfully, edit - Makefile and timidity.h to appropriate value. + common.makefile, Makefile, and timidity.h to appropriate value. @@ -204,12 +204,13 @@ 5. Search for various voice data - - This package contains only Piano and Guitar patch. Please check - the following sites for many voice(patch) data: - -http://www.goice.co.jp/timidity/gus/ -http://www.i.h.kyoto-u.ac.jp/~shom/timidity/ + TiMidity++ uses GUS/patch (Glavis Ultrasound) as the voice data to play. + You must get GUS/patch files, and make the configuration file. + Please check the following sites for many voice(patch) data: + +http://www.goice.co.jp/timidity/gus/ (33M patch) +http://www.goice.co.jp/timidity/dist/cfg/ (Some samples of *.cfg) +http://www.i.h.kyoto-u.ac.jp/~shom/timidity/ (10M or 4M patch) ftp://ftp.cdrom.com/pub/gus/sound/patches/files/ (GUS site) If you got funny voice archive, extract it to appropriate directory and @@ -493,28 +494,6 @@ temporary files in /tmp . In Windows, TMPDIR variable are ignored. So you should specify the temporary path with this macro. - - - Next, configuration of existence of union semun. If your system - has it, - -#define HAVE_UNION_SEMUN - - or - -/* #define HAVE_UNION_SEMUN */ - - - - Next, configuration of existence of volatile declaration. If your - compiler supports volatile declaration, - -/* #define NO_VOLATILE */ - - otherwise, - -#define NO_VOLATILE - Next, recognizing GS drum part by GS exclusive message. diff -ruN TiMidity++-1.2.1/INSTALL.jp TiMidity++-1.3.0/INSTALL.jp --- TiMidity++-1.2.1/INSTALL.jp Wed Jan 20 18:17:12 1999 +++ TiMidity++-1.3.0/INSTALL.jp Wed Feb 3 06:26:31 1999 @@ -3,7 +3,7 @@ TiMidity++ のインストール 出雲正尚 - 最終修正日 1999年1月6日 + 最終修正日 1999年2月3日 ============================================================================== このドキュメントは TiMidity++ (バージョンは 1.0.0 以降) の UNIX 上での @@ -13,7 +13,7 @@ インストールの大まかな手順は 1. configure -2. Makefile, timidity.h の編集 (しなくてもよい) +2. common.makefile, Makefile, timidity.h の編集 (しなくてもよい) 3. make (GNU の make が必要) 4. make install (GNU の make が必要) 5. 音源をそろえる @@ -180,9 +180,9 @@ 行なうための定義です。Linux, FreeBSD, SunOS, Solaris, IRIX, DEC/OSF1 で 有効です。 -2. Makefile, timidity.h の編集 +2. common.makefile, Makefile, timidity.h の編集 ------------------------------ -もし、正しくコンパイルできない場合は、Makefile, あるいは timidity.h +もし、正しくコンパイルできない場合は、common.makefile, Makefile, timidity.h 内のパラメタを修正してください。 3. make @@ -218,8 +218,9 @@ このパッケージの TiMidity をインストールしただけでは、音がなりません。 演奏するには、GUS の音源ファイルを入手する必要があります。 -http://www.goice.co.jp/timidity/gus/ -http://www.i.h.kyoto-u.ac.jp/~shom/timidity/ +http://www.goice.co.jp/timidity/gus/ (33M patch) +http://www.goice.co.jp/timidity/dist/cfg/ (Some samples of *.cfg) +http://www.i.h.kyoto-u.ac.jp/~shom/timidity/ (10M or 4M patch) ftp://ftp.cdrom.com/pub/gus/sound/patches/files/ (GUS サイトの移転先) などから音源を入手し,適切な場所に展開します.必要に応じて,*.cfg ファイルの @@ -540,30 +541,6 @@ 一時ファイルが作成されます. Windows では,TMPDIR 環境変数は無視されますので, TMPDIR マクロを定義してください. - - -次に union semun 共用体の有無に関する設定です. -union semun 共用体が定義されている環境では - -#define HAVE_UNION_SEMUN - -と定義し,ないなら - -/* #define HAVE_UNION_SEMUN */ - -と未定義にしてください. - - -次にコンパイラの volatile に関する設定です. -コンパイラが volatile 宣言をサポートしているなら, - -/* #define NO_VOLATILE */ - -と未定義し,サポートしていなければ - -#define NO_VOLATILE - -と定義にしてください. 次に,GS のドラムパートの認識に関する設定です. diff -ruN TiMidity++-1.2.1/Makefile.in TiMidity++-1.3.0/Makefile.in --- TiMidity++-1.2.1/Makefile.in Mon Jan 25 21:30:18 1999 +++ TiMidity++-1.3.0/Makefile.in Wed Feb 3 07:27:40 1999 @@ -105,6 +105,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/NEWS TiMidity++-1.3.0/NEWS --- TiMidity++-1.2.1/NEWS Mon Jan 25 20:39:05 1999 +++ TiMidity++-1.3.0/NEWS Wed Feb 3 07:26:57 1999 @@ -1,3 +1,11 @@ +* 2/3, 1999 + Released TiMidity++ v1.3.0. + New features and major change from v1.2.x: + * Enabled to configure & compile on cygnus. + * Improved XAW interface for trace playing. + * Improved reverb sounds. + * Fixed MIME/Multipart bug. + * 1/25, 1999 Released TiMidity++ v1.2.1. Added missing files. diff -ruN TiMidity++-1.2.1/common.makefile.in TiMidity++-1.3.0/common.makefile.in --- TiMidity++-1.2.1/common.makefile.in Mon Jan 25 19:58:51 1999 +++ TiMidity++-1.3.0/common.makefile.in Fri Jan 29 13:37:22 1999 @@ -47,15 +47,13 @@ #CC= @CC@ #CFLAGS = @CFLAGS@ -#CPPFLAGS = @CPPFLAGS@ +CPPFLAGS = @CPPFLAGS@ @EXTRADEFS@ -DDEFAULT_PATH=\"$(TIMID_DIR)\" #DEFS = @DEFS@ -#EXTRADEFS = @EXTRADEFS@ #LDFLAGS = @LDFLAGS@ -#LIBS = @LIBS@ -#EXTRALIBS = @EXTRALIBS@ +LIBS = @LIBS@ @EXTRALIBS@ SHLD = @SHLD@ SHCFLAGS = @SHCFLAGS@ -DEBUGFLAGS = -Wall +#@SET_MAKE@ ########### Install. #INSTALL = @INSTALL@ @@ -69,9 +67,5 @@ # Where to install the Tcl code, if you use the Tcl code that is. TCL_DIR = $(TIMID_DIR) #TCL_DIR = $(pkgdatadir) - -CFLAGS += $(DEBUGFLAGS) -DEFS += $(EXTRADEFS) -DDEFAULT_PATH=\"$(TIMID_DIR)\" -LIBS += $(EXTRALIBS) .SUFFIXES: .c .h .ptcl .tcl .o .1 .txt .ps .@so@ diff -ruN TiMidity++-1.2.1/config.h.in TiMidity++-1.3.0/config.h.in --- TiMidity++-1.2.1/config.h.in Mon Jan 25 15:20:49 1999 +++ TiMidity++-1.3.0/config.h.in Tue Feb 2 18:14:02 1999 @@ -56,6 +56,9 @@ /* Define if you have the gethostbyname function. */ #undef HAVE_GETHOSTBYNAME +/* Define if you have the getopt function. */ +#undef HAVE_GETOPT + /* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE @@ -65,6 +68,9 @@ /* Define if you have the select function. */ #undef HAVE_SELECT +/* Define if you have the sleep function. */ +#undef HAVE_SLEEP + /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF @@ -97,6 +103,9 @@ /* Define if you have the header file. */ #undef HAVE_DLFCN_H + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H /* Define if you have the header file. */ #undef HAVE_FCNTL_H diff -ruN TiMidity++-1.2.1/configure TiMidity++-1.3.0/configure --- TiMidity++-1.2.1/configure Mon Jan 25 21:23:06 1999 +++ TiMidity++-1.3.0/configure Wed Feb 3 05:12:36 1999 @@ -836,7 +836,7 @@ PACKAGE=TiMidity++ -VERSION=1.2.1 +VERSION=1.3.0 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1330,6 +1330,7 @@ case "$target" in *-*-hpux*) + EXTRADEFS="-DHPUX" test -n "$SHLD" || SHLD="ld -b" so="sl" ;; @@ -1342,16 +1343,23 @@ test -n "$SHLD" || SHLD="ld -Bforcearchive -Bshareable" so="so" ;; - *-*-freebsd2*) - EXTRALIBS="$EXTRALIBS -lxpg4" - test -n "$SHLD" || SHLD="ld -Bshareable" - so="so" - ;; + +# *-*-freebsd2*) +# EXTRALIBS="$EXTRALIBS -lxpg4" +# test -n "$SHLD" || SHLD="ld -Bshareable" +# so="so" +# ;; +# *-*-freebsd*) +# SHCFLAGS=-aout +# EXTRALIBS="$EXTRALIBS -lxpg4" +# SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS" +# test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared" +# so="so" +# ;; + *-*-freebsd*) - EXTRACFLAGS=-aout EXTRALIBS="$EXTRALIBS -lxpg4" - SHLDFLAGS="-L/usr/X11R6/aout $SHLDFLAGS" - test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared" + test -n "$SHLD" || SHLD="ld -Bshareable" so="so" ;; *-*-cygwin32*) @@ -1364,7 +1372,8 @@ *) test -n "$SHLD" || SHLD="unknown" ;; esac so="dll" - CYGWIN32=yes + CYGNUS=yes + program_suffix=.exe ;; *-dec-*) EXTRADEFS="-DDEC" @@ -1383,7 +1392,7 @@ esac echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6 -echo "configure:1387: checking for sqrt in -lm" >&5 +echo "configure:1396: checking for sqrt in -lm" >&5 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1391,7 +1400,7 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1430,7 +1439,7 @@ fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1434: checking for socket in -lsocket" >&5 +echo "configure:1443: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1438,7 +1447,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1477,7 +1486,7 @@ fi echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1481: checking for dlopen in -ldl" >&5 +echo "configure:1490: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1485,7 +1494,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1519,12 +1528,12 @@ for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1523: checking for $ac_func" >&5 +echo "configure:1532: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1569,7 +1578,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1573: checking for gethostbyname in -lnsl" >&5 +echo "configure:1582: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1577,7 +1586,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1619,7 +1628,7 @@ done echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1623: checking how to run the C preprocessor" >&5 +echo "configure:1632: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1634,13 +1643,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1651,13 +1660,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1684,7 +1693,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1688: checking for X" >&5 +echo "configure:1697: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1746,12 +1755,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1820,14 +1829,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1933,17 +1942,17 @@ case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1937: checking whether -R must be followed by a space" >&5 +echo "configure:1946: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -1959,14 +1968,14 @@ else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -1998,7 +2007,7 @@ # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:2002: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:2011: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2006,7 +2015,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2039,7 +2048,7 @@ if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:2043: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:2052: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2047,7 +2056,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2087,12 +2096,12 @@ # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:2091: checking for gethostbyname" >&5 +echo "configure:2100: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -2136,7 +2145,7 @@ if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2140: checking for gethostbyname in -lnsl" >&5 +echo "configure:2149: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2144,7 +2153,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2185,12 +2194,12 @@ # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:2189: checking for connect" >&5 +echo "configure:2198: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -2234,7 +2243,7 @@ if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:2238: checking for connect in -lsocket" >&5 +echo "configure:2247: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2242,7 +2251,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2277,12 +2286,12 @@ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:2281: checking for remove" >&5 +echo "configure:2290: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -2326,7 +2335,7 @@ if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:2330: checking for remove in -lposix" >&5 +echo "configure:2339: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2334,7 +2343,7 @@ ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2369,12 +2378,12 @@ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:2373: checking for shmat" >&5 +echo "configure:2382: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -2418,7 +2427,7 @@ if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:2422: checking for shmat in -lipc" >&5 +echo "configure:2431: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2426,7 +2435,7 @@ ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2470,7 +2479,7 @@ # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:2474: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:2483: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2478,7 +2487,7 @@ ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2530,7 +2539,7 @@ fi echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:2534: checking for XOpenDisplay in -lX11" >&5 +echo "configure:2543: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2538,7 +2547,7 @@ ac_save_LIBS="$LIBS" LIBS="-lX11 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2577,12 +2586,12 @@ fi echo $ac_n "checking X11 version 6""... $ac_c" 1>&6 -echo "configure:2581: checking X11 version 6" >&5 +echo "configure:2590: checking X11 version 6" >&5 if eval "test \"`echo '$''{'timidity_cv_x11_version_6'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -2592,7 +2601,7 @@ ; return 0; } EOF -if { (eval echo configure:2596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* timidity_cv_x11_version_6=yes else @@ -2612,7 +2621,7 @@ KEEPLIBS=$LIBS echo $ac_n "checking for XShapeCombineMask in -lXext""... $ac_c" 1>&6 -echo "configure:2616: checking for XShapeCombineMask in -lXext" >&5 +echo "configure:2625: checking for XShapeCombineMask in -lXext" >&5 ac_lib_var=`echo Xext'_'XShapeCombineMask | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2620,7 +2629,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXext $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2653,7 +2662,7 @@ fi echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:2657: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:2666: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2661,7 +2670,7 @@ ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2700,7 +2709,7 @@ fi echo $ac_n "checking for SmcOpenConnection in -lSM""... $ac_c" 1>&6 -echo "configure:2704: checking for SmcOpenConnection in -lSM" >&5 +echo "configure:2713: checking for SmcOpenConnection in -lSM" >&5 ac_lib_var=`echo SM'_'SmcOpenConnection | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2708,7 +2717,7 @@ ac_save_LIBS="$LIBS" LIBS="-lSM $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2741,7 +2750,7 @@ fi echo $ac_n "checking for XtVaAppInitialize in -lXt""... $ac_c" 1>&6 -echo "configure:2745: checking for XtVaAppInitialize in -lXt" >&5 +echo "configure:2754: checking for XtVaAppInitialize in -lXt" >&5 ac_lib_var=`echo Xt'_'XtVaAppInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2749,7 +2758,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2782,7 +2791,7 @@ fi echo $ac_n "checking for XmuInternAtom in -lXmu""... $ac_c" 1>&6 -echo "configure:2786: checking for XmuInternAtom in -lXmu" >&5 +echo "configure:2795: checking for XmuInternAtom in -lXmu" >&5 ac_lib_var=`echo Xmu'_'XmuInternAtom | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2790,7 +2799,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXmu $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2822,7 +2831,7 @@ fi echo $ac_n "checking for XawInitializeWidgetSet in -lXaw3d""... $ac_c" 1>&6 -echo "configure:2826: checking for XawInitializeWidgetSet in -lXaw3d" >&5 +echo "configure:2835: checking for XawInitializeWidgetSet in -lXaw3d" >&5 ac_lib_var=`echo Xaw3d'_'XawInitializeWidgetSet | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2830,7 +2839,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXaw3d $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2860,7 +2869,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for XawInitializeWidgetSet in -lXaw""... $ac_c" 1>&6 -echo "configure:2864: checking for XawInitializeWidgetSet in -lXaw" >&5 +echo "configure:2873: checking for XawInitializeWidgetSet in -lXaw" >&5 ac_lib_var=`echo Xaw'_'XawInitializeWidgetSet | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2868,7 +2877,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXaw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2903,7 +2912,7 @@ fi echo $ac_n "checking for XmCreateForm in -lXm""... $ac_c" 1>&6 -echo "configure:2907: checking for XmCreateForm in -lXm" >&5 +echo "configure:2916: checking for XmCreateForm in -lXm" >&5 ac_lib_var=`echo Xm'_'XmCreateForm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2911,7 +2920,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2952,12 +2961,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:2956: checking for $ac_hdr that defines DIR" >&5 +echo "configure:2965: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -2965,7 +2974,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -2990,7 +2999,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2994: checking for opendir in -ldir" >&5 +echo "configure:3003: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2998,7 +3007,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3031,7 +3040,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3035: checking for opendir in -lx" >&5 +echo "configure:3044: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3039,7 +3048,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3073,12 +3082,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3077: checking for ANSI C header files" >&5 +echo "configure:3086: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3086,7 +3095,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3103,7 +3112,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3121,7 +3130,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3142,7 +3151,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3153,7 +3162,7 @@ exit (0); } EOF -if { (eval echo configure:3157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -3177,12 +3186,12 @@ fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:3181: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:3190: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3198,7 +3207,7 @@ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:3202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -3218,21 +3227,21 @@ fi -for ac_hdr in fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h dlfcn.h glob.h getopt.h +for ac_hdr in fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h dlfcn.h glob.h getopt.h errno.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3226: checking for $ac_hdr" >&5 +echo "configure:3235: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3260,17 +3269,17 @@ ac_safe=`echo "string.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for string.h""... $ac_c" 1>&6 -echo "configure:3264: checking for string.h" >&5 +echo "configure:3273: checking for string.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3294,12 +3303,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3298: checking for working const" >&5 +echo "configure:3307: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3369,14 +3378,14 @@ fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3373: checking whether char is unsigned" >&5 +echo "configure:3382: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -3432,14 +3441,14 @@ fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3436: checking whether byte ordering is bigendian" >&5 +echo "configure:3445: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3450,11 +3459,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:3454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3465,7 +3474,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:3469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3485,7 +3494,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -3522,21 +3531,21 @@ fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3526: checking for inline" >&5 +echo "configure:3535: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3562,12 +3571,12 @@ esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3566: checking for off_t" >&5 +echo "configure:3575: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3595,12 +3604,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3599: checking for pid_t" >&5 +echo "configure:3608: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3628,12 +3637,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3632: checking for size_t" >&5 +echo "configure:3641: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3661,12 +3670,12 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3665: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3674: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3675,7 +3684,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3697,19 +3706,19 @@ echo $ac_n "checking volatile declaration""... $ac_c" 1>&6 -echo "configure:3701: checking volatile declaration" >&5 +echo "configure:3710: checking volatile declaration" >&5 if eval "test \"`echo '$''{'timidity_cv_type_volatile'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* timidity_cv_type_volatile=yes else @@ -3727,12 +3736,12 @@ fi echo $ac_n "checking union semun declaration""... $ac_c" 1>&6 -echo "configure:3731: checking union semun declaration" >&5 +echo "configure:3740: checking union semun declaration" >&5 if eval "test \"`echo '$''{'timidity_cv_type_union_semun'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3741,7 +3750,7 @@ union semun x ; return 0; } EOF -if { (eval echo configure:3745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* timidity_cv_type_union_semun=yes else @@ -3760,13 +3769,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3764: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3773: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -3784,7 +3793,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -3806,7 +3815,7 @@ fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:3810: checking for 8-bit clean memcmp" >&5 +echo "configure:3819: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3814,7 +3823,7 @@ ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -3845,17 +3854,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3849: checking for $ac_hdr" >&5 +echo "configure:3858: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3884,12 +3893,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3888: checking for $ac_func" >&5 +echo "configure:3897: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3937,7 +3946,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3941: checking for working mmap" >&5 +echo "configure:3950: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3945,7 +3954,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4108,7 +4117,7 @@ fi echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:4112: checking whether setvbuf arguments are reversed" >&5 +echo "configure:4121: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4116,7 +4125,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < /* If setvbuf has the reversed format, exit 0. */ @@ -4130,7 +4139,7 @@ exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:4134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else @@ -4154,12 +4163,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:4158: checking return type of signal handlers" >&5 +echo "configure:4167: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4176,7 +4185,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:4180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -4195,12 +4204,12 @@ echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:4199: checking for vprintf" >&5 +echo "configure:4208: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -4247,12 +4256,12 @@ if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:4251: checking for _doprnt" >&5 +echo "configure:4260: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -4299,15 +4308,15 @@ fi -for ac_func in gettimeofday select socket strdup strstr vsnprintf snprintf usleep strncasecmp strerror +for ac_func in gettimeofday select socket strdup strstr vsnprintf snprintf sleep usleep strncasecmp strerror getopt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4306: checking for $ac_func" >&5 +echo "configure:4315: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4355,66 +4364,61 @@ done -# check getopt -echo $ac_n "checking for getopt""... $ac_c" 1>&6 -echo "configure:4361: checking for getopt" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getopt'+set}'`\" = set"; then + +if test "x$CYGNUS" = xyes; then + echo $ac_n "checking for opendir""... $ac_c" 1>&6 +echo "configure:4371: checking for opendir" >&5 +if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char getopt(); +char opendir(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_getopt) || defined (__stub___getopt) +#if defined (__stub_opendir) || defined (__stub___opendir) choke me #else -getopt(); +opendir(); #endif ; return 0; } EOF -if { (eval echo configure:4389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_func_getopt=yes" + eval "ac_cv_func_opendir=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_getopt=no" + eval "ac_cv_func_opendir=no" fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_func_'getopt`\" = yes"; then +if eval "test \"`echo '$ac_cv_func_'opendir`\" = yes"; then echo "$ac_t""yes" 1>&6 - has_getopt=yes + : else echo "$ac_t""no" 1>&6 -has_getopt=no + EXTRADEFS="$EXTRADEFS -D__W32READDIR__" + W32READDIR=yes fi - - -if test $has_getopt = no; then - NEED_GETOPT_TRUE= - NEED_GETOPT_FALSE='#' -else - NEED_GETOPT_TRUE='#' - NEED_GETOPT_FALSE= fi + # Check whether --with-tcl-includes or --without-tcl-includes was given. if test "${with_tcl_includes+set}" = set; then withval="$with_tcl_includes" @@ -4474,7 +4478,7 @@ echo $ac_n "checking whether to enable audio""... $ac_c" 1>&6 -echo "configure:4478: checking whether to enable audio" >&5 +echo "configure:4482: checking whether to enable audio" >&5 # Check whether --enable-audio or --disable-audio was given. if test "${enable_audio+set}" = set; then enableval="$enable_audio" @@ -4520,7 +4524,7 @@ echo $ac_n "checking for ALSA CFLAGS""... $ac_c" 1>&6 -echo "configure:4524: checking for ALSA CFLAGS" >&5 +echo "configure:4528: checking for ALSA CFLAGS" >&5 if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" @@ -4528,7 +4532,7 @@ echo "$ac_t""$ALSA_CFLAGS" 1>&6 echo $ac_n "checking for ALSA LDFLAGS""... $ac_c" 1>&6 -echo "configure:4532: checking for ALSA LDFLAGS" >&5 +echo "configure:4536: checking for ALSA LDFLAGS" >&5 if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LIBS="-L$alsa_prefix" @@ -4540,7 +4544,7 @@ min_alsa_version=0.1.1 echo $ac_n "checking for libasound headers version >= $min_alsa_version""... $ac_c" 1>&6 -echo "configure:4544: checking for libasound headers version >= $min_alsa_version" >&5 +echo "configure:4548: checking for libasound headers version >= $min_alsa_version" >&5 no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` @@ -4550,7 +4554,7 @@ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` cat > conftest.$ac_ext < @@ -4591,7 +4595,7 @@ ; return 0; } EOF -if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""found." 1>&6 have_alsa=yes @@ -4605,7 +4609,7 @@ rm -f conftest* echo $ac_n "checking for snd_cards in -lasound""... $ac_c" 1>&6 -echo "configure:4609: checking for snd_cards in -lasound" >&5 +echo "configure:4613: checking for snd_cards in -lasound" >&5 ac_lib_var=`echo asound'_'snd_cards | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4613,7 +4617,7 @@ ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4673,7 +4677,7 @@ echo "$ac_t""yes bsdi" 1>&6 ;; *-*-hpux*) - EXTRADEFS="$EXTRADEFS -DHPUX -DAU_HPUX" + EXTRADEFS="$EXTRADEFS -DAU_HPUX" SYSEXTRAS="$SYSEXTRAS hpux_d_a.c hpux_a.c" if test -d /opt/audio/include; then CPPFLAGS="$CPPFLAGS -I/opt/audio/include" @@ -4731,7 +4735,8 @@ *-*-cygwin32*) EXTRADEFS="$EXTRADEFS -DAU_WIN32" SYSEXTRAS="$SYSEXTRAS win_a.c" - echo "$ac_t""yes cygwin32" 1>&6 + EXTRALIBS="$EXTRALIBS -lwinmm" + echo "$ac_t""yes cygnus" 1>&6 ;; *) EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV" @@ -4759,18 +4764,18 @@ *) NEEDDLOPEN=no;; esac -case "$CC " in "gcc "*) SHCFLAGS="-fPIC";; esac +case "$CC " in "gcc "*) SHCFLAGS="$SHCFLAGS -fPIC";; esac case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac if test "$NEEDDLOPEN" = "yes"; then have_dl=no echo $ac_n "checking for LoadLibraryExA""... $ac_c" 1>&6 -echo "configure:4769: checking for LoadLibraryExA" >&5 +echo "configure:4774: checking for LoadLibraryExA" >&5 if eval "test \"`echo '$''{'ac_cv_func_LoadLibraryExA'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_LoadLibraryExA=yes" else @@ -4814,12 +4819,12 @@ if test "$have_dl" = "no"; then echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4818: checking for shl_load" >&5 +echo "configure:4823: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -4867,12 +4872,12 @@ fi if test "$have_dl" = "no"; then echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4871: checking for dlopen" >&5 +echo "configure:4876: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4917,12 +4922,12 @@ fi if test "$have_dl" = "no"; then echo $ac_n "checking for dld_init""... $ac_c" 1>&6 -echo "configure:4921: checking for dld_init" >&5 +echo "configure:4926: checking for dld_init" >&5 if eval "test \"`echo '$''{'ac_cv_func_dld_init'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dld_init=yes" else @@ -4967,7 +4972,7 @@ fi if test "$have_dl" = "no"; then echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:4971: checking for dld_init in -ldld" >&5 +echo "configure:4976: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4975,7 +4980,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5009,13 +5014,13 @@ fi echo $ac_n "checking dynamic link method""... $ac_c" 1>&6 -echo "configure:5013: checking dynamic link method" >&5 +echo "configure:5018: checking dynamic link method" >&5 case "$have_dl" in dlopen) echo "$ac_t""use dl_dlopen.c" 1>&6 SYSEXTRAS="$SYSEXTRAS dl_dlopen.c" echo $ac_n "checking whether your dlsym() needs a leading underscore""... $ac_c" 1>&6 -echo "configure:5019: checking whether your dlsym() needs a leading underscore" >&5 +echo "configure:5024: checking whether your dlsym() needs a leading underscore" >&5 if eval "test \"`echo '$''{'timidity_cv_func_dlsym_underscore'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5163,17 +5168,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5167: checking for $ac_hdr" >&5 +echo "configure:5172: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5200,7 +5205,7 @@ done echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:5204: checking for initscr in -lncurses" >&5 +echo "configure:5209: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5208,7 +5213,7 @@ ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5298,7 +5303,7 @@ enableval="$enable_slang" case "x$enable_slang" in xyes|xdynamic) KEEPLIBS=$LIBS echo $ac_n "checking for SLang_init_tty in -lslang""... $ac_c" 1>&6 -echo "configure:5302: checking for SLang_init_tty in -lslang" >&5 +echo "configure:5307: checking for SLang_init_tty in -lslang" >&5 ac_lib_var=`echo slang'_'SLang_init_tty | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5306,7 +5311,7 @@ ac_save_LIBS="$LIBS" LIBS="-lslang $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5370,7 +5375,7 @@ dynamic_targets="$dynamic_targets interface_s.\$(so)" s_so_libs="-lslang" echo $ac_n "checking for initscr in -ltermcap""... $ac_c" 1>&6 -echo "configure:5374: checking for initscr in -ltermcap" >&5 +echo "configure:5379: checking for initscr in -ltermcap" >&5 ac_lib_var=`echo termcap'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5378,7 +5383,7 @@ ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5507,7 +5512,7 @@ tk_lib= for l in tcl tcl8.0jp tcl7.6jp tcl80jp tcl76jp tcl8.0 tcl7.6 tcl80 tcl76; do case "x$tcl_lib" in x) echo $ac_n "checking for Tcl_Init in -l$l""... $ac_c" 1>&6 -echo "configure:5511: checking for Tcl_Init in -l$l" >&5 +echo "configure:5516: checking for Tcl_Init in -l$l" >&5 ac_lib_var=`echo $l'_'Tcl_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5515,7 +5520,7 @@ ac_save_LIBS="$LIBS" LIBS="-l$l $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5550,7 +5555,7 @@ LIBS="$LIBS $tcl_lib" for l in tk tk8.0jp tk4.2jp tk80jp tk42jp tk8.0 tk4.2 tk80 tk42; do case "x$tk_lib" in x) echo $ac_n "checking for Tk_Init in -l$l""... $ac_c" 1>&6 -echo "configure:5554: checking for Tk_Init in -l$l" >&5 +echo "configure:5559: checking for Tk_Init in -l$l" >&5 ac_lib_var=`echo $l'_'Tk_Init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5558,7 +5563,7 @@ ac_save_LIBS="$LIBS" LIBS="-l$l $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5930,7 +5935,7 @@ # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5934: checking for $ac_word" >&5 +echo "configure:5939: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5961,7 +5966,7 @@ min_gtk_version=1.1.3 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:5965: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:5970: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -5984,7 +5989,7 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -6050,7 +6055,7 @@ } EOF -if { (eval echo configure:6054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -6084,7 +6089,7 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -6094,7 +6099,7 @@ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:6098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" @@ -6173,17 +6178,17 @@ fi ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6 -echo "configure:6177: checking for X11/xpm.h" >&5 +echo "configure:6182: checking for X11/xpm.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6206,7 +6211,7 @@ fi echo $ac_n "checking for XpmCreatePixmapFromData in -lXpm""... $ac_c" 1>&6 -echo "configure:6210: checking for XpmCreatePixmapFromData in -lXpm" >&5 +echo "configure:6215: checking for XpmCreatePixmapFromData in -lXpm" >&5 ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromData | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6214,7 +6219,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXpm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6297,7 +6302,7 @@ LDFLAGS="$LDFLAGS $offix_lib_dir" LIBS="$LIBS $lib_xmu_opt $lib_xt_opt $lib_xprelibs_opt $lib_xext_opt -lX11" echo $ac_n "checking for DndInitialize in -lDnd""... $ac_c" 1>&6 -echo "configure:6301: checking for DndInitialize in -lDnd" >&5 +echo "configure:6306: checking for DndInitialize in -lDnd" >&5 ac_lib_var=`echo Dnd'_'DndInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6305,7 +6310,7 @@ ac_save_LIBS="$LIBS" LIBS="-lDnd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6416,13 +6421,23 @@ -if test "x$CYGWIN32" = "xyes"; then - CYGWIN32_TRUE= - CYGWIN32_FALSE='#' +if test "x$CYGNUS" = xyes; then + CYGNUS_TRUE= + CYGNUS_FALSE='#' +else + CYGNUS_TRUE='#' + CYGNUS_FALSE= +fi + + +if test "x$W32READDIR" = "xyes"; then + W32READDIR_TRUE= + W32READDIR_FALSE='#' else - CYGWIN32_TRUE='#' - CYGWIN32_FALSE= + W32READDIR_TRUE='#' + W32READDIR_FALSE= fi + rm -f wordtmp >/dev/null 2>&1 val='' for f in $LDFLAGS; do @@ -6495,6 +6510,7 @@ + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -6675,8 +6691,6 @@ s%@X_LIBS@%$X_LIBS%g s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@LIBOBJS@%$LIBOBJS%g -s%@NEED_GETOPT_TRUE@%$NEED_GETOPT_TRUE%g -s%@NEED_GETOPT_FALSE@%$NEED_GETOPT_FALSE%g s%@ALSA_CFLAGS@%$ALSA_CFLAGS%g s%@ALSA_LIBS@%$ALSA_LIBS%g s%@NEEDDLOPEN_TRUE@%$NEEDDLOPEN_TRUE%g @@ -6724,8 +6738,10 @@ s%@ENABLE_SOUND_SPEC_FALSE@%$ENABLE_SOUND_SPEC_FALSE%g s%@ENABLE_WRD_TRUE@%$ENABLE_WRD_TRUE%g s%@ENABLE_WRD_FALSE@%$ENABLE_WRD_FALSE%g -s%@CYGWIN32_TRUE@%$CYGWIN32_TRUE%g -s%@CYGWIN32_FALSE@%$CYGWIN32_FALSE%g +s%@CYGNUS_TRUE@%$CYGNUS_TRUE%g +s%@CYGNUS_FALSE@%$CYGNUS_FALSE%g +s%@W32READDIR_TRUE@%$W32READDIR_TRUE%g +s%@W32READDIR_FALSE@%$W32READDIR_FALSE%g s%@SYSEXTRAS@%$SYSEXTRAS%g s%@EXTRALIBS@%$EXTRALIBS%g s%@EXTRADEFS@%$EXTRADEFS%g diff -ruN TiMidity++-1.2.1/configure.in TiMidity++-1.3.0/configure.in --- TiMidity++-1.2.1/configure.in Mon Jan 25 21:19:14 1999 +++ TiMidity++-1.3.0/configure.in Tue Feb 2 18:13:13 1999 @@ -32,15 +32,15 @@ dnl ac_compile: ${CC-cc} -c $CFLAGS $CPPFLAGS dnl ac_link: ${CC-cc} -o * $CFLAGS $CPPFLAGS $LDFLAGS *.c $LIBS dnl EXTRACFLAGS - Extra flags to compile. Adds to CFLAGS. -dnl EXTRADEFS - Extra define macros. (AC_SUBST: Adds to CFLAGS) -dnl EXTRALIBS - Extra libraries (AC_SUBST: Adds to LIBS) +dnl EXTRADEFS - Extra define macros. Adds to CPPFLAGS. +dnl EXTRALIBS - Extra libraries Adds to LIBS. dnl SYSEXTRAS - Additional source codes to compile. dnl lib_*_opt - Optional libraries. Adds to LIBS. dnl LIBRARY_PATH dnl - add to -L LDFLAGS dnl C_INCLUDE_PATH dnl - add to -I CPPFLAGS -dnl CYGWIN32 - `yes' if cygnus win32 environment. +dnl CYGNUS - `yes' if cygnus windows environment. dnl WISH - wish dnl LN_S - ln -s dnl tcltk_dep - make dependencies for tcl/tk interface @@ -54,7 +54,7 @@ AC_INIT(timidity/timidity.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(TiMidity++, 1.2.1, no-define) +AM_INIT_AUTOMAKE(TiMidity++, 1.3.0, no-define) dnl To use CONTAINS() macro (See acinclude.m4) CONTAINS_INIT @@ -120,6 +120,7 @@ dnl Target dependent case "$target" in *-*-hpux*) + EXTRADEFS="-DHPUX" test -n "$SHLD" || SHLD="ld -b" so="sl" ;; @@ -133,16 +134,23 @@ test -n "$SHLD" || SHLD="ld -Bforcearchive -Bshareable" so="so" ;; - *-*-freebsd2*) - EXTRALIBS="$EXTRALIBS -lxpg4" - test -n "$SHLD" || SHLD="ld -Bshareable" - so="so" - ;; + +# *-*-freebsd2*) +# EXTRALIBS="$EXTRALIBS -lxpg4" +# test -n "$SHLD" || SHLD="ld -Bshareable" +# so="so" +# ;; +# *-*-freebsd*) +# SHCFLAGS=-aout +# EXTRALIBS="$EXTRALIBS -lxpg4" +# SHLDFLAGS="-L/usr/X11R6/lib/aout $SHLDFLAGS" +# test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared" +# so="so" +# ;; + *-*-freebsd*) - EXTRACFLAGS=-aout EXTRALIBS="$EXTRALIBS -lxpg4" - SHLDFLAGS="-L/usr/X11R6/aout $SHLDFLAGS" - test -n "$SHLD" || SHLD="env OBJFORMAT=aout ld -shared" + test -n "$SHLD" || SHLD="ld -Bshareable" so="so" ;; *-*-cygwin32*) @@ -155,7 +163,8 @@ *) test -n "$SHLD" || SHLD="unknown" ;; esac so="dll" - CYGWIN32=yes + CYGNUS=yes + program_suffix=.exe ;; *-dec-*) EXTRADEFS="-DDEC" @@ -230,7 +239,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h dlfcn.h glob.h getopt.h) +AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h dlfcn.h glob.h getopt.h errno.h) AC_CHECK_HEADER(string.h,, [ EXTRADEFS="$EXTRADEFS -DNO_STRING_H " ]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -268,11 +277,16 @@ AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_FUNC_VPRINTF -AC_CHECK_FUNCS(gettimeofday select socket strdup strstr vsnprintf snprintf usleep strncasecmp strerror) +AC_CHECK_FUNCS(gettimeofday select socket strdup strstr vsnprintf snprintf sleep usleep strncasecmp strerror getopt) + + +dnl checking on cygnus +if test "x$CYGNUS" = xyes; then + AC_CHECK_FUNC(opendir,, + [ EXTRADEFS="$EXTRADEFS -D__W32READDIR__" + W32READDIR=yes ]) +fi -# check getopt -AC_CHECK_FUNC(getopt,has_getopt=yes,has_getopt=no) -AM_CONDITIONAL(NEED_GETOPT, test $has_getopt = no) dnl tcltk path AC_ARG_WITH(tcl-includes, @@ -348,7 +362,7 @@ AC_MSG_RESULT(yes bsdi) ;; *-*-hpux*) - EXTRADEFS="$EXTRADEFS -DHPUX -DAU_HPUX" + EXTRADEFS="$EXTRADEFS -DAU_HPUX" SYSEXTRAS="$SYSEXTRAS hpux_d_a.c hpux_a.c" if test -d /opt/audio/include; then CPPFLAGS="$CPPFLAGS -I/opt/audio/include" @@ -406,7 +420,8 @@ *-*-cygwin32*) EXTRADEFS="$EXTRADEFS -DAU_WIN32" SYSEXTRAS="$SYSEXTRAS win_a.c" - AC_MSG_RESULT(yes cygwin32) + EXTRALIBS="$EXTRALIBS -lwinmm" + AC_MSG_RESULT(yes cygnus) ;; *) EXTRADEFS="$EXTRADEFS -DAU_NONE -DAU_AUDRIV" @@ -434,7 +449,7 @@ esac dnl check -fpic option for gcc -case "$CC " in "gcc "*) SHCFLAGS="-fPIC";; esac +case "$CC " in "gcc "*) SHCFLAGS="$SHCFLAGS -fPIC";; esac case "x$enable_ump" in xyes|xdynamic) EXTRACFLAGS="$EXTRACFLAGS -DXP_UNIX $SHCFLAGS";; esac if test "$NEEDDLOPEN" = "yes"; then @@ -776,7 +791,9 @@ dnl It comes from -AM_CONDITIONAL(CYGWIN32, test "x$CYGWIN32" = "xyes") +AM_CONDITIONAL(CYGNUS, test "x$CYGNUS" = xyes) +AM_CONDITIONAL(W32READDIR, test "x$W32READDIR" = "xyes") + SET_UNIQ_WORDS(LDFLAGS,$LDFLAGS) SET_UNIQ_WORDS(SHLDFLAGS,$SHLDFLAGS) SET_UNIQ_WORDS(CFLAGS,$EXTRACFLAGS $CFLAGS) @@ -801,6 +818,7 @@ AC_SUBST(LN_S) AC_SUBST(WISH) AC_SUBST(tcltk_dep) +AC_SUBST(program_transform_name) AC_OUTPUT([ Makefile diff -ruN TiMidity++-1.2.1/doc/C/Makefile.in TiMidity++-1.3.0/doc/C/Makefile.in --- TiMidity++-1.2.1/doc/C/Makefile.in Mon Jan 25 21:30:43 1999 +++ TiMidity++-1.3.0/doc/C/Makefile.in Wed Feb 3 07:28:10 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/doc/Makefile.in TiMidity++-1.3.0/doc/Makefile.in --- TiMidity++-1.2.1/doc/Makefile.in Mon Jan 25 21:30:42 1999 +++ TiMidity++-1.3.0/doc/Makefile.in Wed Feb 3 07:28:09 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ SUBDIRS = C ja_JP.ujis diff -ruN TiMidity++-1.2.1/doc/ja_JP.ujis/Makefile.in TiMidity++-1.3.0/doc/ja_JP.ujis/Makefile.in --- TiMidity++-1.2.1/doc/ja_JP.ujis/Makefile.in Mon Jan 25 21:30:45 1999 +++ TiMidity++-1.3.0/doc/ja_JP.ujis/Makefile.in Wed Feb 3 07:28:12 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/doc/ja_JP.ujis/timidity.cfg.5 TiMidity++-1.3.0/doc/ja_JP.ujis/timidity.cfg.5 --- TiMidity++-1.2.1/doc/ja_JP.ujis/timidity.cfg.5 Wed Dec 2 22:05:55 1998 +++ TiMidity++-1.3.0/doc/ja_JP.ujis/timidity.cfg.5 Fri Jan 29 13:52:47 1999 @@ -32,7 +32,7 @@ .BI dir " directory" \fIdirectory\fP \fB\-L\fP .br - +TiMidity++ : .br diff -ruN TiMidity++-1.2.1/interface/Makefile.am TiMidity++-1.3.0/interface/Makefile.am --- TiMidity++-1.2.1/interface/Makefile.am Mon Jan 25 16:56:14 1999 +++ TiMidity++-1.3.0/interface/Makefile.am Mon Feb 1 12:29:37 1999 @@ -136,6 +136,10 @@ x_mag.o endif +if CYGNUS +WRD_WINCON_OBJS = wrdt_wincon.o +endif + if NEEDDLOPEN DYNAMIC_OBJS = dynamic_c.o endif @@ -156,6 +160,7 @@ $(XSKIN_OBJS) \ $(GTK_OBJS) \ $(WRD_OBJS) \ + $(WRD_WINCON_OBJS) \ $(DYNAMIC_OBJS) \ $(SOUND_SPEC_OBJS) diff -ruN TiMidity++-1.2.1/interface/Makefile.in TiMidity++-1.3.0/interface/Makefile.in --- TiMidity++-1.2.1/interface/Makefile.in Mon Jan 25 21:30:27 1999 +++ TiMidity++-1.3.0/interface/Makefile.in Wed Feb 3 07:27:48 1999 @@ -101,6 +101,7 @@ VERSION = @VERSION@ WISH = @WISH@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ @@ -202,6 +203,8 @@ @ENABLE_WRD_TRUE@ VTPrsTbl.o \ @ENABLE_WRD_TRUE@ x_mag.o +@CYGNUS_TRUE@WRD_WINCON_OBJS = wrdt_wincon.o + @NEEDDLOPEN_TRUE@DYNAMIC_OBJS = dynamic_c.o @ENABLE_SOUND_SPEC_TRUE@SOUND_SPEC_OBJS = \ @@ -218,6 +221,7 @@ $(XSKIN_OBJS) \ $(GTK_OBJS) \ $(WRD_OBJS) \ + $(WRD_WINCON_OBJS) \ $(DYNAMIC_OBJS) \ $(SOUND_SPEC_OBJS) @@ -417,11 +421,61 @@ (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ done +VTPrsTbl.o: VTPrsTbl.c VTparse.h dumb_c.o: dumb_c.c ../config.h ../timidity/timidity.h \ ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ ../timidity/output.h ../timidity/controls.h \ ../timidity/instrum.h ../timidity/playmidi.h \ ../timidity/readmidi.h +emacs_c.o: emacs_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/output.h ../timidity/controls.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/miditrace.h +motif_c.o: motif_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/output.h \ + ../timidity/controls.h motif.h ../timidity/miditrace.h +motif_i.o: motif_i.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/output.h ../timidity/controls.h motif.h \ + motif_bitmaps/back.xbm motif_bitmaps/next.xbm \ + motif_bitmaps/prev.xbm motif_bitmaps/restart.xbm \ + motif_bitmaps/fwd.xbm motif_bitmaps/pause.xbm \ + motif_bitmaps/quit.xbm motif_bitmaps/timidity.xbm +motif_p.o: motif_p.c ../config.h ../timidity/timidity.h \ + ../timidity/controls.h motif.h +ncurs_c.o: ncurs_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/output.h \ + ../timidity/controls.h ../timidity/miditrace.h ../utils/timer.h \ + ../utils/bitset.h ../libarc/arc.h ../utils/memb.h \ + ../timidity/mid-j.defs +slang_c.o: slang_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/output.h \ + ../timidity/controls.h ../timidity/miditrace.h ../utils/timer.h +soundspec.o: soundspec.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/output.h ../timidity/controls.h soundspec.h \ + ../utils/fft.h ../timidity/miditrace.h +tk_c.o: tk_c.c ../config.h ../timidity/timidity.h ../timidity/common.h \ + ../libarc/url.h ../utils/mblock.h ../timidity/instrum.h \ + ../timidity/playmidi.h ../timidity/readmidi.h \ + ../timidity/output.h ../timidity/controls.h \ + ../timidity/miditrace.h +vt100.o: vt100.c ../config.h ../timidity/timidity.h vt100.h +vt100_c.o: vt100_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/output.h \ + ../timidity/controls.h ../timidity/miditrace.h vt100.h \ + ../utils/timer.h ../utils/bitset.h wrdt_dumb.o: wrdt_dumb.c ../config.h ../timidity/timidity.h \ ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ ../timidity/instrum.h ../timidity/playmidi.h \ @@ -430,6 +484,47 @@ ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ ../timidity/instrum.h ../timidity/playmidi.h \ ../timidity/readmidi.h ../timidity/controls.h ../timidity/wrd.h +wrdt_x.o: wrdt_x.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/controls.h ../timidity/wrd.h \ + x_wrdwindow.h x_mag.h +x_mag.o: x_mag.c ../config.h ../timidity/timidity.h ../timidity/common.h \ + ../libarc/url.h ../utils/mblock.h x_mag.h \ + ../timidity/controls.h ../timidity/wrd.h +x_wrdwindow.o: x_wrdwindow.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h x_mag.h \ + x_wrdwindow.h VTparse.h ../timidity/wrd.h \ + ../timidity/controls.h +xaw_c.o: xaw_c.c ../config.h ../timidity/timidity.h ../timidity/common.h \ + ../libarc/url.h ../utils/mblock.h ../timidity/instrum.h \ + ../timidity/playmidi.h ../timidity/readmidi.h \ + ../timidity/output.h ../timidity/controls.h \ + ../timidity/miditrace.h ../utils/timer.h xaw.h +xaw_i.o: xaw_i.c ../config.h xaw.h check.xbm ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/controls.h +xskin_c.o: xskin_c.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/readmidi.h ../timidity/output.h \ + ../timidity/controls.h ../timidity/miditrace.h xskin.h +xskin_i.o: xskin_i.c xskin.h ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/output.h ../timidity/controls.h \ + ../timidity/miditrace.h +xskin_loadBMP.o: xskin_loadBMP.c ../config.h ../timidity/timidity.h \ + ../timidity/common.h ../libarc/url.h ../utils/mblock.h \ + ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/controls.h ../timidity/output.h ../libarc/arc.h \ + ../utils/memb.h +xskin_spectrum.o: xskin_spectrum.c xskin.h ../config.h \ + ../timidity/timidity.h ../timidity/common.h ../libarc/url.h \ + ../utils/mblock.h ../timidity/instrum.h ../timidity/playmidi.h \ + ../timidity/output.h ../timidity/controls.h \ + ../timidity/miditrace.h info: info-recursive dvi: dvi-recursive diff -ruN TiMidity++-1.2.1/interface/bitmaps/Makefile.in TiMidity++-1.3.0/interface/bitmaps/Makefile.in --- TiMidity++-1.2.1/interface/bitmaps/Makefile.in Mon Jan 25 21:30:33 1999 +++ TiMidity++-1.3.0/interface/bitmaps/Makefile.in Wed Feb 3 07:27:55 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/interface/browser.tcl TiMidity++-1.3.0/interface/browser.tcl --- TiMidity++-1.2.1/interface/browser.tcl Mon Nov 30 17:55:36 1998 +++ TiMidity++-1.3.0/interface/browser.tcl Wed Feb 3 05:11:55 1999 @@ -260,7 +260,7 @@ set patbase "" } - foreach i [glob -nocomplain $patbase$filter] { + foreach i [lsort -dictionary [glob -nocomplain $patbase$filter]] { if ![regexp "^.*/(\[^/\]+)$" $i full base] { set base $i } @@ -271,7 +271,7 @@ set prev ".." $dir insert end $prev - foreach i [lsort [glob -nocomplain $patbase$lookall $patbase$filter]] { + foreach i [lsort -dictionary [glob -nocomplain $patbase$lookall $patbase$filter]] { if {$i == $prev} {continue} if ![regexp "^.*/(\[^/\]+)$" $i full base] { set base $i diff -ruN TiMidity++-1.2.1/interface/gtk_p.c TiMidity++-1.3.0/interface/gtk_p.c --- TiMidity++-1.2.1/interface/gtk_p.c Wed Jan 20 16:09:17 1999 +++ TiMidity++-1.3.0/interface/gtk_p.c Tue Feb 2 15:50:16 1999 @@ -39,6 +39,12 @@ #ifdef SOLARIS #include #endif +#ifndef NO_STRING_H +#include +#else +#include +#endif + #include "timidity.h" #include "controls.h" @@ -63,7 +69,7 @@ { fprintf(stderr,"CONNECTION PROBLEM WITH Gtk+ PROCESS IN %s BECAUSE:%s\n", st, - sys_errlist[errno]); + strerror(errno)); exit(1); } diff -ruN TiMidity++-1.2.1/interface/mac_c.h TiMidity++-1.3.0/interface/mac_c.h --- TiMidity++-1.2.1/interface/mac_c.h Mon Nov 30 19:09:28 1998 +++ TiMidity++-1.3.0/interface/mac_c.h Tue Feb 2 16:05:25 1999 @@ -54,4 +54,12 @@ MW_SKIN_FILENAME }; +#define SKIN_ACTION_PREV() {mac_rc=RC_PREVIOUS;mac_HandleControl();} +#define SKIN_ACTION_PLAY() {mac_rc=RC_CONTINUE;mac_HandleControl();} +#define SKIN_ACTION_PAUSE() {mac_rc=RC_TOGGLE_PAUSE;mac_HandleControl();} +#define SKIN_ACTION_STOP() {mac_rc=RC_QUIT;mac_HandleControl();} +#define SKIN_ACTION_NEXT() {mac_rc=RC_NEXT;mac_HandleControl();} +#define SKIN_ACTION_EJECT() +#define SKIN_ACTION_EXIT() + #endif //MAC_C_H diff -ruN TiMidity++-1.2.1/interface/mac_mag.c TiMidity++-1.3.0/interface/mac_mag.c --- TiMidity++-1.2.1/interface/mac_mag.c Mon Nov 30 19:10:33 1998 +++ TiMidity++-1.3.0/interface/mac_mag.c Tue Feb 2 16:05:25 1999 @@ -51,7 +51,7 @@ char filename[256]; int width, hight; long header_pos; - uint8 flag[640]; + uint8 flag[1280]; //for safty uint8 *flagA_work, *flagB_work; int flagA_pos, flagB_pos, pixel_pos; Ptr bitMap; diff -ruN TiMidity++-1.2.1/interface/mac_wrdwindow.c TiMidity++-1.3.0/interface/mac_wrdwindow.c --- TiMidity++-1.2.1/interface/mac_wrdwindow.c Mon Nov 30 19:11:28 1998 +++ TiMidity++-1.3.0/interface/mac_wrdwindow.c Tue Feb 2 16:05:26 1999 @@ -98,7 +98,7 @@ } } -static void BlockMoveData_gmode(const void* srcPtr, void * destPtr, +static pascal void BlockMoveData_gmode(const void* srcPtr, void * destPtr, Size byteCount) { int i, tmp; @@ -121,7 +121,7 @@ } #if __MC68K__ -static void mymemmove(const void* srcPtr, void * destPtr,Size byteCount) +static pascal void mymemmove(const void* srcPtr, void * destPtr,Size byteCount) { memmove(destPtr, srcPtr, byteCount); } @@ -194,7 +194,7 @@ switch( mode ){ case 0://srcCopy { - void (*func)(const void* srcPtr, void * destPtr,Size byteCount); + pascal void (*func)(const void* srcPtr, void * destPtr,Size byteCount); if( gmode==0xF ) func=BlockMoveData; else func= BlockMoveData_gmode; if( srcRect.top >= dstRect.top ){ diff -ruN TiMidity++-1.2.1/interface/motif_bitmaps/Makefile.in TiMidity++-1.3.0/interface/motif_bitmaps/Makefile.in --- TiMidity++-1.2.1/interface/motif_bitmaps/Makefile.in Mon Jan 25 21:30:32 1999 +++ TiMidity++-1.3.0/interface/motif_bitmaps/Makefile.in Wed Feb 3 07:27:53 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/interface/motif_p.c TiMidity++-1.3.0/interface/motif_p.c --- TiMidity++-1.2.1/interface/motif_p.c Mon Nov 30 17:57:14 1998 +++ TiMidity++-1.3.0/interface/motif_p.c Wed Feb 3 05:22:24 1999 @@ -35,6 +35,11 @@ #ifdef SOLARIS #include #endif +#ifndef NO_STRING_H +#include +#else +#include +#endif #include "timidity.h" #include "controls.h" @@ -58,7 +63,7 @@ { fprintf(stderr,"CONNECTION PROBLEM WITH MOTIF PROCESS IN %s BECAUSE:%s" NLS, - st, sys_errlist[errno]); + st, strerror(errno)); exit(1); } diff -ruN TiMidity++-1.2.1/interface/pixmaps/Makefile.in TiMidity++-1.3.0/interface/pixmaps/Makefile.in --- TiMidity++-1.2.1/interface/pixmaps/Makefile.in Mon Jan 25 21:30:35 1999 +++ TiMidity++-1.3.0/interface/pixmaps/Makefile.in Wed Feb 3 07:27:57 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ diff -ruN TiMidity++-1.2.1/interface/tk_c.c TiMidity++-1.3.0/interface/tk_c.c --- TiMidity++-1.2.1/interface/tk_c.c Thu Jan 14 17:21:13 1999 +++ TiMidity++-1.3.0/interface/tk_c.c Tue Feb 2 15:51:53 1999 @@ -724,7 +724,7 @@ { fprintf(stderr,"CONNECTION PROBLEM WITH TCL/TK PROCESS IN %s BECAUSE:%s\n", st, - sys_errlist[errno]); + strerror(errno)); exit(1); } diff -ruN TiMidity++-1.2.1/interface/tkmidity.ptcl TiMidity++-1.3.0/interface/tkmidity.ptcl --- TiMidity++-1.2.1/interface/tkmidity.ptcl Mon Dec 14 14:36:50 1998 +++ TiMidity++-1.3.0/interface/tkmidity.ptcl Wed Feb 3 05:11:55 1999 @@ -39,9 +39,9 @@ # option add *menu*font "-adobe-helvetica-bold-r-normal--12-*" -option add *body.curfile.font "-adobe-helvetica-bold-o-normal--17-*" +option add *body.curfile.font "-adobe-helvetica-bold-o-normal--18-*" option add *body.file*font "-adobe-helvetica-medium-r-normal--14-*" -option add *body*label.font "-adobe-times-bold-i-normal--17-*" +option add *body*label.font "-adobe-times-bold-i-normal--18-*" option add *body*Scale.font "-adobe-times-medium-i-normal--14-*" option add *body.text*font "-adobe-helvetica-medium-r-normal--14-*" diff -ruN TiMidity++-1.2.1/interface/vt100_c.c TiMidity++-1.3.0/interface/vt100_c.c --- TiMidity++-1.2.1/interface/vt100_c.c Wed Jan 20 16:09:17 1999 +++ TiMidity++-1.3.0/interface/vt100_c.c Tue Feb 2 20:31:05 1999 @@ -35,7 +35,7 @@ #include #endif -#ifndef __WIN32__ +#if !defined(__WIN32__) || defined(__CYGWIN32__) #include /* for sleep */ #include #else @@ -577,6 +577,7 @@ { ctl.opened = 0; vt100_move(24, 0); + vt100_refresh(); } } diff -ruN TiMidity++-1.2.1/interface/wrdt_mac.c TiMidity++-1.3.0/interface/wrdt_mac.c --- TiMidity++-1.2.1/interface/wrdt_mac.c Mon Nov 30 19:08:51 1998 +++ TiMidity++-1.3.0/interface/wrdt_mac.c Tue Feb 2 16:05:26 1999 @@ -49,7 +49,12 @@ static int wrdt_open(char *wrdt_opts); static void wrdt_apply(int cmd, int wrd_argc, int wrd_args[]); static void wrdt_update_events(void); -static void wrdt_start(int /*wrdflag*/){} +static void wrdt_start(int /*wrdflag*/) +{ + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, + "WRD START"); +} + static void wrdt_end(void); static void wrdt_close(void); @@ -173,7 +178,7 @@ LOCK_ALL_PIXMAP(); if( dev_gon_flag) MyCopyBits(GDISP_PIX, DISP_PIX, rect, rect, 0, 0xF); - else dev_line(DISP_PIX, rect, 16, 2, 0x1F); + else dev_line(DISP_PIX, rect, 16, 2, 0xFF); UNLOCK_ALL_PIXMAP(); dev_text_redraw_rect(rect); @@ -200,8 +205,8 @@ { // clear (x1,y1) .... (x2,y1) int y, startx,endx, width; - if( locx1<1 || COLScmsg(CMSG_INFO, VERB_VERBOSE, + "WRD END"); + } static void wrdt_close(void) @@ -1337,6 +1344,20 @@ mac_wrd_doESC(event2string(esc)+1); } +static int sry_decode_bindata( char *data ) +{ + int i; + for( i=0; data[i*2]; i++ ){ + if( data[i*2]==1 ){ + data[i]=0; + }else{ + data[i]=data[i*2+1]; + } + } + data[i]='\0'; + return i; +} + static void wrdt_apply(int cmd, int wrd_argc, int wrd_args[]) { char *p; @@ -1626,13 +1647,24 @@ /* Extensionals */ case WRD_START_SKIP: ctl->cmsg(CMSG_INFO, VERB_VERBOSE, - "WRD START"); + "WRD START SKIP"); break; case WRD_END_SKIP: - //if( fading ) wrd_fadestep( 1,1 ); ctl->cmsg(CMSG_INFO, VERB_VERBOSE, - "WRD END"); + "WRD END SKIP"); break; + case WRD_SHERRY: + { + char* data= wrd_event2string(wrd_args[0]); + sry_decode_bindata(data); + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, + "SHERRY OP= 0x%2x", data[0]); + if(data[0]==0x51){ + ctl->cmsg(CMSG_INFO, VERB_VERBOSE, + "SHERRY TEXT= %s", data+11 ); + } + } + break; } wrd_argc = 0; } diff -ruN TiMidity++-1.2.1/interface/wrdt_wincon.c TiMidity++-1.3.0/interface/wrdt_wincon.c --- TiMidity++-1.2.1/interface/wrdt_wincon.c Mon Nov 30 18:02:23 1998 +++ TiMidity++-1.3.0/interface/wrdt_wincon.c Tue Feb 2 20:31:16 1999 @@ -39,9 +39,10 @@ #else #include #endif -#ifdef __WIN32__ +#ifndef __CYGWIN32__ #include #endif + #include "timidity.h" #include "common.h" #include "instrum.h" @@ -51,10 +52,21 @@ #include "wrd.h" // #define DEBUG1 -// #define USE_ESC -#ifndef __WIN32__ +#ifdef __CYGWIN32__ #define USE_ESC -#endif /* __WIN32__ */ + +#define NULL_STMT do ; while(0) +#define gotoxy(x, y) NULL_STMT +#define wherex() 1 +#define wherey() 1 +#define putch putchar +#define cputs puts +#define delline() NULL_STMT +#define clrscr() NULL_STMT +#define clreol() NULL_STMT + + +#endif /* __CYGWIN32__ */ static int wrdt_open(char *dummy); static void wrdt_apply(int cmd, int wrd_argc, int wrd_args[]); @@ -81,6 +93,7 @@ static int wrd_args[WRD_MAXPARAM]; static int inkey_flag; +#ifdef __BORLANDC__ static struct text_info text_info; static struct conattr { int attr; @@ -132,6 +145,15 @@ { borlandc_con_reset_attr(); } +#else +struct { + int winleft, winright; + int wintop, winbottom; +} text_info = { + 1,25, + 1,80, +}; +#endif #define CANNOC_X(x) \ {\ @@ -155,6 +177,7 @@ putch(*(str++)); } +#ifdef __BORLANDC__ static void borlandc_con_color(int color) { switch(color){ @@ -292,6 +315,7 @@ } return; } +#endif /* Escape sequence */ @@ -456,17 +480,23 @@ void esc_enablecursordisplay(void) { +#ifdef __BORLANDC__ _setcursortype(_NORMALCURSOR); +#endif /* __BORLANDC__ */ } void esc_disablecursordisplay(void) { +#ifdef __BORLANDC__ _setcursortype(_NOCURSOR); +#endif /* __BORLANDC__ */ } void esc_characterattribute(int n) { +#ifdef __BORLANDC__ borlandc_con_color(n); +#endif } /* return figures */ @@ -723,6 +753,7 @@ } */ +#ifdef __BORLANDC__ static void borlandc_esc(char *str) { char local[201]; @@ -732,6 +763,7 @@ local[200] = '\0'; putstring_with_esc(local); } +#endif /* __BORLANDC__ */ static int wrdt_open(char *dummy) { diff -ruN TiMidity++-1.2.1/interface/xaw_c.c TiMidity++-1.3.0/interface/xaw_c.c --- TiMidity++-1.2.1/interface/xaw_c.c Wed Jan 20 16:33:27 1999 +++ TiMidity++-1.3.0/interface/xaw_c.c Mon Feb 1 10:57:32 1999 @@ -70,7 +70,7 @@ static void ctl_refresh(void); static void ctl_total_time(int tt); static void ctl_note(int status, int ch, int note, int velocity); -static void ctl_program(int ch, int val); +static void ctl_program(int ch, int val, void *vp); static void ctl_volume(int ch, int val); static void ctl_expression(int ch, int val); static void ctl_panning(int ch, int val); @@ -78,6 +78,7 @@ static void ctl_pitch_bend(int ch, int val); static void ctl_reset(void); static void update_indicator(void); +static void set_otherinfo(int ch, int val, char c); static double indicator_last_update = 0; static int exitflag=0,randomflag=0,repeatflag=0,selectflag=0,amp_diff=0; @@ -165,7 +166,7 @@ mins=secs / 60; secs-=mins * 60; - sprintf(tt_str, " /%3d:%02d", mins, secs); + sprintf(tt_str, "/%d:%02d", mins, secs); ctl_current_time(0, 0); } @@ -180,54 +181,42 @@ static void ctl_volume(int ch, int val) { - if (!ctl.trace_playing) - return; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; sprintf(local_buf, "PV%c%d", ch+'A', val); a_pipe_write(local_buf); } static void ctl_expression(int ch, int val) { - if (!ctl.trace_playing) - return; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; sprintf(local_buf, "PE%c%d", ch+'A', val); a_pipe_write(local_buf); } static void ctl_panning(int ch, int val) { - if (!ctl.trace_playing) - return; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; sprintf(local_buf, "PA%c%d", ch+'A', val); a_pipe_write(local_buf); } static void ctl_sustain(int ch, int val) { - if (!ctl.trace_playing) - return; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; sprintf(local_buf, "PS%c%d", ch+'A', val); a_pipe_write(local_buf); } static void ctl_pitch_bend(int ch, int val) { - /* - if (!ctl.trace_playing) - return; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; sprintf(local_buf, "PB%c%d", ch+'A', val); a_pipe_write(local_buf); - */ } static void ctl_lyric(int lyricid) @@ -608,19 +597,16 @@ { char c; - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; - if (!ctl.trace_playing || midi_trace.flush_flag) - return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; + if(!ctl.trace_playing || midi_trace.flush_flag) return; -#define TRACE_HEIGHT 200 c = '.'; switch(status) { case VOICE_ON: c = '*'; break; case VOICE_SUSTAINED: - c = '*'; + c = '&'; break; case VOICE_FREE: case VOICE_DIE: @@ -632,12 +618,10 @@ a_pipe_write(local_buf); } -static void ctl_program(int ch, int val) +static void ctl_program(int ch, int val, void *comm) { - if(ch >= MAX_XAW_MIDI_CHANNELS) - return; - if (!ctl.trace_playing) - return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; + if(!ctl.trace_playing) return; if(channel[ch].special_sample) val = channel[ch].special_sample; @@ -645,6 +629,13 @@ val += progbase; sprintf(local_buf, "PP%c%d", ch+'A', val); a_pipe_write(local_buf); + if (comm != NULL) { + sprintf(local_buf, "I%c%s", ch+'A', (char *)comm); + if (ISDRUMCHANNEL(ch)) + sprintf(local_buf, "I%c%s", ch+'A', + (!strlen((char *)comm))? "":(char *)comm); + a_pipe_write(local_buf); + } } static void ctl_event(CtlEvent *e) @@ -669,7 +660,7 @@ ctl_note((int)e->v1, (int)e->v2, (int)e->v3, (int)e->v4); break; case CTLE_PROGRAM: - ctl_program((int)e->v1, (int)e->v2); + ctl_program((int)e->v1, (int)e->v2, (char *)e->v3); break; case CTLE_VOLUME: ctl_volume((int)e->v1, (int)e->v2); @@ -690,8 +681,10 @@ ctl_pitch_bend((int)e->v1, e->v2 ? -1 : 0x2000); break; case CTLE_CHORUS_EFFECT: + set_otherinfo((int)e->v1, (int)e->v2, 'c'); break; case CTLE_REVERB_EFFECT: + set_otherinfo((int)e->v1, (int)e->v2, 'r'); break; case CTLE_LYRIC: ctl_lyric((int)e->v1); @@ -713,19 +706,40 @@ { } +static void set_otherinfo(int ch, int val, char c) { + if(!ctl.trace_playing) return; + if(ch >= MAX_XAW_MIDI_CHANNELS) return; + sprintf(local_buf, "P%c%c%d", c, ch+'A', val); + a_pipe_write(local_buf); +} + static void ctl_reset(void) { int i; - if (!ctl.trace_playing) - return; + if(!ctl.trace_playing) return; play_mode->purge_output(); for (i=0; itone[channel[i].program].instrument == NULL) { + b = 0; + bank = tonebank[0]; + } + set_otherinfo(i, channel[i].bank, 'b'); + if (opt_reverb_control && channel[i].rb != NULL) + set_otherinfo(i, channel[i].rb->level, 'r'); + if(opt_chorus_control) + set_otherinfo(i, channel[i].chorus_level, 'c'); + } ctl_volume(i, channel[i].volume); ctl_expression(i, channel[i].expression); ctl_panning(i, channel[i].panning); @@ -743,6 +757,7 @@ { double t; + if(!ctl.trace_playing) return; t = get_current_calender_time(); if(indicator_last_update + INDICATOR_UPDATE_TIME > t) return; sprintf(local_buf, "U"); diff -ruN TiMidity++-1.2.1/interface/xaw_i.c TiMidity++-1.3.0/interface/xaw_i.c --- TiMidity++-1.2.1/interface/xaw_i.c Wed Jan 20 16:45:28 1999 +++ TiMidity++-1.3.0/interface/xaw_i.c Wed Feb 3 05:11:55 1999 @@ -68,6 +68,7 @@ #include "common.h" #include "instrum.h" #include "playmidi.h" +#include "readmidi.h" #include "controls.h" #if HAVE_STRSTR #define strstr(s,c) index(s,c) @@ -75,18 +76,95 @@ #ifndef HAVE_STRNCASECMP int strncasecmp(char *s1, char *s2, unsigned int len); #endif -#define TRACE_WIDTH 372 -#define TRACE_HEIGHT 180 -#define POS_HEIGHT 12 -#define PRG_HEIGHT 16 -#define TRACE_XOFS 30 -#define TRACE_YOFS 10 -#define BAR_INTERVAL 2 + +#define TRACE_WIDTH 627 /* default height of trace_vport */ +#define TRACEVPORT_WIDTH (TRACE_WIDTH+12) +#define TRACE_WIDTH_SHORT 388 +#define TRACE_HEIGHT 336 +#define TRACEV_OFS 22 +#define TRACEH_OFS 0 #define BAR_SPACE 20 -#define BAR_WIDTH (BAR_SPACE-BAR_INTERVAL) -#define BAR_HEIGHT 140 -#define BAR_SCALE 1 -#define TRACE_BASELINE BAR_HEIGHT+10 +#define BAR_HEIGHT 16 +#define VOLUME_LABEL_WIDTH 80 + +#define BARSCALE2 0.31111 /* velocity scale (60-4)/180 */ +#define BARSCALE3 0.28125 /* volume scale (40-4)/128 */ +#define BARSCALE4 0.25 /* expression scale (36-4)/128 */ +#define BARSCALE5 0.385827 /* expression scale (53-4)/128 */ +static int currwidth = 2; +static int rotatewidth[] = {TRACE_WIDTH_SHORT, 592, 638}; + +int dirlist_cmp (const void *p1, const void *p2) +{ + return strcasecmp (*((char **)p1), *((char **)p2)); +} + + +typedef struct { + int col; /* column number */ + char **cap; /* caption strings array */ + int *w; /* column width array */ + int *ofs; /* column offset array */ +} Tplane; +static int plane = 0; + +#define TCOLUMN 9 +#define T2COLUMN 10 +static char *caption[TCOLUMN] = +{"ch"," vel"," vol","expr","prog","pan","pit"," instrument", + " keyboard"}; +static char *caption2[T2COLUMN] = +{"ch"," vel"," vol","expr","prog","pan","bnk","reverb","chorus", + " keyboard"}; + +static int BARH_SPACE[TCOLUMN]= {22,60,40,36,36,36,30,106,304}; +#define BARH_OFS0 (TRACEH_OFS) +#define BARH_OFS1 (BARH_OFS0+22) +#define BARH_OFS2 (BARH_OFS1+60) +#define BARH_OFS3 (BARH_OFS2+40) +#define BARH_OFS4 (BARH_OFS3+36) +#define BARH_OFS5 (BARH_OFS4+36) +#define BARH_OFS6 (BARH_OFS5+36) +#define BARH_OFS7 (BARH_OFS6+30) +#define BARH_OFS8 (BARH_OFS7+106) +static int bar0ofs[] = {BARH_OFS0,BARH_OFS1,BARH_OFS2,BARH_OFS3, + BARH_OFS4,BARH_OFS5,BARH_OFS6,BARH_OFS7,BARH_OFS8}; + +static int BARH2_SPACE[T2COLUMN]= {22,60,40,36,36,36,30,53,53,304}; +#define BARH2_OFS0 (TRACEH_OFS) +#define BARH2_OFS1 (BARH2_OFS0+22) +#define BARH2_OFS2 (BARH2_OFS1+60) +#define BARH2_OFS3 (BARH2_OFS2+40) +#define BARH2_OFS4 (BARH2_OFS3+36) +#define BARH2_OFS5 (BARH2_OFS4+36) +#define BARH2_OFS6 (BARH2_OFS5+36) +#define BARH2_OFS7 (BARH2_OFS6+30) +#define BARH2_OFS8 (BARH2_OFS7+53) +#define BARH2_OFS9 (BARH2_OFS8+53) +static int bar1ofs[] = {BARH2_OFS0,BARH2_OFS1,BARH2_OFS2,BARH2_OFS3, + BARH2_OFS4,BARH2_OFS5,BARH2_OFS6,BARH2_OFS7,BARH2_OFS8,BARH2_OFS9}; + +static Tplane pl[] = { + {TCOLUMN, caption, BARH_SPACE, bar0ofs}, + {T2COLUMN, caption2, BARH2_SPACE, bar1ofs}, +}; + +#define CL_C 0 /* column 0 = channel */ +#define CL_VE 1 /* column 1 = velocity */ +#define CL_VO 2 /* column 2 = volume */ +#define CL_EX 3 /* column 3 = expression */ +#define CL_PR 4 /* column 4 = program */ +#define CL_PA 5 /* column 5 = panning */ +#define CL_PI 6 /* column 6 = pitch bend */ +#define CL_IN 7 /* column 7 = instrument name */ + +#define CL_BA 6 /* column 6 = bank */ +#define CL_RE 7 /* column 7 = reverb */ +#define CL_CH 8 /* column 8 = chorus */ + +#define INST_NAME_SIZE 16 +static char *inst_name[MAX_XAW_MIDI_CHANNELS]; +static int disp_inst_name_len = 13; typedef struct { int id; @@ -103,13 +181,17 @@ void a_print_text(Widget,char *); static void draw1Chan(int,int,char); -static void drawProg(int,Boolean), drawPan(int,int,Boolean); +static void drawProg(int,int,int,int,Boolean), drawPan(int,int,Boolean), + drawVol(int,int), drawExp(int,int), drawPitch(int,int),drawInstname(int,char *), + drawBank(int,int),drawReverb(int,int),drawChorus(int,int); static void quitCB(),playCB(),pauseCB(),stopCB(),prevCB(),nextCB(), forwardCB(),backCB(),repeatCB(),randomCB(),menuCB(),sndspecCB(), - volsetCB(),volupdownCB(),volupdownAction(),toggleMark(),filemenuCB(), - popupLoad(),popdownLoad(),a_readconfig(),a_saveconfig(), - saveconfigAction(),setDirAction(),setDirList(); -static void drawBar(),drawTraceAll(),completeDir(),ctl_channel_note(); + volsetCB(),volupdownCB(),exchgWidthCB(),filemenuCB(), + volupdownAction(),toggleMark(),popupLoad(),popdownLoad(),a_readconfig(), + a_saveconfig(),saveconfigAction(),setDirAction(),setDirList(); +static void drawBar(),redrawTrace(Boolean),completeDir(),ctl_channel_note(), + drawKeyboardAll(), draw1Note(), redrawAction(), redrawCaption(), + exchgWidth(), toggletrace(); static char *expandDir(),*strmatch(); static int configcmp(); #ifdef ENABLE_KEY_TRANSLATION @@ -119,25 +201,27 @@ extern void a_pipe_write(char *); extern int a_pipe_read(char *,int); extern int a_pipe_nread(char *buf, int n); -static void initTraceWindow(Boolean); +static void initStatus(void); static Widget title_mb,title_sm,time_l,popup_load,popup_load_f,load_d; -static Widget load_vport,load_flist,cwd_l,load_info; -static Dimension lyric_height, base_height; -static Widget lyric_t; -static GC gct; -static XColor bgcolor,defcolor,fgpan,fgstr,fgtmp; -static XFontStruct *StatusFont; +static Widget load_vport,load_flist,cwd_l,load_info, lyric_t; +static Dimension lyric_height, base_height, text_height; +static GC gc,gct; +static Pixel bgcolor,menubcolor,textcolor,textbgcolor,text2bgcolor,buttonbgcolor, + buttoncolor,togglecolor,tracecolor,volcolor,expcolor,pancolor,capcolor,rimcolor, + boxcolor,suscolor,playcolor,revcolor,chocolor; +static Pixel black,white; static long barcol[MAX_XAW_MIDI_CHANNELS]; -static Widget toplevel,m_box,base_f,file_mb,file_sm,bsb,trace; +static Widget toplevel,m_box,base_f,file_mb,file_sm,bsb; static Widget quit_b,play_b,pause_b,stop_b,prev_b,next_b,fwd_b,back_b; -static Widget random_b,repeat_b,b_box,v_box,vol_l,vol_bar; +static Widget random_b,repeat_b,b_box,v_box,vol_l,vol_bar,trace_vport,trace; static char local_buf[300]; static char window_title[300], *w_title; int amplitude = DEFAULT_AMPLIFICATION; String bitmapdir = DEFAULT_PATH "/bitmaps"; Boolean arrangetitle = TRUE; + typedef struct { Boolean confirmexit; Boolean repeat; @@ -154,6 +238,7 @@ #define FLAG_PROG_ON 4 #define FLAG_PAN 8 #define FLAG_SUST 16 +#define FLAG_BENDT 32 typedef struct { int reset_panel; int multi_part; @@ -161,15 +246,30 @@ int16 cnote[MAX_XAW_MIDI_CHANNELS]; int16 cvel[MAX_XAW_MIDI_CHANNELS]; int16 ctotal[MAX_XAW_MIDI_CHANNELS]; + int16 bank[MAX_XAW_MIDI_CHANNELS]; + int16 reverb[MAX_XAW_MIDI_CHANNELS]; char c_flags[MAX_XAW_MIDI_CHANNELS]; Channel channel[MAX_XAW_MIDI_CHANNELS]; } PanelInfo; /* Default configuration to execute Xaw interface */ -/* confirmexit repeat autostart hidetext shuffle disptrace */ +/* (confirmexit repeat autostart hidetext shuffle disptrace) */ Config Cfg = { False, False, True, False, False, True }; static PanelInfo *Panel; +typedef struct { + int y; + int l; +} KeyL; + +typedef struct { + KeyL k[3]; + int xofs; + Pixel col; +} ThreeL; +static ThreeL *keyG; +#define KEY_NUM 111 + #define MAXBITMAP 10 static char *bmfname[] = { "back.xbm","fwrd.xbm","next.xbm","pause.xbm","play.xbm","prev.xbm", @@ -210,7 +310,7 @@ static Display *disp; static int screen; -static Pixmap check_mark; +static Pixmap check_mark, layer[2]; static int bm_height[MAXBITMAP], bm_width[MAXBITMAP], x_hot,y_hot, root_height, root_width; @@ -220,9 +320,21 @@ String *dirlist = NULL; Dimension trace_width = TRACE_WIDTH, trace_height = TRACE_HEIGHT; -/*static struct _app_resources { +static struct _app_resources { String bitmap_dir; Boolean arrange_title; + short text_height,trace_width,trace_height; + Pixel common_fgcolor,common_bgcolor,menub_bgcolor,text_bgcolor,text2_bgcolor, + toggle_fgcolor,button_fgcolor,button_bgcolor, + velocity_color,drumvelocity_color,volume_color,expr_color,pan_color, + trace_bgcolor,rim_color,box_color,caption_color,sus_color,play_color, + rev_color,cho_color; + XFontStruct *label_font,*volume_font,*trace_font; +#ifdef I18N + XFontSet text_font; +#else + XFontStruct *text_font; +#endif } app_resources; static XtResource resources[] ={ @@ -230,9 +342,75 @@ {"bitmapDir", "BitmapDir", XtRString, sizeof(String), offset(bitmap_dir), XtRString, DEFAULT_PATH "/bitmaps"}, {"arrangeTitle", "ArrangeTitle", XtRBoolean, sizeof(Boolean), - offset(arrange_title), XtRBoolean, (XtPointer)True}, + offset(arrange_title), XtRImmediate, (XtPointer)True}, +#ifdef WIDGET_IS_LABEL_WIDGET + {"textLHeight", "TextLHeight", XtRShort, sizeof(short), + offset(text_height), XtRImmediate, (XtPointer)30}, +#else + {"textHeight", "TextHeight", XtRShort, sizeof(short), + offset(text_height), XtRImmediate, (XtPointer)120}, +#endif + {"traceWidth", "TraceWidth", XtRShort, sizeof(short), + offset(trace_width), XtRImmediate, (XtPointer)TRACE_WIDTH}, + {"traceHeight", "TraceHeight", XtRShort, sizeof(short), + offset(trace_height), XtRImmediate, (XtPointer)TRACE_HEIGHT}, + {"foreground", XtCForeground, XtRPixel, sizeof(Pixel), + offset(common_fgcolor), XtRString, "black"}, + {"background", XtCBackground, XtRPixel, sizeof(Pixel), + offset(common_bgcolor), XtRString, "gray65"}, + {"menubutton", "MenuButtonBackground", XtRPixel, sizeof(Pixel), + offset(menub_bgcolor), XtRString, "#CCFF33"}, + {"textbackground", "TextBackground", XtRPixel, sizeof(Pixel), + offset(text_bgcolor), XtRString, "gray85"}, + {"text2background", "Text2Background", XtRPixel, sizeof(Pixel), + offset(text2_bgcolor), XtRString, "gray80"}, + {"toggleforeground", "ToggleForeground", XtRPixel, sizeof(Pixel), + offset(toggle_fgcolor), XtRString, "MediumBlue"}, + {"buttonforeground", "ButtonForeground", XtRPixel, sizeof(Pixel), + offset(button_fgcolor), XtRString, "blue"}, + {"buttonbackground", "ButtonBackground", XtRPixel, sizeof(Pixel), + offset(button_bgcolor), XtRString, "gray76"}, + {"velforeground", "VelForeground", XtRPixel, sizeof(Pixel), + offset(velocity_color), XtRString, "orange"}, + {"veldrumforeground", "VelDrumForeground", XtRPixel, sizeof(Pixel), + offset(drumvelocity_color), XtRString, "red"}, + {"volforeground", "VolForeground", XtRPixel, sizeof(Pixel), + offset(volume_color), XtRString, "LightPink"}, + {"expforeground", "ExpForeground", XtRPixel, sizeof(Pixel), + offset(expr_color), XtRString, "aquamarine"}, + {"panforeground", "PanForeground", XtRPixel, sizeof(Pixel), + offset(pan_color), XtRString, "blue"}, + {"tracebackground", "TraceBackground", XtRPixel, sizeof(Pixel), + offset(trace_bgcolor), XtRString, "gray90"}, + {"rimcolor", "RimColor", XtRPixel, sizeof(Pixel), + offset(rim_color), XtRString, "gray20"}, + {"boxcolor", "BoxColor", XtRPixel, sizeof(Pixel), + offset(box_color), XtRString, "gray76"}, + {"captioncolor", "CaptionColor", XtRPixel, sizeof(Pixel), + offset(caption_color), XtRString, "DarkSlateGrey"}, + {"sustainedkeycolor", "SustainedKeyColor", XtRPixel, sizeof(Pixel), + offset(sus_color), XtRString, "red4"}, + {"playingkeycolor", "PlayingKeyColor", XtRPixel, sizeof(Pixel), + offset(play_color), XtRString, "maroon1"}, + {"reverbcolor", "ReverbColor", XtRPixel, sizeof(Pixel), + offset(rev_color), XtRString, "PaleGoldenrod"}, + {"choruscolor", "ChorusColor", XtRPixel, sizeof(Pixel), + offset(cho_color), XtRString, "yellow"}, + {"labelfont", "LabelFont", XtRFontStruct, sizeof(XFontStruct *), + offset(label_font), XtRString, "-adobe-helvetica-bold-r-*-*-14-*-75-75-*-*-*-*"}, + {"volumefont", "VolumeFont", XtRFontStruct, sizeof(XFontStruct *), + offset(volume_font), XtRString, "-adobe-helvetica-bold-r-*-*-12-*-75-75-*-*-*-*"}, +#ifdef I18N + {"textfontset", "TextFontSet", XtRFontSet, sizeof(XFontSet), + offset(text_font), XtRString, "-*-*-medium-r-normal--14-*-*-*-*-*-*-*"}, +#else + {"textfont", XtCFont, XtRFontStruct, sizeof(XFontStruct *), + offset(text_font), XtRString, "-*-fixed-medium-r-normal--14-*-*-*-*-*-*-*"}, +#endif + {"tracefont", "TraceFont", XtRFontStruct, sizeof(XFontStruct *), + offset(trace_font), XtRString, "7x14"}, #undef offset -};*/ +}; enum { ID_LOAD = 100, @@ -275,6 +453,14 @@ } } +static Boolean IsTracePlaying(void) { + Boolean s; + + if (!ctl->trace_playing) return False; + XtVaGetValues(play_b,XtNstate,&s,NULL); + return(s); +} + static Boolean onPlayOffPause(void) { Boolean s; Boolean play_on; @@ -354,35 +540,38 @@ offPlayButton(); offPauseButton(); a_pipe_write("S"); - initTraceWindow(True); + initStatus(); + redrawTrace(False); } /*ARGSUSED*/ static void nextCB(Widget w,XtPointer data,XtPointer dummy) { onPlayOffPause(); a_pipe_write("N"); - initTraceWindow(True); + initStatus(); + redrawTrace(True); } /*ARGSUSED*/ static void prevCB(Widget w,XtPointer data,XtPointer dummy) { onPlayOffPause(); a_pipe_write("B"); - initTraceWindow(True); + initStatus(); + redrawTrace(True); } /*ARGSUSED*/ static void forwardCB(Widget w,XtPointer data,XtPointer dummy) { if (onPlayOffPause()) a_pipe_write("P"); a_pipe_write("f"); - initTraceWindow(True); + initStatus(); } /*ARGSUSED*/ static void backCB(Widget w,XtPointer data,XtPointer dummy) { if (onPlayOffPause()) a_pipe_write("P"); a_pipe_write("b"); - initTraceWindow(True); + initStatus(); } /*ARGSUSED*/ @@ -459,6 +648,45 @@ a_pipe_write(s); } +/*ARGSUSED*/ +static void resizeAction(Widget w,XEvent *e,String *v,Cardinal *n) { + Dimension w1,w2,h1,y1,h2; + int i,tmp; + + XtVaGetValues(toplevel,XtNwidth,&w1,NULL); + XtVaGetValues(toplevel,XtNheight,&h1,NULL); + w2 = w1 -8; + if(w2>TRACEVPORT_WIDTH) w2 = TRACEVPORT_WIDTH; + XtVaGetValues(lyric_t,XtNheight,&h2,NULL); + XtResizeWidget(lyric_t,w2-2,h2,0); + i= 0; tmp = 10; + while (tmp > 0) { + i++; tmp -= (int)(w2) / 36; + } + XtVaSetValues(lyric_t,XtNborderWidth,1,NULL); + XtVaSetValues(b_box,XtNheight,i*40,NULL); + XtResizeWidget(b_box,w2,i*40,0); + + if(ctl->trace_playing) { + XtVaGetValues(trace_vport,XtNy,&y1,NULL); + XtResizeWidget(trace_vport,w2,((h1-y1>TRACE_HEIGHT+12)? TRACE_HEIGHT+12:h1-y1),0); + } + XtVaGetValues(v_box,XtNheight,&h2,NULL); + w2 = ((w1 < TRACE_WIDTH_SHORT)? w1:TRACE_WIDTH_SHORT); /* new v_box width */ + tmp = ((w2 -VOLUME_LABEL_WIDTH -20 < 0)? 0:VOLUME_LABEL_WIDTH); /* new vol_l width */ + XtVaSetValues(vol_l,XtNwidth,tmp,NULL); + XtVaSetValues(v_box,XtNwidth,w2,NULL); + XtResizeWidget(v_box,w2,h2,0); + XtVaGetValues(vol_bar,XtNheight,&h2,NULL); + XtVaSetValues(vol_bar,XtNwidth,w2 -tmp -20,NULL); + XtResizeWidget(vol_bar,w2 -tmp -20,h2,0); + /*XtVaGetValues(vol_l,XtNheight,&h2,NULL); + XtVaSetValues(vol_l,XtNwidth,w1-20,NULL); + XtResizeWidget(vol_l,w1-20,h2,0);*/ + XSync(disp, False); + usleep(10000); +} + #ifndef WIDGET_IS_LABEL_WIDGET void a_print_text(Widget w, char *st) { XawTextPosition pos; @@ -477,7 +705,7 @@ void a_print_text(Widget w, char *st) { XtVaSetValues(w,XtNlabel,st,NULL); } -#endif /*WIDGET_IS_LABEL_WIDGET*/ +#endif /* !WIDGET_IS_LABEL_WIDGET */ /*ARGSUSED*/ static void popupLoad(Widget w,XtPointer client_data,XtPointer call_data) { @@ -556,16 +784,16 @@ if(ctl->trace_playing) { XtVaGetValues(toplevel,XtNheight,&h1,NULL); XtVaGetValues(toplevel,XtNwidth,&w1,NULL); - if (XtIsManaged(trace)) { + if(XtIsManaged(trace_vport)) { tmp = trace_height + (XtIsManaged(lyric_t) ? 0:lyric_height); - XtUnmanageChild(trace); + XtUnmanageChild(trace_vport); XtMakeResizeRequest(toplevel,w1,base_height-tmp,&w2,&h2); } else { - XtManageChild(trace); - XtVaSetValues(trace,XtNfromVert, + XtManageChild(trace_vport); + XtVaSetValues(trace_vport,XtNfromVert, (XtIsManaged(lyric_t) ? lyric_t:v_box),NULL); XtMakeResizeRequest(toplevel,w1,h1+trace_height,&w2,&h2); - XtVaSetValues(trace,XtNheight,trace_height,NULL); + XtVaSetValues(trace_vport,XtNheight,trace_height,NULL); } toggleMark(w,*id); } @@ -573,20 +801,20 @@ case ID_HIDETXT: XtVaGetValues(toplevel,XtNheight,&h1,NULL); XtVaGetValues(toplevel,XtNwidth,&w1,NULL); - if (XtIsManaged(lyric_t)) { + if(XtIsManaged(lyric_t)) { if(ctl->trace_playing) { - tmp = lyric_height + (XtIsManaged(trace) ? 0:trace_height); + tmp = lyric_height + (XtIsManaged(trace_vport) ? 0:trace_height); } else { tmp = lyric_height; } XtUnmanageChild(lyric_t); - if(ctl->trace_playing && XtIsManaged(trace)) - XtVaSetValues(trace,XtNfromVert,v_box,NULL); + if(ctl->trace_playing && XtIsManaged(trace_vport)) + XtVaSetValues(trace_vport,XtNfromVert,v_box,NULL); XtMakeResizeRequest(toplevel,w1,base_height-tmp,&w2,&h2); } else { XtManageChild(lyric_t); - if(ctl->trace_playing && XtIsManaged(trace)) { - XtVaSetValues(trace,XtNfromVert,lyric_t,NULL); + if(ctl->trace_playing && XtIsManaged(trace_vport)) { + XtVaSetValues(trace_vport,XtNfromVert,lyric_t,NULL); } XtVaSetValues(lyric_t,XtNheight,lyric_height,NULL); XtMakeResizeRequest(toplevel,w1,h1+lyric_height,&w2,&h2); @@ -648,10 +876,9 @@ #define DELTA_VEL 32 -static void -ctl_channel_note(int ch, int note, int velocity) { +static void ctl_channel_note(int ch, int note, int velocity) { - if (!ctl->trace_playing) return; + if(!ctl->trace_playing) return; if (velocity == 0) { if (note == Panel->cnote[ch]) Panel->v_flags[ch] = FLAG_NOTE_OFF; @@ -719,66 +946,95 @@ } break; case 'Y': - ch= *(local_buf+1) - 'A'; - c= *(local_buf+2); - note= (*(local_buf+3)-'0')*100 + (*(local_buf+4)-'0')*10 + *(local_buf+5)-'0'; - n= atoi(local_buf+6); - if (c == '*') { - Panel->c_flags[ch] |= FLAG_PROG_ON; - } else { - Panel->c_flags[ch] &= ~FLAG_PROG_ON; n= 0; + if(ctl->trace_playing) { + ch= *(local_buf+1) - 'A'; + c= *(local_buf+2); + note= (*(local_buf+3)-'0')*100 + (*(local_buf+4)-'0')*10 + *(local_buf+5)-'0'; + n= atoi(local_buf+6); + if (c == '*' || c == '&') { + Panel->c_flags[ch] |= FLAG_PROG_ON; + } else { + Panel->c_flags[ch] &= ~FLAG_PROG_ON; n= 0; + } + ctl_channel_note(ch, note, n); + draw1Note(ch,note,c); + draw1Chan(ch,Panel->ctotal[ch],c); + } + break; + case 'I': + if(IsTracePlaying()) { + ch= *(local_buf+1) - 'A'; + strncpy(inst_name[ch], (char *)&local_buf[2], INST_NAME_SIZE); + drawInstname(ch, inst_name[ch]); } - ctl_channel_note(ch, note, n); - draw1Chan(ch,Panel->ctotal[ch],c); break; case 'P': - c= *(local_buf+1); - ch= *(local_buf+2)-'A'; - n= atoi(local_buf+3); - switch(c) { - case 'A': /* panning */ - Panel->channel[ch].panning = n; - Panel->c_flags[ch] |= FLAG_PAN; - drawPan(ch,n,True); - break; - case 'B': /* pitch_bend */ - /*Panel->channel[ch].pitch_bend = n; - Panel->c_flags[ch] |= FLAG_BENDT;*/ - break; - case 'S': /* sustain */ - Panel->channel[ch].sustain = n; - Panel->c_flags[ch] |= FLAG_SUST; - break; - case 'P': /* program */ - Panel->channel[ch].program = n; - Panel->c_flags[ch] |= FLAG_PROG; - drawProg(ch,True); - break; - case 'E': /* expression */ - Panel->channel[ch].expression = n; - ctl_channel_note(ch, Panel->cnote[ch], Panel->cvel[ch]); - break; - case 'V': /* volume */ - Panel->channel[ch].volume = n; - ctl_channel_note(ch, Panel->cnote[ch], Panel->cvel[ch]); - break; + if(IsTracePlaying()) { + c= *(local_buf+1); + ch= *(local_buf+2)-'A'; + n= atoi(local_buf+3); + switch(c) { + case 'A': /* panning */ + Panel->channel[ch].panning = n; + Panel->c_flags[ch] |= FLAG_PAN; + drawPan(ch,n,True); + break; + case 'B': /* pitch_bend */ + Panel->channel[ch].pitchbend = n; + Panel->c_flags[ch] |= FLAG_BENDT; + if (!plane) drawPitch(ch,n); + break; + case 'b': /* tonebank */ + Panel->channel[ch].bank = n; + if (plane) drawBank(ch,n); + break; + case 'r': /* reverb */ + Panel->reverb[ch] = n; + if (plane) drawReverb(ch,n); + break; + case 'c': /* chorus */ + Panel->channel[ch].chorus_level = n; + if (plane) drawChorus(ch,n); + break; + case 'S': /* sustain */ + Panel->channel[ch].sustain = n; + Panel->c_flags[ch] |= FLAG_SUST; + break; + case 'P': /* program */ + Panel->channel[ch].program = n; + Panel->c_flags[ch] |= FLAG_PROG; + drawProg(ch,n,4,pl[plane].ofs[CL_PR],True); + break; + case 'E': /* expression */ + Panel->channel[ch].expression = n; + ctl_channel_note(ch, Panel->cnote[ch], Panel->cvel[ch]); + drawExp(ch,n); + break; + case 'V': /* volume */ + Panel->channel[ch].volume = n; + ctl_channel_note(ch, Panel->cnote[ch], Panel->cvel[ch]); + drawVol(ch,n); + break; + } } break; case 'R': - drawTraceAll(); break; + redrawTrace(True); break; case 'U': /* update timer */ - for(i=0; iv_flags[i]) { - if (Panel->v_flags[i] == FLAG_NOTE_OFF) { - Panel->ctotal[i] -= DELTA_VEL; - if (Panel->ctotal[i] <= 0) { - Panel->ctotal[i] = 0; + if(ctl->trace_playing) { + for(i=0; iv_flags[i]) { + if (Panel->v_flags[i] == FLAG_NOTE_OFF) { + Panel->ctotal[i] -= DELTA_VEL; + if (Panel->ctotal[i] <= 0) { + Panel->ctotal[i] = 0; + Panel->v_flags[i] = 0; + } + } else { Panel->v_flags[i] = 0; } - } else { - Panel->v_flags[i] = 0; } - } + } break; default : fprintf(stderr,"Unkown message '%s' from CONTROL" NLS,local_buf); @@ -941,6 +1197,7 @@ dirlist[i] = XtMalloc(sizeof(char) * strlen(filename) + 1); strcpy(dirlist[i++], filename); } + qsort (dirlist, i, sizeof (char *), dirlist_cmp); dirlist[i] = NULL; snprintf(local_buf, sizeof(local_buf), "%d Directories, %d Files", d_num, f_num); XawListChange(list, dirlist, 0,0,True); @@ -950,33 +1207,32 @@ } } -static void drawBar(int ch,int len) { - if (!ctl->trace_playing) return; - XSetForeground(disp, gct, barcol[ch]); +static void drawBar(int ch,int len, int xofs, int column, Pixel color) { + XSetForeground(disp, gct, bgcolor); + XSetForeground(disp, gct, boxcolor); XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, - TRACE_XOFS+ch*BAR_SPACE,TRACE_BASELINE-len*BAR_SCALE, - BAR_WIDTH,len*BAR_SCALE); - XSetForeground(disp, gct, bgcolor.pixel); + xofs+len+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[column] -len -4,BAR_HEIGHT); + XSetForeground(disp, gct, color); XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, - TRACE_XOFS+ch*BAR_SPACE,0, - BAR_WIDTH+1,TRACE_BASELINE-len*BAR_SCALE); + xofs+2,TRACEV_OFS+BAR_SPACE*ch+2, + len,BAR_HEIGHT); } -static void drawProg(int ch,Boolean do_clean) { - char s[3]; +static void drawProg(int ch,int val,int column,int xofs, Boolean do_clean) { + char s[4]; - if (!ctl->trace_playing) return; if(do_clean) { - XSetForeground(disp, gct, bgcolor.pixel); + XSetForeground(disp, gct, boxcolor); XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, - TRACE_XOFS+ch*BAR_SPACE,TRACE_BASELINE+POS_HEIGHT, - BAR_SPACE,PRG_HEIGHT); - XSetForeground(disp, gct, fgstr.pixel); + xofs+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[4]-4,BAR_HEIGHT); } - sprintf(s, "%02X", Panel->channel[ch].program); + XSetForeground(disp, gct, black); /* 14 means suspected Text Height, though it's not so exact.. */ + sprintf(s, "%3d", val); XDrawString(XtDisplay(trace), XtWindow(trace), gct, - TRACE_XOFS+ch*BAR_SPACE+2,TRACE_BASELINE+POS_HEIGHT+14,s,2); + xofs+5,TRACEV_OFS+BAR_SPACE*ch+16,s,3); } static void drawPan(int ch,int val,Boolean setcolor) { @@ -984,79 +1240,289 @@ int x; static XPoint pp[3]; - if (!ctl->trace_playing) return; if (val < 0) return; - x= TRACE_XOFS+ BAR_SPACE * ch+ 1; - ap= BAR_WIDTH * val/127; - bp= BAR_WIDTH -ap -1; - pp[0].x= ap+ x; pp[0].y= 6 +TRACE_BASELINE; - pp[1].x= bp+ x; pp[1].y= 2 +TRACE_BASELINE; - pp[2].x= bp+ x; pp[2].y= 10 +TRACE_BASELINE; if (setcolor) { - XSetForeground(disp, gct, bgcolor.pixel); + XSetForeground(disp, gct, boxcolor); XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, - x-2,TRACE_BASELINE+1,BAR_SPACE-1,12); - XSetForeground(disp, gct, fgpan.pixel); - } + pl[plane].ofs[CL_PA]+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[CL_PA]-4,BAR_HEIGHT); + XSetForeground(disp, gct, pancolor); + } + x= pl[plane].ofs[CL_PA]+3; + ap= 31 * val/127; + bp= 31 -ap -1; + pp[0].x= ap+ x; pp[0].y= 12 +BAR_SPACE*(ch+1); + pp[1].x= bp+ x; pp[1].y= 8 +BAR_SPACE*(ch+1); + pp[2].x= bp+ x; pp[2].y= 16 +BAR_SPACE*(ch+1); XFillPolygon(XtDisplay(trace),XtWindow(trace),gct,pp,3, (int)Nonconvex,(int)CoordModeOrigin); } static void draw1Chan(int ch,int val,char cmd) { - if (!ctl->trace_playing) return; - if (cmd == '*') { - drawBar(ch, val); + if (cmd == '*' || cmd == '&') { + drawBar(ch, (int)(val*BARSCALE2), pl[plane].ofs[CL_VE], CL_VE, barcol[ch]); } else { - XSetForeground(disp, gct, bgcolor.pixel); + XSetForeground(disp, gct, boxcolor); XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, - TRACE_XOFS+ch*BAR_SPACE,TRACE_YOFS,BAR_WIDTH+1,BAR_HEIGHT); + pl[plane].ofs[CL_VE]+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[CL_VE]-4,BAR_HEIGHT); + } +} + +static void drawVol(int ch,int val) { + drawBar(ch, (int)(val*BARSCALE3), pl[plane].ofs[CL_VO], CL_VO, volcolor); +} + +static void drawExp(int ch,int val) { + drawBar(ch, (int)(val*BARSCALE4), pl[plane].ofs[CL_EX], CL_EX, expcolor); +} + +static void drawReverb(int ch,int val) { + drawBar(ch, (int)(val*BARSCALE5), pl[plane].ofs[CL_RE], CL_RE, revcolor); +} + +static void drawChorus(int ch,int val) { + drawBar(ch, (int)(val*BARSCALE5), pl[plane].ofs[CL_CH], CL_CH, chocolor); +} + +static void drawPitch(int ch,int val) { + char s[3]; + + XSetForeground(disp, gct, boxcolor); + XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, + pl[plane].ofs[CL_PI]+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[CL_PI] -4,BAR_HEIGHT); + XSetForeground(disp, gct, barcol[9]); + if (val != 0) { + if (val<0) { + sprintf(s, "="); + } else { + if (val == 0x2000) sprintf(s, "*"); + else if (val>0x3000) sprintf(s, ">>"); + else if (val>0x2000) sprintf(s, ">"); + else if (val>0x1000) sprintf(s, "<"); + else sprintf(s, "<<"); + } + XDrawString(XtDisplay(trace), XtWindow(trace), gct, + pl[plane].ofs[CL_PI]+4,TRACEV_OFS+BAR_SPACE*ch+16,s,strlen(s)); + } +} + +static void drawInstname(int ch, char *name) { + int len; + if(!ctl->trace_playing) return; + if(plane!=0) return; + + XSetForeground(disp, gct, boxcolor); + XFillRectangle(XtDisplay(trace),XtWindow(trace),gct, + pl[plane].ofs[CL_IN]+2,TRACEV_OFS+BAR_SPACE*ch+2, + pl[plane].w[CL_IN] -4,BAR_HEIGHT); + XSetForeground(disp, gct, ((ISDRUMCHANNEL(ch))? capcolor:black)); + len = strlen(name); + XDrawString(XtDisplay(trace), XtWindow(trace), gct, + pl[plane].ofs[CL_IN]+4,TRACEV_OFS+BAR_SPACE*ch+15, + name,(len>disp_inst_name_len)? disp_inst_name_len:len); +} + +static void draw1Note(int ch,int note,int flag) { + int i, j; + XSegment dot[3]; + + j = note -9; + if (j<0) return; + if (flag == '*') { + XSetForeground(disp, gct, playcolor); + } else if (flag == '&') { + XSetForeground(disp, gct, + ((keyG[j].col == black)? suscolor:barcol[0])); + } else { + XSetForeground(disp, gct, keyG[j].col); + } + for(i= 0; i<3; i++) { + dot[i].x1 = keyG[j].xofs +i; + dot[i].y1 = TRACEV_OFS+ keyG[j].k[i].y+ ch*BAR_SPACE; + dot[i].x2 = dot[i].x1; + dot[i].y2 = dot[i].y1 + keyG[j].k[i].l; + } + XDrawSegments(XtDisplay(trace),XtWindow(trace),gct,dot,3); +} + +static void drawKeyboardAll(Display *disp,Drawable pix) { + int i, j; + XSegment dot[3]; + + XSetForeground(disp, gc, tracecolor); + XFillRectangle(disp,pix,gc,0,0,BARH_OFS8,BAR_SPACE); + XSetForeground(disp, gc, boxcolor); + XFillRectangle(disp,pix,gc,BARH_OFS8,0,TRACE_WIDTH-BARH_OFS8+1,BAR_SPACE); + for(i= 0; ixbutton.button == 1) || e->type == KeyPress) { + plane ^= 1; + redrawTrace(True); } } -static void drawTraceAll(void) { +/*ARGSUSED*/ +static void exchgWidth(Widget w,XEvent *e,String *v,Cardinal *n) { + exchgWidthCB(w,NULL,NULL); +} + +/*ARGSUSED*/ +static void redrawAction(Widget w,XEvent *e,String *v,Cardinal *n) { + redrawTrace(True); +} + +/*ARGSUSED*/ +static Boolean cursor_is_in = False; +static void redrawCaption(Widget w,XEvent *e,String *v,Cardinal *n) { + char *p; int i; - Dimension w, h; - if (!ctl->trace_playing) return; - XtVaGetValues(trace,XtNheight,&h,NULL); - XtVaGetValues(trace,XtNwidth,&w,NULL); - XSetForeground(disp, gct, bgcolor.pixel); - XFillRectangle(XtDisplay(trace),XtWindow(trace),gct,0,0,w,h); - for(i=0; ictotal[i] != 0 && Panel->c_flags[i] & FLAG_PROG_ON) - draw1Chan(i,Panel->ctotal[i],'*'); - XSetForeground(disp, gct, fgpan.pixel); - for(i=0; ic_flags[i] & FLAG_PAN) - drawPan(i,Panel->channel[i].panning,False); + if(e->type == EnterNotify) { + cursor_is_in = True; + XSetForeground(disp, gct, capcolor); + } else { + cursor_is_in = False; + XSetForeground(disp, gct, tracecolor); } - XSetForeground(disp, gct, fgstr.pixel); - for(i=0; itype == EnterNotify)? expcolor:tracecolor); + XSetForeground(disp, gct, (e->type == EnterNotify)? tracecolor:capcolor); + for(i=0; itrace_playing) return; + if(!XtIsRealized(trace)) return; + + XtVaGetValues(trace,XtNheight,&h1,NULL); + XtVaGetValues(trace,XtNwidth,&w1,NULL); + XSetForeground(disp, gct, tracecolor); + XFillRectangle(disp,XtWindow(trace),gct, 0,0,w1,h1); + XSetForeground(disp, gct, boxcolor); + XFillRectangle(disp,XtWindow(trace),gct, + BARH_OFS8 -1,TRACEV_OFS, TRACE_WIDTH-BARH_OFS8+1, + BAR_SPACE*MAX_XAW_MIDI_CHANNELS); + for(i= 0; ictotal[i] != 0 && Panel->c_flags[i] & FLAG_PROG_ON) + draw1Chan(i,Panel->ctotal[i],'*'); + XSetForeground(disp, gct, pancolor); + for(i=0; ic_flags[i] & FLAG_PAN) + drawPan(i,Panel->channel[i].panning,False); + } + XSetForeground(disp, gct, black); + for(i=0; ichannel[i].program,CL_PR,pl[plane].ofs[4],False); + drawVol(i,Panel->channel[i].volume); + drawExp(i,Panel->channel[i].expression); + if (plane) { + drawBank(i,Panel->channel[i].bank); + drawReverb(i,Panel->reverb[i]); + drawChorus(i,Panel->channel[i].chorus_level); + } else { + drawPitch(i,Panel->channel[i].pitchbend); + drawInstname(i, inst_name[i]); + } + } } } -void initTraceWindow(Boolean draw) { +static void initStatus(void) { int i; + if(!ctl->trace_playing) return; for(i=0; ichannel[i].program= 0; + Panel->channel[i].volume= 0; Panel->channel[i].sustain= 0; Panel->channel[i].expression= 0; + Panel->channel[i].pitchbend= 0; Panel->channel[i].panning= -1; Panel->ctotal[i] = 0; Panel->cvel[i] = 0; + Panel->bank[i] = 0; + Panel->reverb[i] = 0; + Panel->channel[i].chorus_level = 0; Panel->v_flags[i] = 0; Panel->c_flags[i] = 0; + *inst_name[i] = '\0'; } - if (draw) - drawTraceAll(); } /*ARGSUSED*/ @@ -1175,6 +1641,7 @@ } } } + #ifdef OFFIX static void FileDropedHandler(Widget widget ,XtPointer data,XEvent *event,Boolean *b) { @@ -1218,7 +1685,10 @@ {"fix-menu", (XtActionProc)filemenuCB}, {"do-complete", (XtActionProc)completeDir}, {"do-chgdir", (XtActionProc)setDirAction}, - {"draw-trace",(XtActionProc)drawTraceAll}, + {"draw-trace",(XtActionProc)redrawAction}, + {"do-exchange",(XtActionProc)exchgWidth}, + {"do-toggletrace",(XtActionProc)toggletrace}, + {"do-revcaption",(XtActionProc)redrawCaption}, #ifdef ENABLE_KEY_TRANSLATION {"do-dialog-button",(XtActionProc)popdownLoad}, {"do-load",(XtActionProc)popupLoad}, @@ -1237,70 +1707,53 @@ #endif {"do-volset",(XtActionProc)volsetCB}, {"do-volupdown",(XtActionProc)volupdownAction}, + {"do-resize",(XtActionProc)resizeAction}, }; -#define XAW_WIDTH "380" static String fallback_resources[]={ "*Label.font: -adobe-helvetica-bold-o-*-*-14-*-75-75-*-*-*-*", "*Text*fontSet: -misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*", "*Text*background: gray85", - "*Text*scrollbar*background: gray75", + "*Text*scrollbar*background: gray76", "*Scrollbar*background: gray85", "*Label.foreground: black", "*Label.background: #CCFF33", - "*MenuButton.background: #CCFF33", + "*Dialog*background: gray90", "*Command.background: gray85", - "*Dialog*background: gray75", - "*load_dialog.OK.background: gray85", - "*load_dialog.Cancel.background: gray85", - "*files.background: gray85", - "*clip.background: gray85", - "*Command.foreground: MediumBlue", - "*Toggle.background: gray85", - "*Toggle.foreground: MediumBlue", - "*random_button.foreground: MidnightBlue", - "*repeat_button.foreground: MidnightBlue", "*Command.font: -adobe-helvetica-medium-o-*-*-12-*-75-75-*-*-*-*", "*Toggle.font: -adobe-helvetica-medium-o-*-*-12-*-75-75-*-*-*-*", "*MenuButton.translations:: highlight()\\n\ : reset()\\n\ Any: reset() fix-menu() PopupMenu()", - "*base_form.background: gray75", - "*menu_box.background: gray75", "*menu_box.borderWidth: 0", - "*button_box.background: gray75", "*button_box.borderWidth: 0", "*button_box.horizDistance: 4", "*file_menubutton.menuName: file_simplemenu", "*file_menubutton.label: file...", - "*MenuButton.font: -adobe-helvetica-bold-o-*-*-12-*-75-75-*-*-*-*", "*file_menubutton.width: 60", "*file_menubutton.height: 28", "*file_menubutton.horizDistance: 6", "*file_menubutton.vertDistance: 4", "*file_simplemenu.SmeBSB.font: -adobe-helvetica-medium-r-*-*-12-*-75-75-*-*-*-*", "*title_simplemenu.SmeBSB.font: -adobe-helvetica-medium-r-*-*-12-*-75-75-*-*-*-*", - "*file_simplemenu.background: Gray85", - "*title_simplemenu.background: Gray85", "*file_simplemenu.width: 196", "*title_simplemenu.width: 200", "*title_menubutton.menuName: title_simplemenu", "*title_menubutton.label: ------", - "*title_menubutton.width: 200", + "*title_menubutton.width: 210", "*title_menubutton.height: 28", "*title_menubutton.resize: false", "*title_menubutton.horizDistance: 6", "*title_menubutton.vertDistance: 4", "*title_menubutton.fromHoriz: file_menubutton", "*time_label.width: 96", - "*time_label.height: 28", + "*time_label.height: 26", "*time_label.resize: false", "*time_label.fromHoriz: title_menubutton", "*time_label.horizDistance: 1", "*time_label.vertDistance: 4", "*time_label.label: 00:00 / -----", - "*button_box.height: 42", - "*button_box.width: " XAW_WIDTH , + "*button_box.height: 40", "*play_button.width: 32", "*play_button.height: 32", "*play_button.horizDistance: 1", @@ -1342,25 +1795,16 @@ "*repeat_button.horizDistance: 1", "*repeat_button.vertDistance: 1", "*lyric_text.fromVert: volume_box", - "*lyric_text.width: " XAW_WIDTH , + "*lyric_text.borderWidth: 1" , "*lyric_text.vertDistance: 4", #ifndef WIDGET_IS_LABEL_WIDGET "*lyric_text.horizDistance: 6", "*lyric_text.height: 120", - "*lyric_text.background: gray85", - "*lyric_text.foreground: black", "*lyric_text.scrollVertical: WhenNeeded", - /* "*lyric_text.resize: XawtextResizeBoth",*/ #else "*lyric_text.height: 30", - "*lyric_text.fontSet: -*-*-medium-r-normal--14-*", "*lyric_text.label: MessageWindow", - "*lyric_text.resize: false", - "*trace.width: 372", - "*trace.height: 180", - "*trace.borderWidth: 1", - "*trace.background: gray85", - "*trace.vertDistance: 2", + "*lyric_text.resize: true", "*lyric_text.horizDistance: 6", #endif #ifdef I18N @@ -1368,30 +1812,33 @@ #else "*lyric_text.international: False", #endif - "*volume_box.width: " XAW_WIDTH , - "*volume_box.height: 48", - "*volume_box.background: gray75", - "*volume_label.background: gray75", + "*volume_box.height: 36", + "*volume_box.background: gray76", + "*volume_label.background: gray76", "*volume_label.vertDistance: 0", "*volume_box.vertDistance: 2", "*volume_box.borderWidth: 0", "*volume_label.font: -adobe-helvetica-bold-r-*-*-12-*-75-75-*-*-*-*", "*volume_label.borderWidth: 0", "*volume_label.label: Volume 70", - "*volume_label.width: 300", + "*volume_label.borderWIdth: 1", "*volume_bar.length: 350", "*popup_load.title: Timidity ", "*popup_loadform.height: 400", - "*popup_loadform.background: gray75", "*load_dialog.label: File Name", - "*load_dialog*background: gray75", + "*load_dialog.label.background: gray85", + "*load_dialog*background: gray76", "*load_dialog.borderWidth: 0", "*load_dialog.height: 132", "*cwd_label.background: gray85", + "*trace.vertDistance: 2", + "*trace.borderWidth: 1", + "*trace_vport.borderWidth: 1", + "*trace_vport.background: gray76", "*load_dialog.label.font: -adobe-helvetica-bold-r-*-*-14-*-75-75-*-*-*-*", "*cwd_label.font: -adobe-helvetica-medium-r-*-*-12-*-75-75-*-*-*-*", "*cwd_info.font: -adobe-helvetica-medium-r-*-*-12-*-75-75-*-*-*-*", - "*cwd_info.background: gray75", + "*cwd_info.background: gray76", "*BitmapDir: " DEFAULT_PATH "/bitmaps/", #ifndef XAW3D "*volume_bar.translations: #override\\n\ @@ -1440,9 +1887,12 @@ ~Shifto: do-voice()\\n\ ~Ctrl Shifto: do-voice(1)\\n\ ~Ctrl ~Shiftv: do-volupdown(-10)\\n\ - ~Ctrl Shiftv: do-volupdown(10)", + ~Ctrl Shiftv: do-volupdown(10)\\n\ + ~Ctrlx: do-exchange()\\n\ + ~Ctrlt: do-toggletrace()\\n\ + : do-resize()", - "*load_dialog.value.translations: #override\ + "*load_dialog.value.translations: #override\\n\ ~CtrlReturn: do-chgdir()\\n\ ~CtrlKP_Enter: do-chgdir()\\n\ ~Ctrl ~MetaTab: do-complete() end-of-line()\\n\ @@ -1454,39 +1904,61 @@ "*file_simplemenu.quit.label: Quit", #endif "*trace.translations: #override\\n\ + : do-toggletrace()\\n\ + : do-revcaption()\\n\ + : do-revcaption()\\n\ : draw-trace()", NULL, }; XtAppContext app_con; char cbuf[PATH_MAX]; Pixmap bmPixmap; - char *statusfontstr= "7x14"; int bmwidth, bmheight; - int i; + int i, j, k, tmpi; int argc=1; float thumb, l_thumb; char *argv="timidity"; - + XFontStruct *labelfont,*volumefont,*tracefont; +#ifdef I18N + #define XtNfontDEF XtNfontSet + XFontSet textfont; +#else + #define XtNfontDEF XtNfont + XFontStruct *textfont; +#endif XawListReturnStruct lrs; +#ifdef DEBUG_PRINT_RESOURCE + for(i=0; fallback_resources[i] != NULL; i++) { + fprintf(stderr, "%s\n", fallback_resources[i++]); + } + exit(0); +#endif #ifdef I18N XtSetLanguageProc(NULL,NULL,NULL); #endif toplevel=XtVaAppInitialize(&app_con,APP_CLASS,NULL,ZERO,&argc,&argv, fallback_resources,NULL); - /*XtVaGetApplicationResources(toplevel,(caddr_t)&app_resources,resources, - XtNumber(resources),NULL); + XtGetApplicationResources(toplevel,(caddr_t)&app_resources,resources, + XtNumber(resources),NULL,0); bitmapdir = app_resources.bitmap_dir; - arrangetitle = app_resources.arrange_title;*/ + arrangetitle = app_resources.arrange_title; + text_height = (Dimension)app_resources.text_height; + trace_width = (Dimension)app_resources.trace_width; + trace_height = (Dimension)app_resources.trace_height; + labelfont = app_resources.label_font; + volumefont = app_resources.volume_font; + textfont = app_resources.text_font; + tracefont = app_resources.trace_font; a_readconfig(&Cfg); disp = XtDisplay(toplevel); screen = DefaultScreen(disp); root_height = DisplayHeight(disp, screen); root_width = DisplayWidth(disp, screen); check_mark = XCreateBitmapFromData(XtDisplay(toplevel), - RootWindowOfScreen(XtScreen(toplevel)), - (char *) check_bits, - check_width,check_height); + RootWindowOfScreen(XtScreen(toplevel)), + (char *) check_bits, + check_width,check_height); for(i= 0; i < MAXBITMAP; i++) { snprintf(cbuf,sizeof(cbuf),"%s/%s",bitmapdir,bmfname[i]); XReadBitmapFile(disp,RootWindow(disp,screen),cbuf,&bm_width[i],&bm_height[i], @@ -1504,27 +1976,59 @@ DndRegisterIconDrop(FileDropedHandler); #endif XtAppAddActions(app_con, actions, XtNumber(actions)); - base_f=XtVaCreateManagedWidget("base_form",boxWidgetClass,toplevel,NULL); + + bgcolor = app_resources.common_bgcolor; + menubcolor = app_resources.menub_bgcolor; + textcolor = app_resources.common_fgcolor; + textbgcolor = app_resources.text_bgcolor; + text2bgcolor = app_resources.text2_bgcolor; + buttonbgcolor = app_resources.button_bgcolor; + buttoncolor = app_resources.button_fgcolor; + togglecolor = app_resources.toggle_fgcolor; + if(ctl->trace_playing) { + volcolor = app_resources.volume_color; + expcolor = app_resources.expr_color; + pancolor = app_resources.pan_color; + tracecolor = app_resources.trace_bgcolor; + } + base_f=XtVaCreateManagedWidget("base_form",boxWidgetClass,toplevel, + XtNbackground,bgcolor, + XtNwidth,rotatewidth[currwidth], NULL); m_box=XtVaCreateManagedWidget("menu_box",boxWidgetClass,base_f, - XtNorientation, XtorientHorizontal, - NULL); - file_mb=XtVaCreateManagedWidget("file_menubutton",menuButtonWidgetClass,m_box,NULL); - file_sm=XtVaCreatePopupShell("file_simplemenu",simpleMenuWidgetClass,file_mb,NULL); - title_mb=XtVaCreateManagedWidget("title_menubutton",menuButtonWidgetClass,m_box,NULL); - title_sm=XtVaCreatePopupShell("title_simplemenu",simpleMenuWidgetClass,title_mb,NULL); - time_l=XtVaCreateManagedWidget("time_label",labelWidgetClass,m_box,NULL); + XtNorientation,XtorientHorizontal, + XtNbackground,bgcolor, NULL); + file_mb=XtVaCreateManagedWidget("file_menubutton",menuButtonWidgetClass,m_box, + XtNforeground,textcolor, XtNbackground,menubcolor, + XtNfont,labelfont, NULL); + file_sm=XtVaCreatePopupShell("file_simplemenu",simpleMenuWidgetClass,file_mb, + XtNforeground,textcolor, XtNbackground,textbgcolor, + NULL); + title_mb=XtVaCreateManagedWidget("title_menubutton",menuButtonWidgetClass,m_box, + XtNforeground,textcolor, XtNbackground,menubcolor, + XtNfont,labelfont, NULL); + title_sm=XtVaCreatePopupShell("title_simplemenu",simpleMenuWidgetClass,title_mb, + XtNforeground,textcolor, XtNbackground,textbgcolor, + NULL); + time_l=XtVaCreateManagedWidget("time_label",commandWidgetClass,m_box, + XtNfont,labelfont, + XtNbackground,menubcolor,NULL); b_box=XtVaCreateManagedWidget("button_box",boxWidgetClass,base_f, - XtNorientation, XtorientHorizontal, - XtNfromVert,m_box,NULL); + XtNorientation,XtorientHorizontal, + XtNwidth,rotatewidth[currwidth]-10, + XtNbackground,bgcolor,XtNfromVert,m_box, NULL); v_box=XtVaCreateManagedWidget("volume_box",boxWidgetClass,base_f, - XtNfromVert,b_box,NULL); + XtNorientation,XtorientHorizontal, + XtNwidth, TRACE_WIDTH_SHORT, + XtNfromVert,b_box,XtNbackground,bgcolor, NULL); vol_l=XtVaCreateManagedWidget("volume_label",labelWidgetClass,v_box, - NULL); + XtNwidth, VOLUME_LABEL_WIDTH, + XtNfont,volumefont, + XtNforeground,textcolor, XtNbackground,bgcolor, NULL); vol_bar=XtVaCreateManagedWidget("volume_bar",scrollbarWidgetClass,v_box, - XtNorientation, XtorientHorizontal, - XtNfromVert,vol_l, - XtNtopOfThumb, &l_thumb, - NULL); + XtNorientation, XtorientHorizontal, + XtNwidth, TRACE_WIDTH_SHORT -VOLUME_LABEL_WIDTH -20, + XtNbackground,textbgcolor, + XtNfromVert,vol_l, XtNtopOfThumb,&l_thumb, NULL); l_thumb = thumb = (float)amplitude / (float)MAXVOLUME; if (sizeof(thumb) > sizeof(XtArgVal)) { XtVaSetValues(vol_bar,XtNtopOfThumb,&thumb,NULL); @@ -1533,71 +2037,91 @@ XtVaSetValues(vol_bar,XtNtopOfThumb,*l_thumb,NULL); } play_b=XtVaCreateManagedWidget("play_button",toggleWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_PLAY], - NULL); + XtNbitmap,bm_Pixmap[BM_PLAY], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + NULL); pause_b=XtVaCreateManagedWidget("pause_button",toggleWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_PAUSE], - XtNfromHoriz, play_b, - NULL); + XtNbitmap,bm_Pixmap[BM_PAUSE], + XtNfromHoriz, play_b, + XtNforeground,togglecolor, XtNbackground,buttonbgcolor, + NULL); stop_b=XtVaCreateManagedWidget("stop_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_STOP], - XtNfromHoriz,pause_b,NULL); + XtNbitmap,bm_Pixmap[BM_STOP], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,pause_b,NULL); prev_b=XtVaCreateManagedWidget("prev_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_PREV], - XtNfromHoriz,stop_b,NULL); + XtNbitmap,bm_Pixmap[BM_PREV], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,stop_b,NULL); back_b=XtVaCreateManagedWidget("back_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_BACK], - XtNfromHoriz,prev_b,NULL); + XtNbitmap,bm_Pixmap[BM_BACK], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,prev_b,NULL); fwd_b=XtVaCreateManagedWidget("fwd_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_FWRD], - XtNfromHoriz,back_b,NULL); + XtNbitmap,bm_Pixmap[BM_FWRD], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,back_b,NULL); next_b=XtVaCreateManagedWidget("next_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_NEXT], - XtNfromHoriz,fwd_b,NULL); + XtNbitmap,bm_Pixmap[BM_NEXT], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,fwd_b,NULL); quit_b=XtVaCreateManagedWidget("quit_button",commandWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_QUIT], - XtNfromHoriz,next_b,NULL); + XtNbitmap,bm_Pixmap[BM_QUIT], + XtNforeground,buttoncolor, XtNbackground,buttonbgcolor, + XtNfromHoriz,next_b,NULL); random_b=XtVaCreateManagedWidget("random_button",toggleWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_RANDOM], - XtNfromHoriz,quit_b, - NULL); + XtNbitmap,bm_Pixmap[BM_RANDOM], + XtNfromHoriz,quit_b, + XtNforeground,togglecolor, XtNbackground,buttonbgcolor, + NULL); repeat_b=XtVaCreateManagedWidget("repeat_button",toggleWidgetClass,b_box, - XtNbitmap,bm_Pixmap[BM_REPEAT], - XtNfromHoriz,random_b, - NULL); - + XtNbitmap,bm_Pixmap[BM_REPEAT], + XtNfromHoriz,random_b, + XtNforeground,togglecolor, XtNbackground,buttonbgcolor, + NULL); popup_load=XtVaCreatePopupShell("popup_load",transientShellWidgetClass,toplevel, - NULL); + NULL); popup_load_f= XtVaCreateManagedWidget("popup_loadform",formWidgetClass,popup_load, - NULL); + XtNbackground,textbgcolor, NULL); load_d=XtVaCreateManagedWidget("load_dialog",dialogWidgetClass,popup_load_f, - XtNresizable, True, - NULL); + XtNbackground,textbgcolor, XtNresizable,True, NULL); cwd_l = XtVaCreateManagedWidget("cwd_label",labelWidgetClass,popup_load_f, - XtNlabel,basepath, XtNborderWidth,0, XtNfromVert,load_d, - XtNresizable,True, NULL); + XtNlabel,basepath, XtNborderWidth,0, XtNfromVert,load_d, + XtNbackground,text2bgcolor, XtNresizable,True, NULL); load_vport = XtVaCreateManagedWidget("vport",viewportWidgetClass, popup_load_f, - XtNfromVert,cwd_l, XtNallowHoriz,True, XtNallowVert,True, - XtNwidth,250, XtNheight,200, NULL); + XtNfromVert,cwd_l, XtNallowHoriz,True, XtNallowVert,True, + XtNwidth,250, XtNheight,200, NULL); load_flist = XtVaCreateManagedWidget("files",listWidgetClass,load_vport, - XtNverticalList,True, XtNforceColumns,False, - XtNdefaultColumns, 3, NULL); + XtNverticalList,True, XtNforceColumns,False, + XtNdefaultColumns, 3, NULL); load_info = XtVaCreateManagedWidget("cwd_info",labelWidgetClass,popup_load_f, - XtNborderWidth,0, XtNwidth,250, XtNheight,32, - XtNfromVert,load_vport, NULL); + XtNborderWidth,0, XtNwidth,250, XtNheight,32, + XtNbackground,text2bgcolor, XtNfromVert,load_vport, NULL); XawDialogAddButton(load_d, "OK", popdownLoad,"Y"); XawDialogAddButton(load_d, "Cancel", popdownLoad,NULL); #ifndef WIDGET_IS_LABEL_WIDGET lyric_t=XtVaCreateManagedWidget("lyric_text",asciiTextWidgetClass,base_f, - XtNwrap,XawtextWrapWord, XtNeditType,XawtextAppend, - XtNfromVert,v_box, NULL); + XtNwrap,XawtextWrapWord, XtNeditType,XawtextAppend, + XtNwidth, rotatewidth[currwidth]-10, #else - lyric_t=XtVaCreateManagedWidget("lyric_text",labelWidgetClass,base_f,NULL); + lyric_t=XtVaCreateManagedWidget("lyric_text",labelWidgetClass,base_f, + XtNresize, False, + XtNforeground,textcolor, XtNbackground,menubcolor, + XtNwidth,rotatewidth[currwidth]-10, #endif + XtNfontDEF,textfont, XtNheight,text_height, + XtNfromVert,v_box, NULL); if(ctl->trace_playing) { - trace=XtVaCreateManagedWidget("trace",widgetClass,base_f, - XtNfromVert,lyric_t,NULL); - XtVaSetValues(trace,XtNwidth,trace_width,XtNheight,trace_height,NULL); + trace_vport = XtVaCreateManagedWidget("trace_vport",viewportWidgetClass, base_f, + XtNallowHoriz,True, XtNallowVert,True, + XtNuseBottom,True,XtNfromVert,lyric_t, +#ifdef WIDGET_IS_LABEL_WIDGET + XtNuseRight,True, +#endif + XtNwidth,trace_width, XtNheight,trace_height+12, NULL); + trace = XtVaCreateManagedWidget("trace",widgetClass,trace_vport, + XtNwidth,trace_width, + XtNheight,BAR_SPACE*MAX_XAW_MIDI_CHANNELS+TRACEV_OFS, NULL); } XtAddCallback(quit_b,XtNcallback,quitCB,NULL); XtAddCallback(play_b,XtNcallback,playCB,NULL); @@ -1613,15 +2137,17 @@ XtAddCallback(vol_bar,XtNscrollProc,volupdownCB,NULL); XtAppAddInput(app_con,pipe_in,(XtPointer)XtInputReadMask,handle_input,NULL); XtAddCallback(load_flist,XtNcallback,(XtCallbackProc)setDirList,cwd_l); + XtAddCallback(time_l,XtNcallback,(XtCallbackProc)exchgWidthCB,NULL); XtRealizeWidget(toplevel); - dirlist =(String *)malloc(sizeof(String)* MAX_DIRECTORY_ENTRY); dirlist[0] = (char *)NULL; lrs.string = ""; setDirList(load_flist, cwd_l, &lrs); XtSetKeyboardFocus(base_f, base_f); XtSetKeyboardFocus(lyric_t, base_f); + if(ctl->trace_playing) + XtSetKeyboardFocus(trace, base_f); XtSetKeyboardFocus(popup_load, load_d); XtOverrideTranslations (toplevel, XtParseTranslationTable ("WM_PROTOCOLS: do-quit()")); @@ -1640,22 +2166,85 @@ if(ctl->trace_playing) { Panel = (PanelInfo *)safe_malloc(sizeof(PanelInfo)); gct = XCreateGC(disp, RootWindow(disp, screen), 0, NULL); - XAllocNamedColor(disp,DefaultColormap(disp, screen),"green",&fgtmp,&defcolor); - XAllocNamedColor(disp,DefaultColormap(disp, screen),"red",&bgcolor,&defcolor); + gc = XCreateGC(disp, RootWindow(disp, screen), 0, NULL); for(i=0; ifid); + + keyG = (ThreeL *)safe_malloc(sizeof(ThreeL) * KEY_NUM); + for(i=0, j= BARH_OFS8+1; ifid); - initTraceWindow(False); + + /* draw on template pixmaps that includes one channel row */ + for(i=0; i<2; i++) { + layer[i] = XCreatePixmap(disp,XtWindow(trace),TRACE_WIDTH,BAR_SPACE, + DefaultDepth(disp,screen)); + drawKeyboardAll(disp, layer[i]); + XSetForeground(disp, gc, capcolor); + XDrawLine(disp,layer[i],gc,0,0,TRACE_WIDTH,0); + XDrawLine(disp,layer[i],gc,0,0,0,BAR_SPACE); + XDrawLine(disp,layer[i],gc,TRACE_WIDTH-1,0,TRACE_WIDTH-1,BAR_SPACE); + + for(j=0; jtrace_playing) + if(!ctl->trace_playing) { + Dimension w2,h2; XtVaSetValues(file_menu[ID_HIDETRACE-100].widget,XtNsensitive,False,NULL); + XtVaSetValues(lyric_t,XtNwidth,TRACE_WIDTH_SHORT -12,NULL); + XtVaGetValues(toplevel,XtNheight,&i,NULL); + XtMakeResizeRequest(toplevel,TRACE_WIDTH_SHORT,i,&w2,&h2); + } + /* Please sleep here to make widgets arrange by Form Widget, + * otherwise the widget geometry is broken. + * Strange!! + */ if(Cfg.hidetext || !Cfg.disptrace) { - /* Please sleep here, otherwise the widget geometry is broken. - * Strange!! - */ - XSync(disp, False); - sleep(1); - } - if (Cfg.autostart) filemenuCB(file_menu[ID_AUTOSTART-100].widget, - &file_menu[ID_AUTOSTART-100].id,NULL); - if (Cfg.hidetext) filemenuCB(file_menu[ID_HIDETXT-100].widget, - &file_menu[ID_HIDETXT-100].id,NULL); - if (!Cfg.disptrace) filemenuCB(file_menu[ID_HIDETRACE-100].widget, - &file_menu[ID_HIDETRACE-100].id,NULL); - - if (Cfg.repeat) repeatCB(NULL,&Cfg.repeat,NULL); - if (Cfg.shuffle) randomCB(NULL,&Cfg.shuffle,NULL); - if (Cfg.autostart) + XSync(disp, False); + usleep(10000); + } + if(Cfg.autostart) + filemenuCB(file_menu[ID_AUTOSTART-100].widget, + &file_menu[ID_AUTOSTART-100].id,NULL); + if(Cfg.hidetext) + filemenuCB(file_menu[ID_HIDETXT-100].widget, + &file_menu[ID_HIDETXT-100].id,NULL); + if(!Cfg.disptrace) + filemenuCB(file_menu[ID_HIDETRACE-100].widget, + &file_menu[ID_HIDETRACE-100].id,NULL); + + if(Cfg.repeat) repeatCB(NULL,&Cfg.repeat,NULL); + if(Cfg.shuffle) randomCB(NULL,&Cfg.shuffle,NULL); + if(Cfg.autostart) playCB(NULL,NULL,NULL); else stopCB(NULL,NULL,NULL); + if(ctl->trace_playing) initStatus(); XtAppMainLoop(app_con); } diff -ruN TiMidity++-1.2.1/libarc/Makefile.in TiMidity++-1.3.0/libarc/Makefile.in --- TiMidity++-1.2.1/libarc/Makefile.in Mon Jan 25 21:30:22 1999 +++ TiMidity++-1.3.0/libarc/Makefile.in Wed Feb 3 07:27:45 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ @@ -281,6 +282,8 @@ ../utils/memb.h ../utils/mblock.h url.h arc_mime.o: arc_mime.c ../config.h ../timidity/timidity.h \ ../utils/mblock.h zip.h arc.h ../utils/memb.h url.h +arc_newsgroup.o: arc_newsgroup.c ../config.h ../timidity/timidity.h \ + arc.h ../utils/memb.h ../utils/mblock.h url.h arc_tar.o: arc_tar.c ../config.h ../timidity/timidity.h \ ../utils/mblock.h zip.h arc.h ../utils/memb.h url.h arc_zip.o: arc_zip.c ../config.h ../timidity/timidity.h arc.h \ @@ -301,11 +304,19 @@ url_dir.o: url_dir.c ../config.h ../timidity/timidity.h url.h \ ../utils/strtab.h ../utils/mblock.h url_file.o: url_file.c ../config.h ../timidity/timidity.h url.h +url_ftp.o: url_ftp.c ../config.h ../timidity/timidity.h url.h \ + ../utils/net.h url_hqxdecode.o: url_hqxdecode.c ../config.h ../timidity/timidity.h \ url.h +url_http.o: url_http.c ../config.h ../timidity/timidity.h url.h \ + ../utils/net.h url_inflate.o: url_inflate.c ../config.h ../timidity/timidity.h url.h \ ../utils/mblock.h zip.h url_mem.o: url_mem.c ../config.h ../timidity/timidity.h url.h +url_news.o: url_news.c ../config.h ../timidity/timidity.h url.h \ + ../utils/net.h +url_newsgroup.o: url_newsgroup.c ../config.h ../timidity/timidity.h \ + url.h ../utils/net.h url_pipe.o: url_pipe.c ../config.h ../timidity/timidity.h url.h url_qsdecode.o: url_qsdecode.c ../config.h ../timidity/timidity.h url.h url_uudecode.o: url_uudecode.c ../config.h ../timidity/timidity.h url.h diff -ruN TiMidity++-1.2.1/libarc/arc.h TiMidity++-1.3.0/libarc/arc.h --- TiMidity++-1.2.1/libarc/arc.h Mon Nov 2 12:29:06 1998 +++ TiMidity++-1.3.0/libarc/arc.h Wed Jan 27 12:16:16 1999 @@ -5,7 +5,7 @@ #include "memb.h" -#define ARC_LIB_VERSION "1.4.10" +#define ARC_LIB_VERSION "1.4.11" #define ARC_DEFLATE_LEVEL 6 /* 1:Compress faster .. 9:Compress better */ typedef struct _ArchiveStreamURL diff -ruN TiMidity++-1.2.1/libarc/arc_mime.c TiMidity++-1.3.0/libarc/arc_mime.c --- TiMidity++-1.2.1/libarc/arc_mime.c Mon Nov 2 12:29:06 1998 +++ TiMidity++-1.3.0/libarc/arc_mime.c Wed Jan 27 12:14:50 1999 @@ -100,15 +100,26 @@ *p++ = '\0'; while(*p == ' ') p++; - if(strcasecmp(hdr.value, "multipart/mixed") == 0) + if(strncasecmp(hdr.value, "multipart/mixed", 15) == 0) { /* Content-Type: multipart/mixed; boundary="XXXX" */ - if(strncasecmp(p, "boundary=\"", 10) == 0) + if(strncasecmp(p, "boundary=", 9) == 0) { - p += 10; - new_boundary = p; - if((p = strchr(p, '"')) == NULL) - continue; + p += 9; + if(*p == '"') + { + p++; + new_boundary = p; + if((p = strchr(p, '"')) == NULL) + continue; + } + else + { + new_boundary = p; + while(*p > '"' && *p < 0x7f) + p++; + } + *p = '\0'; new_boundary = strdup_mblock(&pool, new_boundary); } diff -ruN TiMidity++-1.2.1/libarc/url.c TiMidity++-1.3.0/libarc/url.c --- TiMidity++-1.2.1/libarc/url.c Mon Nov 2 12:29:06 1998 +++ TiMidity++-1.3.0/libarc/url.c Tue Feb 2 15:52:11 1999 @@ -485,7 +485,7 @@ char *url_strerror(int no) { if(no <= URLERR_NONE) - return (char *)sys_errlist[no]; + return strerror(no); if(no >= URLERR_MAXNO) return "Internal error"; return url_strerror_txt[no - URLERR_NONE]; diff -ruN TiMidity++-1.2.1/libarc/url_dir.c TiMidity++-1.3.0/libarc/url_dir.c --- TiMidity++-1.2.1/libarc/url_dir.c Mon Nov 2 12:29:06 1998 +++ TiMidity++-1.3.0/libarc/url_dir.c Wed Feb 3 06:29:13 1999 @@ -11,20 +11,32 @@ #include "timidity.h" #include "url.h" -#ifdef __WIN32__ + +#ifdef __W32_READDIR__ #include "readdir.h" +# define NAMLEN(dirent) strlen((dirent)->d_name) #else -#include -#if defined(sun) -#include -#elif defined(SVR4) || defined(SYSTYPE_SVR4) || defined(__svr4__) -#include -#define dirent direct + +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) #else -#include +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif #endif + #endif + #ifdef URL_DIR_CACHE_ENABLE #include #include "strtab.h" @@ -79,12 +91,16 @@ init_string_table(&stab); while((d = readdir(dirp)) != NULL) { + int dlen; + /* Skip removed file. */ if(d->d_ino == 0) continue; + if((dlen = NAMLEN(d)) == 0) + continue; /* put into string table */ - if(put_string_table(&stab, d->d_name, strlen(d->d_name)) == NULL) + if(put_string_table(&stab, d->d_name, dlen) == NULL) { url_errno = errno; delete_string_table(&stab); @@ -376,6 +392,7 @@ } urlp->ptr = *urlp->fptr; urlp->fptr++; + urlp->len = strlen(urlp->ptr); #else do @@ -384,9 +401,10 @@ urlp->endp = 1; return NULL; } - while (urlp->d->d_ino == 0); + while (urlp->d->d_ino == 0 || + NAMLEN(urlp->d) == 0); urlp->ptr = urlp->d->d_name; + urlp->len = NAMLEN(urlp->d); #endif - urlp->len = strlen(urlp->ptr); } } diff -ruN TiMidity++-1.2.1/timidity/Makefile.am TiMidity++-1.3.0/timidity/Makefile.am --- TiMidity++-1.2.1/timidity/Makefile.am Thu Jan 21 00:18:36 1999 +++ TiMidity++-1.3.0/timidity/Makefile.am Wed Feb 3 06:36:26 1999 @@ -25,7 +25,6 @@ -I$(top_srcdir)/utils \ $(EXTRAINCS) - bin_PROGRAMS = timidity timidity_SOURCES = \ @@ -124,7 +123,7 @@ $(top_builddir)/libarc/libarc.a \ $(top_builddir)/utils/libutils.a -version.o: version.c Makefile +version.o: version.c ../configure $(CC) $(CFLAGS) -DTIMID_VERSION=\"$(VERSION)\" -c $(srcdir)/version.c $(top_builddir)/interface/libinterface.a: diff -ruN TiMidity++-1.2.1/timidity/Makefile.in TiMidity++-1.3.0/timidity/Makefile.in --- TiMidity++-1.2.1/timidity/Makefile.in Mon Jan 25 21:30:37 1999 +++ TiMidity++-1.3.0/timidity/Makefile.in Wed Feb 3 07:28:03 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ @@ -374,7 +375,8 @@ playmidi.o: playmidi.c ../config.h timidity.h common.h ../libarc/url.h \ ../utils/mblock.h instrum.h playmidi.h readmidi.h output.h \ mix.h controls.h miditrace.h recache.h ../libarc/arc.h \ - ../utils/memb.h reverb.h wrd.h tables.h + ../utils/memb.h reverb.h wrd.h ../interface/soundspec.h \ + tables.h raw_a.o: raw_a.c ../config.h timidity.h output.h controls.h rcp.o: rcp.c ../config.h timidity.h common.h ../libarc/url.h \ ../utils/mblock.h instrum.h playmidi.h readmidi.h controls.h @@ -404,8 +406,8 @@ timidity.o: timidity.c ../config.h ../interface.h timidity.h common.h \ ../libarc/url.h ../utils/mblock.h instrum.h playmidi.h \ readmidi.h output.h controls.h tables.h miditrace.h reverb.h \ - recache.h ../libarc/arc.h ../utils/memb.h ../utils/strtab.h \ - wrd.h mid.defs + ../interface/soundspec.h recache.h ../libarc/arc.h \ + ../utils/memb.h ../utils/strtab.h wrd.h mid.defs wave_a.o: wave_a.c ../config.h timidity.h output.h controls.h wrd_read.o: wrd_read.c ../config.h timidity.h common.h ../libarc/url.h \ ../utils/mblock.h instrum.h playmidi.h readmidi.h controls.h \ @@ -478,7 +480,7 @@ include $(top_builddir)/common.makefile -version.o: version.c Makefile +version.o: version.c ../configure $(CC) $(CFLAGS) -DTIMID_VERSION=\"$(VERSION)\" -c $(srcdir)/version.c $(top_builddir)/interface/libinterface.a: diff -ruN TiMidity++-1.2.1/timidity/aiff_a.c TiMidity++-1.3.0/timidity/aiff_a.c --- TiMidity++-1.2.1/timidity/aiff_a.c Mon Nov 30 16:54:53 1998 +++ TiMidity++-1.3.0/timidity/aiff_a.c Tue Feb 2 15:52:31 1999 @@ -143,7 +143,7 @@ if(dpm.fd < 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } } diff -ruN TiMidity++-1.2.1/timidity/au_a.c TiMidity++-1.3.0/timidity/au_a.c --- TiMidity++-1.2.1/timidity/au_a.c Mon Nov 30 16:55:03 1998 +++ TiMidity++-1.3.0/timidity/au_a.c Tue Feb 2 15:52:44 1999 @@ -128,7 +128,7 @@ if(dpm.fd < 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } comment = dpm.name; diff -ruN TiMidity++-1.2.1/timidity/audriv_al.c TiMidity++-1.3.0/timidity/audriv_al.c --- TiMidity++-1.2.1/timidity/audriv_al.c Mon Nov 30 17:10:58 1998 +++ TiMidity++-1.3.0/timidity/audriv_al.c Tue Feb 2 15:53:08 1999 @@ -83,7 +83,7 @@ #ifndef SGI_OLDAL #define ALERROR alGetErrorString(oserror()) #else -#define ALERROR sys_errlist[oserror()] +#define ALERROR strerror(oserror()) #endif /* SGI_OLDAL */ static void audriv_err(const char *msg) diff -ruN TiMidity++-1.2.1/timidity/audriv_sun.c TiMidity++-1.3.0/timidity/audriv_sun.c --- TiMidity++-1.2.1/timidity/audriv_sun.c Mon Nov 30 17:33:31 1998 +++ TiMidity++-1.3.0/timidity/audriv_sun.c Tue Feb 2 15:53:31 1999 @@ -92,9 +92,6 @@ static int internal_play_channels = 1; char audriv_errmsg[BUFSIZ]; -#ifndef __NetBSD__ -extern char *sys_errlist[]; -#endif static const long available_sample_rates[] = { @@ -153,7 +150,7 @@ static void audriv_syserr(const char *msg) { - sprintf(audriv_errmsg, "%s: %s", msg, sys_errlist[errno]); + sprintf(audriv_errmsg, "%s: %s", msg, strerror(errno)); if(audriv_error_handler != NULL) audriv_error_handler(audriv_errmsg); else diff -ruN TiMidity++-1.2.1/timidity/bsd20_a.c TiMidity++-1.3.0/timidity/bsd20_a.c --- TiMidity++-1.2.1/timidity/bsd20_a.c Mon Nov 30 17:33:20 1998 +++ TiMidity++-1.3.0/timidity/bsd20_a.c Tue Feb 2 15:53:48 1999 @@ -82,7 +82,7 @@ if ((fd=open(dpm.name, O_RDWR | O_NDELAY, 0)) < 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } diff -ruN TiMidity++-1.2.1/timidity/common.c TiMidity++-1.3.0/timidity/common.c --- TiMidity++-1.2.1/timidity/common.c Mon Jan 18 22:19:56 1999 +++ TiMidity++-1.3.0/timidity/common.c Wed Feb 3 05:23:57 1999 @@ -312,7 +312,7 @@ { if(noise_mode) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - current_filename, sys_errlist[errno]); + current_filename, strerror(errno)); return 0; } @@ -342,7 +342,7 @@ #endif /* __MACOS__ */ { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - current_filename, sys_errlist[errno]); + current_filename, strerror(errno)); return 0; } plp=plp->next; @@ -354,7 +354,7 @@ if (noise_mode>=2) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", name, - errno ? sys_errlist[errno] : "Can't open file"); + errno ? strerror(errno) : "Can't open file"); return 0; } @@ -427,7 +427,7 @@ return pos; } -static void safe_exit(int status) +void safe_exit(int status) { if(play_mode->fd != -1) { @@ -868,33 +868,3 @@ } return 0; } - -#ifndef HAVE_VSNPRINTF -void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap) -{ - MBlockList pool; - char *tmpbuf = buff; - - if(bufsiz < MIN_MBLOCK_SIZE) - { - init_mblock(&pool); - tmpbuf = (char *)new_segment(&pool, MIN_MBLOCK_SIZE); - } - vsprintf(tmpbuf, fmt, ap); - if(tmpbuf != buff) - { - strncpy(buff, tmpbuf, bufsiz); - reuse_mblock(&pool); - } -} -#endif /* HAVE_VSNPRINTF */ - -#ifndef HAVE_SNPRINTF -void snprintf(char *buff, size_t bufsiz, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - vsnprintf(buff, bufsiz, fmt, ap); - va_end(ap); -} -#endif /* HAVE_VSNPRINTF */ diff -ruN TiMidity++-1.2.1/timidity/common.h TiMidity++-1.3.0/timidity/common.h --- TiMidity++-1.2.1/timidity/common.h Sun Jan 17 07:28:30 1999 +++ TiMidity++-1.3.0/timidity/common.h Wed Feb 3 04:41:38 1999 @@ -78,9 +78,7 @@ extern void code_convert(char *in, char *out, int outsiz, char *in_code, char *out_code); -#ifndef HAVE_SNPRINTF -void snprintf(char *buff, size_t bufsiz, const char *fmt, ...); -#endif +extern void safe_exit(int status); extern char *timidity_version; extern MBlockList tmpbuffer; diff -ruN TiMidity++-1.2.1/timidity/dl_dlopen.c TiMidity++-1.3.0/timidity/dl_dlopen.c --- TiMidity++-1.2.1/timidity/dl_dlopen.c Mon Jan 25 20:28:52 1999 +++ TiMidity++-1.3.0/timidity/dl_dlopen.c Tue Feb 2 15:55:26 1999 @@ -18,7 +18,7 @@ #endif #ifdef __NetBSD__ -# define dlerror() sys_errlist[errno] +# define dlerror() strerror(errno) #endif diff -ruN TiMidity++-1.2.1/timidity/dl_hpux.c TiMidity++-1.3.0/timidity/dl_hpux.c --- TiMidity++-1.2.1/timidity/dl_hpux.c Wed Dec 16 15:42:11 1998 +++ TiMidity++-1.3.0/timidity/dl_hpux.c Tue Feb 2 16:06:31 1999 @@ -52,7 +52,7 @@ obj = shl_load(filename, bind_type | BIND_NOSTART, 0L); if(obj == NULL) { - fprintf(stderr, "%s\n", sys_errlist[errno]); + perror(filename); return NULL; } return (void *)obj; @@ -78,7 +78,7 @@ if(status == -1) { - fprintf(stderr, "%s\n", errno ? sys_errlist[errno] : "Symbol not found."); + fprintf(stderr, "%s\n", errno ? strerror(errno) : "Symbol not found."); return NULL; } return symaddr; diff -ruN TiMidity++-1.2.1/timidity/hpux_d_a.c TiMidity++-1.3.0/timidity/hpux_d_a.c --- TiMidity++-1.2.1/timidity/hpux_d_a.c Mon Nov 30 17:36:53 1998 +++ TiMidity++-1.3.0/timidity/hpux_d_a.c Tue Feb 2 15:56:12 1999 @@ -86,7 +86,7 @@ if(dpm.fd == -1) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } diff -ruN TiMidity++-1.2.1/timidity/linux_a.c TiMidity++-1.3.0/timidity/linux_a.c --- TiMidity++-1.2.1/timidity/linux_a.c Mon Nov 30 17:37:28 1998 +++ TiMidity++-1.3.0/timidity/linux_a.c Tue Feb 2 15:56:30 1999 @@ -154,7 +154,7 @@ if(ioctl(fd, FIONBIO, &arg) < 0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "ioctl:FIONBIO %s", - sys_errlist[errno]); + strerror(errno)); sleep(3); } } @@ -170,7 +170,7 @@ if (fd<0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } diff -ruN TiMidity++-1.2.1/timidity/mac_com.h TiMidity++-1.3.0/timidity/mac_com.h --- TiMidity++-1.2.1/timidity/mac_com.h Mon Nov 30 19:16:00 1998 +++ TiMidity++-1.3.0/timidity/mac_com.h Tue Feb 2 16:05:25 1999 @@ -36,7 +36,8 @@ #endif #endif -#define TIMID_VERSION "\p0.2i+AC3+R3.2.4 " TIMID_CPU +#define TIMID_VERSION "1.0.0 " TIMID_CPU +#define TIMID_VERSION_PASCAL "\p" TIMID_VERSION #define PI 3.14159265358979323846 @@ -50,7 +51,7 @@ #undef DEFAULT_RATE #define DEFAULT_RATE 22050 -#define AU_MAC +#define AU_MACOS #define BIG_ENDIAN #undef TILD_SCHEME_ENABLE #undef JAPANESE @@ -58,6 +59,7 @@ #define DEFAULT_PATH "" #undef CONFIG_FILE #define CONFIG_FILE DEFAULT_PATH "timidity.cfg" +#define ENABLE_SHERRY #define MAC_SOUNDBUF_QLENGTH (stdQLength*4) diff -ruN TiMidity++-1.2.1/timidity/mac_main.c TiMidity++-1.3.0/timidity/mac_main.c --- TiMidity++-1.2.1/timidity/mac_main.c Mon Nov 30 19:16:19 1998 +++ TiMidity++-1.3.0/timidity/mac_main.c Tue Feb 2 16:05:25 1999 @@ -134,13 +134,10 @@ DrawMenuBar(); } -int main() +static void mac_init() { - EventRecord event; - int32 output_rate=DEFAULT_RATE; long gestaltResponse; - int err; - + InitGraf( &qd.thePort ); InitFonts(); FlushEvents( everyEvent,0 ); @@ -172,9 +169,17 @@ AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerProc(myHandleODOC), 0, false); AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, - NewAEEventHandlerProc(myHandleQUIT), 0, false); - + NewAEEventHandlerProc(myHandleQUIT), 0, false); InitMenuBar(); +} + +int main() +{ + EventRecord event; + int32 output_rate=DEFAULT_RATE; + int err; + + mac_init(); nPlaying=mac_n_files=0; skin_state=WAITING; @@ -195,6 +200,7 @@ timidity_init_player(); ctl->open(0, 0); play_mode->open_output(); + init_load_soundfont(); wrdt=wrdt_list[0]; //dirty!! if(wrdt->open("d")) { //some errors @@ -405,7 +411,7 @@ dialog=GetNewDialog(200,0,(WindowRef)-1); if( dialog==0 ) return; SetDialogDefaultItem(dialog, 1); - ParamText(TIMID_VERSION, "\p", "\p", "\p"); + ParamText(TIMID_VERSION_PASCAL, "\p", "\p", "\p"); ShowWindow(dialog); for(;;){ @@ -477,6 +483,13 @@ case iPref: mac_SetPlayOption(); return; case iQuit: DoQuit(); return; + + //Play menu + case iPlay: SKIN_ACTION_PLAY(); break; + case iStop: SKIN_ACTION_STOP(); break; + case iPause: SKIN_ACTION_PAUSE(); break; + case iPrev: SKIN_ACTION_PREV(); break; + case iNext: SKIN_ACTION_NEXT(); break; //Synth menu case iTiMidity:{ diff -ruN TiMidity++-1.2.1/timidity/mac_main.h TiMidity++-1.3.0/timidity/mac_main.h --- TiMidity++-1.2.1/timidity/mac_main.h Mon Nov 30 19:16:27 1998 +++ TiMidity++-1.3.0/timidity/mac_main.h Tue Feb 2 16:05:25 1999 @@ -113,9 +113,18 @@ //- F, iQuit= 0x00810010, + mPlay=0x0082, + iPlay=0x00820001, + iStop=0x00820002, + iPause=0x00820003, + //- 4 + iPrev=0x00820005, + iNext=0x00820006, + mSynth=0x00A0, iTiMidity=0x00A00001, iQuickTime=0x00A00002 + }; #define kPlayerWinID 128 diff -ruN TiMidity++-1.2.1/timidity/output.c TiMidity++-1.3.0/timidity/output.c --- TiMidity++-1.2.1/timidity/output.c Wed Dec 16 16:49:40 1998 +++ TiMidity++-1.3.0/timidity/output.c Wed Feb 3 05:02:43 1999 @@ -286,6 +286,43 @@ } } +char *output_encoding_string(int enc) +{ + if(enc & PE_MONO) + if(enc & PE_16BIT) + if(enc & PE_SIGNED) + return "16bit (mono)"; + else + return "unsigned 16bit (mono)"; + else + if(enc & PE_ULAW) + return "U-law (mono)"; + else if(enc & PE_ALAW) + return "A-law (mono)"; + else + if(enc & PE_SIGNED) + return "8bit (mono)"; + else + return "unsigned 8bit (mono)"; + else + if(enc & PE_16BIT) + if(enc & PE_SIGNED) + return "16bit"; + else + return "unsigned 16bit"; + else + if(enc & PE_ULAW) + return "U-law"; + else if(enc & PE_ALAW) + return "A-law"; + else + if(enc & PE_SIGNED) + return "8bit"; + else + return "unsigned 8bit"; + /*NOTREACHED*/ +} + int32 dumb_current_samples(void) { return -1; diff -ruN TiMidity++-1.2.1/timidity/output.h TiMidity++-1.3.0/timidity/output.h --- TiMidity++-1.2.1/timidity/output.h Mon Nov 30 17:42:16 1998 +++ TiMidity++-1.3.0/timidity/output.h Wed Feb 3 05:02:32 1999 @@ -78,8 +78,10 @@ /* aLaw (8 bits) */ extern void s32toalaw(int32 *lp, int32 c); +extern char *output_encoding_string(int enc); extern int32 dumb_current_samples(void); extern int dumb_play_loop(void); + /* little-endian and big-endian specific */ #ifdef LITTLE_ENDIAN diff -ruN TiMidity++-1.2.1/timidity/playmidi.c TiMidity++-1.3.0/timidity/playmidi.c --- TiMidity++-1.2.1/timidity/playmidi.c Fri Jan 22 20:20:58 1999 +++ TiMidity++-1.3.0/timidity/playmidi.c Wed Feb 3 04:40:38 1999 @@ -96,7 +96,9 @@ static int file_from_stdin; static struct ReverbControls reverb_ctls[MAX_CHANNELS]; static void set_reverb_level(int ch, int level); -static int make_rvid_flag = 0; +static int make_rvid_flag = 0; +static int data_output_count; +#define fragment_start_count (play_mode->rate/2) /* Ring voice id for each notes */ static uint8 vidq_head[128 * MAX_CHANNELS], vidq_tail[128 * MAX_CHANNELS]; @@ -2017,6 +2019,7 @@ cur = current_sample; } play_mode->purge_output(); + data_output_count = 0; skip_to(cur); return cur; } @@ -2043,6 +2046,7 @@ break; case RC_SYNC_RESTART: play_mode->purge_output(); + data_output_count = 0; trace_flush(); break; case RC_TOGGLE_PAUSE: @@ -2148,6 +2152,7 @@ case RC_NEXT: /* >>| */ case RC_REALLY_PREVIOUS: /* |<< */ play_mode->purge_output(); + data_output_count = 0; trace_flush(); return rc; @@ -2176,18 +2181,21 @@ case RC_PREVIOUS: /* |<< */ play_mode->purge_output(); + data_output_count = 0; if (current_sample < 2*play_mode->rate) return RC_REALLY_PREVIOUS; return RC_RESTART; case RC_RESTART: /* |<< */ play_mode->purge_output(); + data_output_count = 0; skip_to(0); jump_flag = 1; continue; case RC_JUMP: play_mode->purge_output(); + data_output_count = 0; if (val >= sample_count) return RC_NEXT; skip_to(val); @@ -2196,6 +2204,7 @@ case RC_FORWARD: /* >> */ cur = current_trace_samples(); play_mode->purge_output(); + data_output_count = 0; if(cur == -1) cur = current_sample; if(val + cur >= sample_count) @@ -2206,6 +2215,7 @@ case RC_BACK: /* << */ cur = current_trace_samples(); play_mode->purge_output(); + data_output_count = 0; if(cur == -1) cur = current_sample; if(cur > val) @@ -2226,6 +2236,7 @@ if(midi_restart_time == -1) midi_restart_time = current_sample; play_mode->purge_output(); + data_output_count = 0; play_pause_flag = 1; } jump_flag = 1; @@ -2295,6 +2306,7 @@ SET_CHANNELMASK(current_file_info->drumchannels, val); } play_mode->purge_output(); + data_output_count = 0; return RC_RELOAD; case RC_TOGGLE_SNDSPEC: @@ -2332,6 +2344,7 @@ if(midi_restart_time == -1) midi_restart_time = current_sample; play_mode->purge_output(); + data_output_count = 0; return RC_RELOAD; } if(play_pause_flag) @@ -2708,7 +2721,10 @@ midi_end: if(RC_IS_SKIP_FILE(rc)) + { play_mode->purge_output(); + data_output_count = 0; + } ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "Playing time: ~%d seconds", current_sample/play_mode->rate+2); @@ -2766,8 +2782,8 @@ presence_resample(AUDIO_BUFFER_SIZE); #endif /* PRESENCE_HACK */ - if(trace_loop()) - { + if(trace_loop() && data_output_count > fragment_start_count) + { int i; int32 *bufp; static int j = 0, nfragm, d, ch; @@ -2803,6 +2819,7 @@ } else play_mode->output_data(common_buffer, AUDIO_BUFFER_SIZE); + data_output_count += AUDIO_BUFFER_SIZE; buffer_pointer=common_buffer; buffered_count=0; diff -ruN TiMidity++-1.2.1/timidity/raw_a.c TiMidity++-1.3.0/timidity/raw_a.c --- TiMidity++-1.2.1/timidity/raw_a.c Mon Nov 30 17:42:37 1998 +++ TiMidity++-1.3.0/timidity/raw_a.c Tue Feb 2 15:56:42 1999 @@ -107,7 +107,7 @@ if (dpm.fd<0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } } diff -ruN TiMidity++-1.2.1/timidity/readmidi.c TiMidity++-1.3.0/timidity/readmidi.c --- TiMidity++-1.2.1/timidity/readmidi.c Wed Dec 9 17:14:14 1998 +++ TiMidity++-1.3.0/timidity/readmidi.c Tue Feb 2 15:57:21 1999 @@ -354,7 +354,7 @@ if(errno) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: read_midi_event: %s", - current_filename, sys_errlist[errno]); + current_filename, strerror(errno)); else ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Warning: %s: Too shorten midi file.", @@ -907,7 +907,7 @@ if(errno) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: read_midi_event: %s", - current_filename, sys_errlist[errno]); + current_filename, strerror(errno)); else ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Warning: %s: Too shorten midi file.", @@ -1772,7 +1772,7 @@ { if(errno) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", current_filename, - sys_errlist[errno]); + strerror(errno)); else ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "%s: Not a MIDI file!", current_filename); @@ -1968,7 +1968,7 @@ { if(errno) ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", current_filename, - sys_errlist[errno]); + strerror(errno)); else ctl->cmsg(CMSG_WARNING, VERB_NORMAL, "%s: Not a MIDI file!", current_filename); @@ -2647,7 +2647,7 @@ { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", out_name, - errno ? sys_errlist[errno] : "Can't save file"); + errno ? strerror(errno) : "Can't save file"); return -1; } @@ -2656,7 +2656,7 @@ { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", out_name, - errno ? sys_errlist[errno] : "Can't save file"); + errno ? strerror(errno) : "Can't save file"); close_file(tf); return -1; } diff -ruN TiMidity++-1.2.1/timidity/reverb.c TiMidity++-1.3.0/timidity/reverb.c --- TiMidity++-1.2.1/timidity/reverb.c Mon Nov 30 17:44:19 1998 +++ TiMidity++-1.3.0/timidity/reverb.c Mon Feb 1 10:15:53 1999 @@ -17,29 +17,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - - ***************************************************************************** - * REVERB EFFECT FOR TIMIDITY-0.2i+X (Version 0.06b 1998/2/27) - * Copyright (C) 1997,1998 Masaki Kiryu - * (http://www.netq.or.jp/~user/hid/masaki/) - * - * reverb.c -- main reverb engine. - **************************************************************************** */ /* - * [CHANGES] - * 0.06b (1998/2/27) - * - Improved presence. (NOTE: speed down reverb functions) - * 0.06a (1998/2/15) - * - Speed up reverb functions. - * - Support for mono. + * REVERB EFFECT FOR TIMIDITY++-1.X (Version 0.06e 1999/1/28) + * + * Copyright (C) 1997,1998,1999 Masaki Kiryu + * (http://w3mb.kcom.ne.jp/~mkiryu/) + * + * reverb.c -- main reverb engine. + * */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ + #ifndef NO_STRING_H #include #else @@ -48,163 +40,238 @@ #include "timidity.h" #include "controls.h" -/* Delay Buffer @65kHz */ -#define REV_MAX_BUF0 344 -#define REV_MAX_BUF1 682 -#define REV_MAX_BUF2 2275 -#define REV_MAX_BUF3 1332 - -#define REV_BASE_VAL0 5.3 -#define REV_BASE_VAL1 10.5 -#define REV_BASE_VAL2 35.0 -#define REV_BASE_VAL3 20.5 - -#define REV_IN_LEVEL 0.7 -#define REV_FBK_LEVEL 0.15 -#define REV_MIX_LEVEL 0.8 -#define REV_CH_MIX_LEVEL 0.9 -#define REV_MONO_IN_LEVEL 0.8 - -#define REV_HPF_LEVEL 0.5 -#define REV_LPF_LEVEL 0.45 -#define REV_LPF_INPUT 0.55 - -int do_reverb_flag = 0; -static int def_bufp0, bufp0; -static int def_bufp1, bufp1; -static int def_bufp2, bufp2; -static int def_bufp3, bufp3; -static unsigned int sdp0, sdp1, sdp2, sdp3; -static int32 HPF_L, HPF_R, LPF_L, LPF_R; -static int32 buf0_L[REV_MAX_BUF0], buf0_R[REV_MAX_BUF0]; -static int32 buf1_L[REV_MAX_BUF1], buf1_R[REV_MAX_BUF1]; -static int32 buf2_L[REV_MAX_BUF2], buf2_R[REV_MAX_BUF2]; -static int32 buf3_L[REV_MAX_BUF2], buf3_R[REV_MAX_BUF2]; +/* delay buffers @65kHz */ +#define REV_BUF0 344 +#define REV_BUF1 684 +#define REV_BUF2 2868 +#define REV_BUF3 1368 + +#define REV_VAL0 5.3 +#define REV_VAL1 10.5 +#define REV_VAL2 44.12 +#define REV_VAL3 21.0 + +#define REV_INP_LEV 0.55 +#define REV_FBK_LEV 0.12 + +#define REV_NMIX_LEV 0.7 +#define REV_CMIX_LEV 0.9 +#define REV_MONO_LEV 0.7 + +#define REV_HPF_LEV 0.5 +#define REV_LPF_LEV 0.45 +#define REV_LPF_INP 0.55 +#define REV_EPF_LEV 0.4 +#define REV_EPF_INP 0.48 + +#define REV_WIDTH 0.125 + +int do_reverb_flag = 0; + +static int spt0, rpt0, def_rpt0; +static int spt1, rpt1, def_rpt1; +static int spt2, rpt2, def_rpt2; +static int spt3, rpt3, def_rpt3; +static int32 buf0_L[REV_BUF0], buf0_R[REV_BUF0]; +static int32 buf1_L[REV_BUF1], buf1_R[REV_BUF1]; +static int32 buf2_L[REV_BUF2], buf2_R[REV_BUF2]; +static int32 buf3_L[REV_BUF3], buf3_R[REV_BUF3]; + static int32 effect_buffer[AUDIO_BUFFER_SIZE*2]; static int32 direct_buffer[AUDIO_BUFFER_SIZE*2]; -static int32 effect_buffer_size=sizeof(effect_buffer); -static int32 direct_buffer_size=sizeof(direct_buffer); -static int32 ta, tb; +static int32 effect_bufsize = sizeof(effect_buffer); +static int32 direct_bufsize = sizeof(direct_buffer); -/* macro functions */ -#define LPF_FUNC_L LPF_L=LPF_L*REV_LPF_LEVEL+(buf2_L[sdp2]+tb)*REV_LPF_INPUT;\ - ta=buf3_L[sdp3];s=buf3_L[sdp3]=buf0_L[sdp0];\ - buf0_L[sdp0]=-LPF_L; -#define LPF_FUNC_R LPF_R=LPF_R*REV_LPF_LEVEL+(buf2_R[sdp2]+tb)*REV_LPF_INPUT;\ - ta=buf3_R[sdp3];s=buf3_R[sdp3]=buf0_R[sdp0];\ - buf0_R[sdp0]= LPF_R; -#define HPF_FUNC_L t=(HPF_L+fixp)*REV_HPF_LEVEL;HPF_L=t-fixp; -#define HPF_FUNC_R t=(HPF_R+fixp)*REV_HPF_LEVEL;HPF_R=t-fixp; -#define FUNC_L(XX) LPF_FUNC_L;HPF_FUNC_L;buf2_L[sdp2]=(s-fixp*REV_FBK_LEVEL)\ - *XX;tb=buf1_L[sdp1];buf1_L[sdp1]=t; -#define FUNC_R(XX) LPF_FUNC_R;HPF_FUNC_R;buf2_R[sdp2]=(s-fixp*REV_FBK_LEVEL)\ - *XX;tb=buf1_R[sdp1];buf1_R[sdp1]=t; -#define FUNC_INC sdp0++;if(sdp0==bufp0)sdp0=0;sdp1++;if(sdp1==bufp1)sdp1=0;\ - sdp2++;if(sdp2==bufp2)sdp2=0;sdp3++;if(sdp3==bufp3)sdp3=0; - -/* reverb send level table data (test version) */ -static FLOAT_T send_level_table[128] = { -0.00, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, -0.10, 0.11, 0.12, 0.13, 0.14, 0.16, 0.17, 0.18, -0.19, 0.20, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, -0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.37, -0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, -0.46, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, -0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, -0.63, 0.64, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, -0.70, 0.71, 0.72, 0.72, 0.73, 0.74, 0.75, 0.76, -0.76, 0.77, 0.78, 0.79, 0.79, 0.80, 0.81, 0.82, -0.82, 0.83, 0.84, 0.84, 0.85, 0.86, 0.86, 0.87, -0.87, 0.88, 0.89, 0.89, 0.90, 0.90, 0.91, 0.91, -0.92, 0.92, 0.93, 0.93, 0.94, 0.94, 0.94, 0.95, -0.95, 0.95, 0.96, 0.96, 0.96, 0.97, 0.97, 0.97, -0.98, 0.98, 0.98, 0.98, 0.99, 0.99, 0.99, 0.99, -0.99, 0.99, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00 -}; +static int32 ta, tb; +static int32 HPFL, HPFR; +static int32 LPFL, LPFR; +static int32 EPFL, EPFR; + +#define rev_memset(xx) memset(xx,0,sizeof(xx)); + +#define rev_ptinc() \ +spt0++; if(spt0 == rpt0) spt0 = 0;\ +spt1++; if(spt1 == rpt1) spt1 = 0;\ +spt2++; if(spt2 == rpt2) spt2 = 0;\ +spt3++; if(spt3 == rpt3) spt3 = 0; void init_reverb(int32 output_rate) { - tb = 0; - HPF_L = 0; HPF_R = 0; - LPF_L = 0; LPF_R = 0; - sdp0 = 0; sdp1 = 0; sdp2 = 0; sdp3 = 0; - memset(buf0_L, 0, sizeof(buf0_L)); memset(buf0_R, 0, sizeof(buf0_R)); - memset(buf1_L, 0, sizeof(buf1_L)); memset(buf1_R, 0, sizeof(buf1_R)); - memset(buf2_L, 0, sizeof(buf2_L)); memset(buf2_R, 0, sizeof(buf2_R)); - memset(buf3_L, 0, sizeof(buf3_L)); memset(buf3_R, 0, sizeof(buf3_R)); - memset(effect_buffer, 0, effect_buffer_size); - memset(direct_buffer, 0, direct_buffer_size); - - if(output_rate > 0) - { - def_bufp0 = bufp0 = REV_BASE_VAL0 * output_rate / 1000; - def_bufp1 = bufp1 = REV_BASE_VAL1 * output_rate / 1000; - def_bufp2 = bufp2 = REV_BASE_VAL2 * output_rate / 1000; - def_bufp3 = bufp3 = REV_BASE_VAL3 * output_rate / 1000; - } + ta = 0; tb = 0; + HPFL = 0; HPFR = 0; + LPFL = 0; LPFR = 0; + EPFL = 0; EPFR = 0; + spt0 = 0; spt1 = 0; + spt2 = 0; spt3 = 0; + + rev_memset(buf0_L); rev_memset(buf0_R); + rev_memset(buf1_L); rev_memset(buf1_R); + rev_memset(buf2_L); rev_memset(buf2_R); + rev_memset(buf3_L); rev_memset(buf3_R); + + memset(effect_buffer, 0, effect_bufsize); + memset(direct_buffer, 0, direct_bufsize); + + if(output_rate > 65000) output_rate=65000; + if(output_rate < 4000) output_rate=4000; + + def_rpt0 = rpt0 = REV_VAL0 * output_rate / 1000; + def_rpt1 = rpt1 = REV_VAL1 * output_rate / 1000; + def_rpt2 = rpt2 = REV_VAL2 * output_rate / 1000; + def_rpt3 = rpt3 = REV_VAL3 * output_rate / 1000; } + void set_ch_reverb(register int32 *sbuffer, int32 n, int level) { register int32 i; - FLOAT_T send_level = send_level_table[level]; + + FLOAT_T send_level = (FLOAT_T)level/127; for(i = 0; i < n; i++) + { direct_buffer[i] += sbuffer[i]; - for(i = 0; i < n; i++) - effect_buffer[i] += sbuffer[i] * send_level; + effect_buffer[i] += sbuffer[i] * send_level; + } } + void do_ch_reverb(int32 *comp, int32 n) { - register int32 fixp, s, t, i; + int32 fixp, s, t, i; for(i = 0; i < n; i++) { - fixp = effect_buffer[i] * REV_IN_LEVEL; - FUNC_L(REV_CH_MIX_LEVEL); - comp[i] = ta + direct_buffer[i] * REV_IN_LEVEL; - - fixp = effect_buffer[++i] * REV_IN_LEVEL; - FUNC_R(REV_CH_MIX_LEVEL); - comp[i] = ta + direct_buffer[i] * REV_IN_LEVEL; + /* L */ + fixp = effect_buffer[i] * REV_INP_LEV; + effect_buffer[i] = 0; + + LPFL = LPFL*REV_LPF_LEV + (buf2_L[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_L[spt3]; + s = buf3_L[spt3] = buf0_L[spt0]; + buf0_L[spt0] = -LPFL; + + t = (HPFL + fixp) * REV_HPF_LEV; + HPFL = t - fixp; + + buf2_L[spt2] = (s - fixp * REV_FBK_LEV) * REV_CMIX_LEV; + tb = buf1_L[spt1]; + buf1_L[spt1] = t; + + EPFL = EPFL * REV_EPF_LEV + ta * REV_EPF_INP; + comp[i] = ta + EPFL + direct_buffer[i] * REV_INP_LEV; + direct_buffer[i] = 0; + + /* R */ + fixp = effect_buffer[++i] * REV_INP_LEV; + effect_buffer[i] = 0; + + LPFR = LPFR*REV_LPF_LEV + (buf2_R[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_R[spt3]; + s = buf3_R[spt3] = buf0_R[spt0]; + buf0_R[spt0] = LPFR; + + t = (HPFR + fixp) * REV_HPF_LEV; + HPFR = t - fixp; + + buf2_R[spt2] = (s - fixp * REV_FBK_LEV) * REV_CMIX_LEV; + tb = buf1_R[spt1]; + buf1_R[spt1] = t; + + EPFR = EPFR * REV_EPF_LEV + ta * REV_EPF_INP; + comp[i] = ta + EPFR + direct_buffer[i] * REV_INP_LEV; + direct_buffer[i] = 0; - FUNC_INC; + rev_ptinc(); } - memset(effect_buffer, 0, effect_buffer_size); - memset(direct_buffer, 0, direct_buffer_size); } + void do_reverb(int32 *comp, int32 n) { - register int32 fixp, s, t, i; + int32 fixp, s, t, i; for(i = 0; i < n; i++) { - fixp = comp[i] * REV_IN_LEVEL; - FUNC_L(REV_MIX_LEVEL); - comp[i] = ta + fixp; - - fixp = comp[++i] * REV_IN_LEVEL; - FUNC_R(REV_MIX_LEVEL); - comp[i] = ta + fixp; + /* L */ + fixp = comp[i] * REV_INP_LEV; + + LPFL = LPFL*REV_LPF_LEV + (buf2_L[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_L[spt3]; + s = buf3_L[spt3] = buf0_L[spt0]; + buf0_L[spt0] = -LPFL; + + t = (HPFL + fixp) * REV_HPF_LEV; + HPFL = t - fixp; + + buf2_L[spt2] = (s - fixp * REV_FBK_LEV) * REV_NMIX_LEV; + tb = buf1_L[spt1]; + buf1_L[spt1] = t; + + EPFL = EPFL * REV_EPF_LEV + ta * REV_EPF_INP; + comp[i] = ta + EPFL + fixp; + + /* R */ + fixp = comp[++i] * REV_INP_LEV; + + LPFR = LPFR*REV_LPF_LEV + (buf2_R[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_R[spt3]; + s = buf3_R[spt3] = buf0_R[spt0]; + buf0_R[spt0] = LPFR; + + t = (HPFR + fixp) * REV_HPF_LEV; + HPFR = t - fixp; - FUNC_INC; + buf2_R[spt2] = (s - fixp * REV_FBK_LEV) * REV_NMIX_LEV; + tb = buf1_R[spt1]; + buf1_R[spt1] = t; + + EPFR = EPFR * REV_EPF_LEV + ta * REV_EPF_INP; + comp[i] = ta + EPFR + fixp; + + rev_ptinc(); } } + void do_mono_reverb(int32 *comp, int32 n) { - register int32 fixp, s, t, i; + int32 fixp, s, t, i; for(i = 0; i < n; i++) { - fixp = comp[i] * REV_MONO_IN_LEVEL; - FUNC_L(REV_MIX_LEVEL); - FUNC_R(REV_MIX_LEVEL); - comp[i] = ta + fixp; + /* L */ + fixp = comp[i] * REV_MONO_LEV; + + LPFL = LPFL*REV_LPF_LEV + (buf2_L[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_L[spt3]; + s = buf3_L[spt3] = buf0_L[spt0]; + buf0_L[spt0] = -LPFL; + + t = (HPFL + fixp) * REV_HPF_LEV; + HPFL = t - fixp; + + buf2_L[spt2] = (s - fixp * REV_FBK_LEV) * REV_NMIX_LEV; + tb = buf1_L[spt1]; + buf1_L[spt1] = t; + + /* R */ + LPFR = LPFR*REV_LPF_LEV + (buf2_R[spt2]+tb)*REV_LPF_INP + ta*REV_WIDTH; + ta = buf3_R[spt3]; + s = buf3_R[spt3] = buf0_R[spt0]; + buf0_R[spt0] = LPFR; + + t = (HPFR + fixp) * REV_HPF_LEV; + HPFR = t - fixp; + + buf2_R[spt2] = (s - fixp * REV_FBK_LEV) * REV_NMIX_LEV; + tb = buf1_R[spt1]; + buf1_R[spt1] = t; + + EPFR = EPFR * REV_EPF_LEV + ta * REV_EPF_INP; + comp[i] = ta + EPFR + fixp; - FUNC_INC; + rev_ptinc(); } } @@ -220,9 +287,4 @@ } } -/* -void make_reverb_send_level_table() -{ -} -*/ diff -ruN TiMidity++-1.2.1/timidity/reverb.h TiMidity++-1.3.0/timidity/reverb.h --- TiMidity++-1.2.1/timidity/reverb.h Mon Nov 30 17:44:37 1998 +++ TiMidity++-1.3.0/timidity/reverb.h Mon Feb 1 10:15:53 1999 @@ -17,17 +17,17 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/***************************************************************************** - * REVERB EFFECT FOR TIMIDITY-0.2i+X (Version 0.06a 1998/2/15) - * Copyright (C) 1997,1998 Masaki Kiryu - * (http://www.netq.or.jp/~user/hid/masaki/) +/* + * REVERB EFFECT FOR TIMIDITY++-1.X (Version 0.06e 1999/1/28) + * + * Copyright (C) 1997,1998,1999 Masaki Kiryu + * (http://w3mb.kcom.ne.jp/~mkiryu/) * * reverb.h - *****************************************************************************/ + * + */ #ifndef ___REVERB_H_ #define ___REVERB_H_ diff -ruN TiMidity++-1.2.1/timidity/timidity.c TiMidity++-1.3.0/timidity/timidity.c --- TiMidity++-1.2.1/timidity/timidity.c Mon Jan 25 20:29:00 1999 +++ TiMidity++-1.3.0/timidity/timidity.c Wed Feb 3 05:25:15 1999 @@ -34,7 +34,6 @@ #include extern int optind; extern char *optarg; -int getopt(int, char **, char *); #else #include #include /* for open */ @@ -1839,7 +1838,7 @@ if(errno) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, - "Can't read %s: %s", name, sys_errlist[errno]); + "Can't read %s: %s", name, strerror(errno)); errcnt++; } close_file(tf); @@ -1913,7 +1912,7 @@ if((opencheck = open(path, 0)) < 0) { ctl->cmsg(CMSG_INFO, VERB_NOISY, "%s: %s", - path, sys_errlist[errno]); + path, strerror(errno)); return 0; } } @@ -1934,7 +1933,7 @@ if((opencheck = open(path, 0)) < 0) { ctl->cmsg(CMSG_INFO, VERB_NOISY, "%s: %s", - path, sys_errlist[errno]); + path, strerror(errno)); return 0; } @@ -2345,15 +2344,6 @@ case 'i': if(set_ctl(optarg)) return 1; -#if defined(AU_LINUX) || defined(AU_WIN32) || defined(AU_BSDI) - else if(buffer_fragments == -1 && ctl->trace_playing) - /* user didn't specify anything, so use 2 for real-time response */ -#if defined(AU_LINUX) || defined(AU_BSDI) - buffer_fragments = 2; -#else - buffer_fragments = 3; /* On Win32 2 is chunky */ -#endif -#endif break; case 'B': @@ -2645,7 +2635,21 @@ __try { #endif /* BORLANDC_EXCEPTION */ +#ifdef __WIN32__ + ctl->cmsg(CMSG_INFO, VERB_DEBUG_SILLY, + "Initialize for Critical Section"); + SetConsoleCtrlHandler (handler, TRUE); + InitializeCriticalSection (&critSect); + if(opt_evil_mode) + if (!SetThreadPriority(GetCurrentThread(), + THREAD_PRIORITY_ABOVE_NORMAL)) + ctl->cmsg(CMSG_ERROR, VERB_NORMAL, + "Error raising process priority"); +#endif + /* Open output device */ + ctl->cmsg(CMSG_INFO, VERB_DEBUG_SILLY, + "open play_mode(%c)", play_mode->id_character); if(play_mode->open_output() < 0) { ctl->cmsg(CMSG_FATAL, VERB_NORMAL, @@ -2668,15 +2672,6 @@ if(*def_instr_name) set_default_instrument(def_instr_name); -#ifdef __WIN32__ - SetConsoleCtrlHandler (handler, TRUE); - InitializeCriticalSection (&critSect); - if(opt_evil_mode) - if (!SetThreadPriority(GetCurrentThread(), - THREAD_PRIORITY_ABOVE_NORMAL)) - ctl->cmsg(CMSG_ERROR, VERB_NORMAL, - "Error raising process priority"); -#endif trace_nodelay(!ctl->trace_playing); /* For safety */ @@ -2686,6 +2681,8 @@ play_mode->play_loop = dumb_play_loop; /* Return only when quitting */ + ctl->cmsg(CMSG_INFO, VERB_DEBUG_SILLY, + "pass_playing_list() nfiles=%d", nfiles); ctl->pass_playing_list(nfiles, files); #ifdef XP_UNIX diff -ruN TiMidity++-1.2.1/timidity/timidity.h TiMidity++-1.3.0/timidity/timidity.h --- TiMidity++-1.2.1/timidity/timidity.h Mon Nov 30 17:49:01 1998 +++ TiMidity++-1.3.0/timidity/timidity.h Wed Feb 3 05:59:56 1999 @@ -256,14 +256,6 @@ /* #define TMPDIR "/var/tmp" */ -/* Define if union semun is exist. */ -/* #define HAVE_UNION_SEMUN */ - - -/* Undefine if your compiler supports `volatile' declare */ -/* #define NO_VOLATILE */ - - /* To use GS drumpart setting. */ #define GS_DRUMPART @@ -374,71 +366,14 @@ fragments under the VoxWare (Linux & FreeBSD) audio driver */ #define AUDIO_BUFFER_SIZE (1< for FreeBSD and DEC OSF/1 */ -#ifdef DEC -#include -#include -#endif /* DEC */ - -#ifdef sgi -#include -#ifndef BIG_ENDIAN +/* Byte order */ +#ifdef WORDS_BIGENDIAN #define BIG_ENDIAN -#endif /* BIG_ENDIAN */ #undef LITTLE_ENDIAN -#endif /* sgi */ - -#ifdef linux -/* - * Byte order is defined in as __BYTE_ORDER, that need to - * be checked against __LITTLE_ENDIAN and __BIG_ENDIAN defined in - * includes automagically - * for Linux. - */ -#include -#include -/* - * We undef the two things to start with a clean situation - * (oddly enough, defines under certain conditions - * the two things below, as __LITTLE_ENDIAN and __BIG_ENDIAN, that - * are useless for our plans) - */ -#undef LITTLE_ENDIAN -#undef BIG_ENDIAN - -# if __BYTE_ORDER == __LITTLE_ENDIAN -# define LITTLE_ENDIAN -# elif __BYTE_ORDER == __BIG_ENDIAN -# define BIG_ENDIAN -# else -# error No byte sex defined -# endif -#endif /* linux */ - -#if defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) -#include -#include -#include -#if BYTE_ORDER == LITTLE_ENDIAN -#undef BIG_ENDIAN -#undef PDP_ENDIAN -#elif BYTE_ORDER == BIG_ENDIAN -#undef LITTLE_ENDIAN -#undef PDP_ENDIAN #else -# error No valid byte sex defined +#undef BIG_ENDIAN +#define LITTLE_ENDIAN #endif -#endif /* __FreeBSD__ || __bsdi__ || __NetBSD__ */ - -/* Win32 on Intel machines */ -#ifdef __WIN32__ -# define LITTLE_ENDIAN -#endif /* __WIN32__ */ /* DEC MMS has 64 bit long words */ #if defined(DEC) @@ -571,14 +506,13 @@ #define VIBRATO_DEPTH_TUNING (1.0/4.0) -#ifdef HPUX +#include +#ifdef HAVE_ERRNO_H #include -#ifndef BIG_ENDIAN -#define BIG_ENDIAN -#endif /* BIG_ENDIAN */ -#undef LITTLE_ENDIAN +#endif /* HAVE_ERRNO_H */ + +#ifdef HPUX #undef mono - extern char *sys_errlist[]; #endif #ifdef sun @@ -587,8 +521,6 @@ #include #define memcpy(x, y, n) bcopy(y, x, n) #endif /* SunOS 4.x */ -#include - extern char *sys_errlist[]; extern int errno; extern int opterr; extern int optind; @@ -607,18 +539,9 @@ #ifdef __WIN32__ -# include -# undef DECOMPRESSOR_LIST -# undef PATCH_EXT_LIST -# define PATCH_EXT_LIST { ".pat", 0 } +#undef PATCH_EXT_LIST +#define PATCH_EXT_LIST { ".pat", 0 } -#ifndef HAVE_USLEEP -#define HAVE_USLEEP -#endif /* HAVE_USLEEP */ -#define usleep(usec) Sleep((usec) / 1000) -#define sleep(sec) Sleep((sec) * 1000) - -/* URL Directory is not work in Windows */ #define URL_DIR_CACHE_DISABLE #endif @@ -675,5 +598,34 @@ #undef DECOMPRESSOR_LIST #undef PATCH_CONVERTERS #endif + + + +/* Follows are defined in utils/support.c */ + +#ifndef HAVE_VSNPRINTF +#include /* for va_list */ +extern void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap); +#endif + +#ifndef HAVE_SNPRINTF +extern void snprintf(char *buff, size_t bufsiz, const char *fmt, ...); +#endif /* HAVE_SNPRINTF */ + +#ifndef HAVE_GETOPT +extern int getopt(int argc, char *argv[], char *optionS) +#endif /* HAVE_GETOPT */ + +#ifndef HAVE_STRERROR +extern char *strerror(int errnum); +#endif /* HAVE_STRERROR */ + +#ifndef HAVE_USLEEP +extern int usleep(unsigned int usec) +#endif + +#ifndef HAVE_SLEEP +#define sleep(sec) usleep(sec * 1000000) +#endif /* HAVE_SLEEP */ #endif /* ___TIMIDITY_H_ */ diff -ruN TiMidity++-1.2.1/timidity/wave_a.c TiMidity++-1.3.0/timidity/wave_a.c --- TiMidity++-1.2.1/timidity/wave_a.c Mon Nov 30 17:49:19 1998 +++ TiMidity++-1.3.0/timidity/wave_a.c Tue Feb 2 15:58:00 1999 @@ -135,7 +135,7 @@ if (dpm.fd<0) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s", - dpm.name, sys_errlist[errno]); + dpm.name, strerror(errno)); return -1; } } diff -ruN TiMidity++-1.2.1/timidity/win_a.c TiMidity++-1.3.0/timidity/win_a.c --- TiMidity++-1.2.1/timidity/win_a.c Mon Nov 30 17:49:32 1998 +++ TiMidity++-1.3.0/timidity/win_a.c Wed Feb 3 05:02:49 1999 @@ -1,28 +1,30 @@ /* - - TiMidity++ -- MIDI to WAVE converter and player - Copyright (C) 1999 Masanao Izumo - Copyright (C) 1995 Tuukka Toivonen - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - win_audio.c - - Functions to play sound on the Win32 audio driver (Win 95 or Win NT). - -*/ + + TiMidity++ -- MIDI to WAVE converter and player + Copyright (C) 1999 Masanao Izumo + Copyright (C) 1995 Tuukka Toivonen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + win_audio.c + + Functions to play sound on the Win32 audio driver (Win 95 or Win NT). + + Modified by Masanao Izumo + + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -36,6 +38,70 @@ #endif #include +#ifdef __CYGWIN32__ +#define HAVE_WAVEFORMAT_CBSIZE +/* On cygnus, there is no header file for Multimedia API's. */ +/* Then declare some of them here. */ + +#define NEAR +#define FAR +#define WOM_OPEN 0x3BB +#define WOM_CLOSE 0x3BC +#define WOM_DONE 0x3BD +#define WAVE_FORMAT_QUERY 0x0001 +#define WAVE_ALLOWSYNC 0x0002 +#define WAVE_FORMAT_PCM 1 +#define CALLBACK_FUNCTION 0x00030000l +#define WAVERR_BASE 32 + +DECLARE_HANDLE(HWAVEOUT); +DECLARE_HANDLE(HWAVE); +typedef HWAVEOUT *LPHWAVEOUT; + +/* Define WAVEHDR, WAVEFORMAT, PCMWAVEFORMAT structure */ +typedef struct wavehdr_tag { + LPSTR lpData; + DWORD dwBufferLength; + DWORD dwBytesRecorded; + DWORD dwUser; + DWORD dwFlags; + DWORD dwLoops; + struct wavehdr_tag FAR *lpNext; + DWORD reserved; +} WAVEHDR; + +typedef struct { + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; +#ifdef HAVE_WAVEFORMAT_CBSIZE + WORD cbSize; +#endif +} WAVEFORMAT; + +typedef struct { + WAVEFORMAT wf; + WORD wBitsPerSample; +} PCMWAVEFORMAT; + +typedef WAVEHDR *LPWAVEHDR; +typedef WAVEFORMAT *LPWAVEFORMAT; +typedef UINT MMRESULT; + +MMRESULT WINAPI waveOutOpen(LPHWAVEOUT, UINT, + LPWAVEFORMAT, DWORD, DWORD, DWORD); +MMRESULT WINAPI waveOutClose(HWAVEOUT); +MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT, LPWAVEHDR, UINT); +MMRESULT WINAPI waveOutUnprepareHeader(HWAVEOUT, LPWAVEHDR, UINT); +MMRESULT WINAPI waveOutWrite(HWAVEOUT, LPWAVEHDR, UINT); +UINT WINAPI waveOutGetNumDevs(void); +MMRESULT WINAPI waveOutReset(HWAVEOUT); + +#endif /* __CYGWIN32__ */ + + #include "timidity.h" #include "output.h" #include "controls.h" @@ -57,303 +123,429 @@ extern int default_play_event(void *); +/* #define DATA_BLOCK_SIZE (1024*2) for small shared memory implementation */ +#define DATA_BLOCK_SIZE (1024*16) +#define DATA_BLOCK_NUM (dpm.extra_param[0]) +#define DATA_MIN_NBLOCKS (DATA_BLOCK_NUM-1) + +struct data_block_t +{ + HGLOBAL data_hg; + HGLOBAL head_hg; + void *data; + WAVEHDR *head; + int blockno; + struct data_block_t *next; +}; + +static struct data_block_t *all_data_block; +static struct data_block_t *free_data_block; +static void reuse_data_block(struct data_block_t *); +static void reset_data_block(void); +static struct data_block_t *new_data_block(); + +static HWAVEOUT dev; +static int nBlocks; +static const char *mmerror_code_string(MMRESULT res); + /* export the playback mode */ #define dpm win32_play_mode PlayMode dpm = { - DEFAULT_RATE, PE_16BIT|PE_SIGNED, PF_NEED_INSTRUMENTS|PF_CAN_TRACE, - -1, - {16}, - "Win32 audio driver", 'd', - NULL, - default_play_event, - open_output, - close_output, - output_data, - flush_output, - purge_output, - current_samples, - play_loop + DEFAULT_RATE, PE_16BIT|PE_SIGNED, PF_NEED_INSTRUMENTS|PF_CAN_TRACE, + -1, + {16}, + "Win32 audio driver", 'd', + NULL, + default_play_event, + open_output, + close_output, + output_data, + flush_output, + purge_output, + current_samples, + play_loop }; -/* Max audio blocks waiting to be played */ - -static LPHWAVEOUT dev; -static int nBlocks; - extern CRITICAL_SECTION critSect; /* Optional flag */ -int win32_wave_allowsync = 1; /* waveOutOpen() fdwOpen : WAVE_ALLOWSYNC */ +static int win32_wave_allowsync = 1; /* waveOutOpen() fdwOpen : WAVE_ALLOWSYNC */ +//static int win32_wave_allowsync = 0; -static void wait (void) - { - while (nBlocks) - Sleep (0); - } +static void wait(void) +{ + while(nBlocks) + Sleep(0); +} -static int play (void *mem, int len) - { - HGLOBAL hg; - LPWAVEHDR wh; - MMRESULT res; - - while (nBlocks >= dpm.extra_param[0]) - Sleep (0); - - hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR)); - if (!hg) - { - ctl->cmsg (CMSG_INFO, VERB_NORMAL, "GlobalAlloc failed!"); - return FALSE; - } - wh = GlobalLock (hg); - wh->dwBufferLength = len; - wh->lpData = mem; - - res = waveOutPrepareHeader (dev, wh, sizeof (WAVEHDR)); - if (res) - { - ctl->cmsg (CMSG_INFO, VERB_NORMAL, "waveOutPrepareHeader: %d", res); - GlobalUnlock (hg); - GlobalFree (hg); - return TRUE; - } - res = waveOutWrite (dev, wh, sizeof (WAVEHDR)); - if (res) - { - ctl->cmsg (CMSG_INFO, VERB_NORMAL, "waveOutWrite: %d", res); - GlobalUnlock (hg); - GlobalFree (hg); - return TRUE; - } - EnterCriticalSection (&critSect); - nBlocks++; - LeaveCriticalSection (&critSect); -// cmsg (CMSG_INFO,VERB_NOISY, "Play: %d blocks", nBlocks); - return FALSE; - } +static void CALLBACK wave_callback(HWAVE hWave, UINT uMsg, + DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) +{ + ctl->cmsg(CMSG_INFO, VERB_DEBUG, + "MMCallback: Msg=0x%x, nBlocks=%d", uMsg, nBlocks); -#pragma argsused -static void CALLBACK wave_callback (HWAVE hWave, UINT uMsg, - DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) - { + if(uMsg == WOM_DONE) + { WAVEHDR *wh; - HGLOBAL hg; - - if (uMsg == WOM_DONE) - { - EnterCriticalSection (&critSect); - wh = (WAVEHDR *)dwParam1; - waveOutUnprepareHeader (dev, wh, sizeof (WAVEHDR)); - hg = GlobalHandle (wh->lpData); - GlobalUnlock (hg); - GlobalFree (hg); - hg = GlobalHandle (wh); - GlobalUnlock (hg); - GlobalFree (hg); - nBlocks--; - LeaveCriticalSection (&critSect); -// cmsg (CMSG_INFO, VERB_NOISY, "Callback: %d blocks", nBlocks); - } - } -static int open_output (void) - { - int i, j, mono, eight_bit, warnings = 0; - PCMWAVEFORMAT pcm; - MMRESULT res; - - play_counter = reset_samples = 0; - - /* Check if there is at least one audio device */ - if (!waveOutGetNumDevs ()) - { - ctl->cmsg (CMSG_ERROR, VERB_NORMAL, "No audio devices present!"); - return -1; - } - - /* They can't mean these */ - dpm.encoding &= ~(PE_ULAW|PE_ALAW|PE_BYTESWAP); - - if (dpm.encoding & PE_16BIT) - dpm.encoding |= PE_SIGNED; - else - dpm.encoding &= ~PE_SIGNED; - - mono = (dpm.encoding & PE_MONO); - eight_bit = !(dpm.encoding & PE_16BIT); + EnterCriticalSection (&critSect); + wh = (WAVEHDR *)dwParam1; + waveOutUnprepareHeader(dev, wh, sizeof(WAVEHDR)); + reuse_data_block(&all_data_block[wh->dwUser]); + LeaveCriticalSection (&critSect); + } +} - pcm.wf.wFormatTag = WAVE_FORMAT_PCM; - pcm.wf.nChannels = mono ? 1 : 2; - pcm.wf.nSamplesPerSec = i = dpm.rate; - j = 1; - if (!mono) - { - i *= 2; - j *= 2; - } - if (!eight_bit) - { - i *= 2; - j *= 2; - } - pcm.wf.nAvgBytesPerSec = i; - pcm.wf.nBlockAlign = j; - pcm.wBitsPerSample = eight_bit ? 8 : 16; +static int open_output(void) +{ + int i, j, mono, eight_bit, warnings = 0; + PCMWAVEFORMAT pcm; + MMRESULT res; + + play_counter = reset_samples = 0; + + /* Check if there is at least one audio device */ + if (!(i=waveOutGetNumDevs ())) + { + ctl->cmsg (CMSG_ERROR, VERB_NORMAL, "No audio devices present!"); + return -1; + } + + /* They can't mean these */ + dpm.encoding &= ~(PE_ULAW|PE_ALAW|PE_BYTESWAP); + + if (dpm.encoding & PE_16BIT) + dpm.encoding |= PE_SIGNED; + else + dpm.encoding &= ~PE_SIGNED; + + mono = (dpm.encoding & PE_MONO); + eight_bit = !(dpm.encoding & PE_16BIT); + + memset(&pcm, 0, sizeof(pcm)); + pcm.wf.wFormatTag = WAVE_FORMAT_PCM; + pcm.wf.nChannels = mono ? 1 : 2; + pcm.wf.nSamplesPerSec = i = dpm.rate; + j = 1; + if (!mono) + { + i *= 2; + j *= 2; + } + if (!eight_bit) + { + i *= 2; + j *= 2; + } + pcm.wf.nAvgBytesPerSec = i; + pcm.wf.nBlockAlign = j; + pcm.wBitsPerSample = eight_bit ? 8 : 16; +#ifdef HAVE_WAVEFORMAT_CBSIZE + pcm.wf.cbSize=sizeof(WAVEFORMAT); +#endif - if (win32_wave_allowsync) - res = waveOutOpen (NULL, 0, (LPWAVEFORMAT)&pcm, NULL, 0, WAVE_FORMAT_QUERY | WAVE_ALLOWSYNC); - else - res = waveOutOpen (NULL, 0, (LPWAVEFORMAT)&pcm, NULL, 0, WAVE_FORMAT_QUERY); - if (res) - { - ctl->cmsg (CMSG_ERROR, VERB_NORMAL, "Format not supported!"); - return -1; - } - if (win32_wave_allowsync) - res = waveOutOpen (&dev, 0, (LPWAVEFORMAT)&pcm, (DWORD)wave_callback, 0, CALLBACK_FUNCTION | WAVE_ALLOWSYNC); - else - res = waveOutOpen (&dev, 0, (LPWAVEFORMAT)&pcm, (DWORD)wave_callback, 0, CALLBACK_FUNCTION); - if (res) - { - ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Can't open audio device"); - return -1; - } - nBlocks = 0; - dpm.fd = 0; - return warnings; - } + dev = 0; + if (win32_wave_allowsync) + res = waveOutOpen (&dev, 0, (LPWAVEFORMAT)&pcm, (DWORD)wave_callback, 0, CALLBACK_FUNCTION | WAVE_ALLOWSYNC); + else + res = waveOutOpen (&dev, 0, (LPWAVEFORMAT)&pcm, (DWORD)wave_callback, 0, CALLBACK_FUNCTION); + if (res) + { + ctl->cmsg(CMSG_ERROR, VERB_NORMAL, + "Can't open audio device: encoding=<%s>, rate=<%d>: %s", + output_encoding_string(dpm.encoding), + dpm.rate, + mmerror_code_string(res)); + return -1; + } + + all_data_block = (struct data_block_t *) + safe_malloc(DATA_BLOCK_NUM * sizeof(struct data_block_t)); + for(i = 0; i < DATA_BLOCK_NUM; i++) + { + struct data_block_t *block; + block = &all_data_block[i]; + block->data_hg = GlobalAlloc(GMEM_ZEROINIT, DATA_BLOCK_SIZE); + block->data = GlobalLock(block->data_hg); + block->head_hg = GlobalAlloc(GMEM_ZEROINIT, sizeof(WAVEHDR)); + block->head = GlobalLock(block->head_hg); + } + reset_data_block(); + dpm.fd = 0; + return warnings; +} static void add_sample_counter(int32 count) { - current_samples(); /* update play_counter */ + current_samples(); /* update play_counter */ play_counter += count; } static void output_data (int32 *buf, int32 count) +{ + int32 len = count, n; + HGLOBAL data_hg; + HGLOBAL head_hg; + void *b; + int32 count_arg = count; + struct data_block_t *block; + int32 total; + char *bp; + MMRESULT res; + LPWAVEHDR wh; + + if(!(dpm.encoding & PE_MONO)) /* Stereo sample */ + { + count *= 2; + len *= 2; + } + + if(dpm.encoding & PE_16BIT) + len *= 2; + + if (dpm.encoding & PE_16BIT) + /* Convert data to signed 16-bit PCM */ + s32tos16 (buf, count); + else + /* Convert to 8-bit unsigned. */ + s32tou8 (buf, count); + + total = 0; + bp = (char *)buf; + add_sample_counter(count_arg); + while(len > 0) + { + if((block = new_data_block()) == NULL) { - int len = count; - HGLOBAL hg; - void *b; - int32 count_arg = count; - if (!(dpm.encoding & PE_MONO)) /* Stereo sample */ - { - count *= 2; - len *= 2; - } - - if (dpm.encoding & PE_16BIT) - len *= 2; - - hg = GlobalAlloc (GMEM_MOVEABLE, len); - if (!hg) - { - ctl->cmsg (CMSG_INFO, VERB_NORMAL, "GlobalAlloc failed!"); - return; - } - b = GlobalLock (hg); - - if (dpm.encoding & PE_16BIT) - /* Convert data to signed 16-bit PCM */ - s32tos16 (buf, count); + Sleep(0); + continue; + } + if(len <= DATA_BLOCK_SIZE) + n = len; else - /* Convert to 8-bit unsigned. */ - s32tou8 (buf, count); + n = DATA_BLOCK_SIZE; + data_hg = block->data_hg; + head_hg = block->head_hg; - CopyMemory(b, buf, len); - add_sample_counter(count_arg); - if (play (b, len)) - { - GlobalUnlock (hg); - GlobalFree (hg); - } - } + b = block->data; + CopyMemory(b, bp, n); -static void close_output (void) - { - int rc; + wh = block->head; + wh->dwBufferLength = n; + wh->lpData = b; + wh->dwUser = block->blockno; - if(dpm.fd == -1) - return; - wait (); - waveOutClose (dev); - play_counter = reset_samples = 0; - dpm.fd = -1; + res = waveOutPrepareHeader(dev, wh, sizeof(WAVEHDR)); + if(res) + { + ctl->cmsg (CMSG_ERROR, VERB_NORMAL, "waveOutPrepareHeader(): %s", + mmerror_code_string(res)); + safe_exit(1); } - -static int flush_output (void) + res = waveOutWrite(dev, wh, sizeof(WAVEHDR)); + if(res) { - int rc; + ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "waveOutWrite(): %s", + mmerror_code_string(res)); + safe_exit(1); + } - if(play_counter == 0 && reset_samples == 0) - return RC_NONE; + len -= n; + bp += n; + } +} - /* extract all trace */ - while(trace_loop()) - { - rc = check_apply_control(); - if(RC_IS_SKIP_FILE(rc)) - { - purge_output(); - return rc; - } - Sleep(0); - } +static void close_output(void) +{ + int i; - /* wait until play out */ - do - { - rc = check_apply_control(); - if(RC_IS_SKIP_FILE(rc)) - { - purge_output(); - return rc; - } - current_samples(); - Sleep(0); - } while(play_counter > 0); + if(dpm.fd == -1) + return; + wait(); + waveOutClose(dev); + play_counter = reset_samples = 0; + + for(i = 0; i < DATA_BLOCK_NUM; i++) + { + struct data_block_t *block; + block = &all_data_block[i]; + GlobalUnlock(block->head_hg); + GlobalFree(block->head_hg); + GlobalUnlock(block->data_hg); + GlobalFree(block->data_hg); + } + free(all_data_block); + + dpm.fd = -1; +} - wait (); - play_counter = reset_samples = 0; +static int flush_output(void) +{ + int rc; + + if(play_counter == 0 && reset_samples == 0) return RC_NONE; - } -static void purge_output (void) - { - if(play_counter == 0 && reset_samples == 0) - return; /* Ignore */ - waveOutReset (dev); - wait (); - play_counter = reset_samples = 0; - } + /* extract all trace */ + while(trace_loop()) + { + rc = check_apply_control(); + if(RC_IS_SKIP_FILE(rc)) + { + purge_output(); + return rc; + } + Sleep(0); + } + + /* wait until play out */ + do + { + rc = check_apply_control(); + if(RC_IS_SKIP_FILE(rc)) + { + purge_output(); + return rc; + } + current_samples(); + Sleep(0); + } while(play_counter > 0); + + wait(); + reset_data_block(); + play_counter = reset_samples = 0; + return RC_NONE; +} + +static void purge_output(void) +{ + if(play_counter == 0 && reset_samples == 0) + return; /* Ignore */ + waveOutReset(dev); + wait(); + reset_data_block(); + play_counter = reset_samples = 0; +} static int play_loop(void) - { - return 0; - } +{ + return 0; +} static int32 current_samples(void) - { - double realtime, es; +{ + double realtime, es; - realtime = get_current_calender_time(); - if(play_counter == 0) - { - play_start_time = realtime; - return reset_samples; - } - es = dpm.rate * (realtime - play_start_time); - if(es >= play_counter) - { - /* out of play counter */ - reset_samples += play_counter; - play_counter = 0; - play_start_time = realtime; - return reset_samples; - } - if(es < 0) - return 0; /* for safety */ - return (int32)es + reset_samples; - } + realtime = get_current_calender_time(); + if(play_counter == 0) + { + play_start_time = realtime; + return reset_samples; + } + es = dpm.rate * (realtime - play_start_time); + if(es >= play_counter) + { + /* out of play counter */ + reset_samples += play_counter; + play_counter = 0; + play_start_time = realtime; + return reset_samples; + } + if(es < 0) + return 0; /* for safety */ + return (int32)es + reset_samples; +} + + +#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]) +static const char *mmsyserr_code_string[] = +{ + "no error", + "unspecified error", + "device ID out of range", + "driver failed enable", + "device already allocated", + "device handle is invalid", + "no device driver present", + "memory allocation error", + "function isn't supported", + "error value out of range", + "invalid flag passed", + "invalid parameter passed", + "handle being used", +}; + +static const char *waverr_code_sring[] = +{ + "unsupported wave format", + "still something playing", + "header not prepared", + "device is synchronous", +}; + +static const char *mmerror_code_string(MMRESULT err_code) +{ + static char s[32]; + + if(err_code >= WAVERR_BASE) + { + err_code -= WAVERR_BASE; + if(err_code > ARRAY_SIZE(waverr_code_sring)) + { + sprintf(s, "WAVERR %d", err_code); + return s; + } + return waverr_code_sring[err_code]; + } + if(err_code > ARRAY_SIZE(mmsyserr_code_string)) + { + sprintf(s, "MMSYSERR %d", err_code); + return s; + } + return mmsyserr_code_string[err_code]; +} + + +static struct data_block_t *new_data_block() +{ + struct data_block_t *p; + + p = NULL; + EnterCriticalSection (&critSect); + if(free_data_block != NULL) + { + p = free_data_block; + free_data_block = free_data_block->next; + nBlocks++; + p->next = NULL; + } + LeaveCriticalSection (&critSect); + + return p; +} + +static void reuse_data_block(struct data_block_t *block) +{ + block->next = free_data_block; + free_data_block = block; + nBlocks--; +} + +static void reset_data_block(void) +{ + int i; + + all_data_block[0].blockno = 0; + all_data_block[0].next = &all_data_block[1]; + for(i = 1; i < DATA_BLOCK_NUM - 1; i++) + { + all_data_block[i].blockno = i; + all_data_block[i].next = &all_data_block[i + 1]; + } + all_data_block[i].blockno = i; + all_data_block[i].next = NULL; + free_data_block = &all_data_block[0]; + nBlocks = 0; +} diff -ruN TiMidity++-1.2.1/timidity/wrdt.c TiMidity++-1.3.0/timidity/wrdt.c --- TiMidity++-1.2.1/timidity/wrdt.c Mon Nov 30 17:49:53 1998 +++ TiMidity++-1.3.0/timidity/wrdt.c Wed Feb 3 06:34:27 1999 @@ -96,8 +96,8 @@ extern WRDTracer x_wrdt_mode; #endif /* WRDT_X */ -#ifdef __WIN32__ -extern WRDTracer wincon_wrdt_mode; +#if defined(__WIN32__) +extern WRDTracer wincon_wrdt_mode; /* wrdt_wincon.c */ #endif /* __WIN32__ */ WRDTracer *wrdt_list[] = diff -ruN TiMidity++-1.2.1/utils/Makefile.am TiMidity++-1.3.0/utils/Makefile.am --- TiMidity++-1.2.1/utils/Makefile.am Sun Jan 17 06:17:36 1999 +++ TiMidity++-1.3.0/utils/Makefile.am Tue Feb 2 16:43:39 1999 @@ -36,13 +36,14 @@ nkflib.h \ strtab.c \ strtab.h \ + support.c \ timer.c \ timer.h EXTRA_libutils_a_SOURCES = \ fft.c \ fft.h \ - getopt.c \ + support.c \ net.c \ net.h \ mac_util.c \ @@ -60,18 +61,13 @@ SOUND_SPEC_OBJS = fft.o endif -if NEED_GETOPT -GETOPT_OBJS = getopt.o -endif - -if CYGWIN32 -CYGWIN32_OBJS = readdir_win.o +if W32READDIR +W32READDIR_OBJS = readdir_win.o endif libutils_a_LIBADD = \ $(NET_OBJS) \ - $(CYGWIN32_OBJS) \ - $(GETOPT_OBJS) \ + $(W32READDIR_OBJS) \ $(SOUND_SPEC_OBJS) -libutils_a_DEPENDENCIES = $(libutils_a_LIBADD) \ No newline at end of file +libutils_a_DEPENDENCIES = $(libutils_a_LIBADD) diff -ruN TiMidity++-1.2.1/utils/Makefile.in TiMidity++-1.3.0/utils/Makefile.in --- TiMidity++-1.2.1/utils/Makefile.in Mon Jan 25 21:30:20 1999 +++ TiMidity++-1.3.0/utils/Makefile.in Wed Feb 3 07:27:42 1999 @@ -103,6 +103,7 @@ WISH = @WISH@ dynamic_targets = @dynamic_targets@ lispdir = @lispdir@ +program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ @@ -124,13 +125,14 @@ nkflib.h \ strtab.c \ strtab.h \ + support.c \ timer.c \ timer.h EXTRA_libutils_a_SOURCES = \ fft.c \ fft.h \ - getopt.c \ + support.c \ net.c \ net.h \ mac_util.c \ @@ -144,14 +146,11 @@ @ENABLE_SOUND_SPEC_TRUE@SOUND_SPEC_OBJS = fft.o -@NEED_GETOPT_TRUE@GETOPT_OBJS = getopt.o - -@CYGWIN32_TRUE@CYGWIN32_OBJS = readdir_win.o +@W32READDIR_TRUE@W32READDIR_OBJS = readdir_win.o libutils_a_LIBADD = \ $(NET_OBJS) \ - $(CYGWIN32_OBJS) \ - $(GETOPT_OBJS) \ + $(W32READDIR_OBJS) \ $(SOUND_SPEC_OBJS) libutils_a_DEPENDENCIES = $(libutils_a_LIBADD) @@ -169,7 +168,8 @@ X_LIBS = @X_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ -libutils_a_OBJECTS = bitset.o mblock.o memb.o nkflib.o strtab.o timer.o +libutils_a_OBJECTS = bitset.o mblock.o memb.o nkflib.o strtab.o \ +support.o timer.o AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @@ -267,12 +267,16 @@ done bitset.o: bitset.c ../config.h ../timidity/timidity.h \ ../timidity/common.h ../libarc/url.h mblock.h bitset.h +fft.o: fft.c ../config.h ../timidity/timidity.h ../timidity/common.h \ + ../libarc/url.h mblock.h fft.h mblock.o: mblock.c ../config.h ../timidity/timidity.h mblock.h memb.o: memb.c ../config.h ../timidity/timidity.h memb.h mblock.h \ ../libarc/url.h +net.o: net.c ../config.h ../timidity/timidity.h net.h nkflib.o: nkflib.c ../config.h ../timidity/timidity.h \ ../timidity/common.h ../libarc/url.h mblock.h nkflib.h strtab.o: strtab.c ../config.h ../timidity/timidity.h mblock.h strtab.h +support.o: support.c ../config.h ../timidity/timidity.h mblock.h timer.o: timer.c ../config.h ../timidity/timidity.h timer.h info: diff -ruN TiMidity++-1.2.1/utils/getopt.c TiMidity++-1.3.0/utils/getopt.c --- TiMidity++-1.2.1/utils/getopt.c Mon Nov 30 18:18:27 1998 +++ TiMidity++-1.3.0/utils/getopt.c Thu Jan 1 09:00:00 1970 @@ -1,145 +0,0 @@ -/* - Copyright (c) 1986,1992 by Borland International Inc. - All Rights Reserved. -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ -#ifndef NO_STRING_H -#include -#else -#include -#endif -#include -#include -#include "timidity.h" - -int optind = 1; /* index of which argument is next */ -char *optarg; /* pointer to argument of current option */ -int opterr = 1; /* allow error message */ - -static char *letP = NULL; /* remember next option char's location */ - -#if 0 -static char SW = 0; /* DOS switch character, either '-' or '/' */ -#endif -#define SW '-' /* On Win32 can't call DOS! */ -/* - Parse the command line options, System V style. - - Standard option syntax is: - - option ::= SW [optLetter]* [argLetter space* argument] - - where - - SW is either '/' or '-', according to the current setting - of the MSDOS switchar (int 21h function 37h). - - there is no space before any optLetter or argLetter. - - opt/arg letters are alphabetic, not punctuation characters. - - optLetters, if present, must be matched in optionS. - - argLetters, if present, are found in optionS followed by ':'. - - argument is any white-space delimited string. Note that it - can include the SW character. - - upper and lower case letters are distinct. - - There may be multiple option clusters on a command line, each - beginning with a SW, but all must appear before any non-option - arguments (arguments not introduced by SW). Opt/arg letters may - be repeated: it is up to the caller to decide if that is an error. - - The character SW appearing alone as the last argument is an error. - The lead-in sequence SWSW ("--" or "//") causes itself and all the - rest of the line to be ignored (allowing non-options which begin - with the switch char). - - The string *optionS allows valid opt/arg letters to be recognized. - argLetters are followed with ':'. Getopt () returns the value of - the option character found, or EOF if no more options are in the - command line. If option is an argLetter then the global optarg is - set to point to the argument string (having skipped any white-space). - - The global optind is initially 1 and is always left as the index - of the next argument of argv[] which getopt has not taken. Note - that if "--" or "//" are used then optind is stepped to the next - argument before getopt() returns EOF. - - If an error occurs, that is an SW char precedes an unknown letter, - then getopt() will return a '?' character and normally prints an - error message via perror(). If the global variable opterr is set - to false (zero) before calling getopt() then the error message is - not printed. - - For example, if the MSDOS switch char is '/' (the MSDOS norm) and - - *optionS == "A:F:PuU:wXZ:" - - then 'P', 'u', 'w', and 'X' are option letters and 'F', 'U', 'Z' - are followed by arguments. A valid command line may be: - - aCommand /uPFPi /X /A L someFile - - where: - - 'u' and 'P' will be returned as isolated option letters. - - 'F' will return with "Pi" as its argument string. - - 'X' is an isolated option. - - 'A' will return with "L" as its argument. - - "someFile" is not an option, and terminates getOpt. The - caller may collect remaining arguments using argv pointers. -*/ - -int getopt(int argc, char *argv[], char *optionS) -{ - unsigned char ch; - char *optP; - -#if 0 - if (SW == 0) { - /* get SW using dos call 0x37 */ - _AX = 0x3700; - geninterrupt(0x21); - SW = _DL; - } -#endif - if (argc > optind) { - if (letP == NULL) { - if ((letP = argv[optind]) == NULL || - *(letP++) != SW) goto gopEOF; - if (*letP == SW) { - optind++; goto gopEOF; - } - } - if (0 == (ch = *(letP++))) { - optind++; goto gopEOF; - } - if (':' == ch || (optP = strchr(optionS, ch)) == NULL) - goto gopError; - if (':' == *(++optP)) { - optind++; - if (0 == *letP) { - if (argc <= optind) goto gopError; - letP = argv[optind++]; - } - optarg = letP; - letP = NULL; - } else { - if (0 == *letP) { - optind++; - letP = NULL; - } - optarg = NULL; - } - return ch; - } -gopEOF: - optarg = letP = NULL; - return EOF; - -gopError: - if (argc > optind) - optind++; - optarg = letP = NULL; - errno = EINVAL; - if (opterr) - perror ("get command line option"); - return ('?'); -} diff -ruN TiMidity++-1.2.1/utils/net.c TiMidity++-1.3.0/utils/net.c --- TiMidity++-1.2.1/utils/net.c Mon Nov 30 18:19:05 1998 +++ TiMidity++-1.3.0/utils/net.c Tue Feb 2 17:24:09 1999 @@ -25,7 +25,7 @@ #endif /* HAVE_CONFIG_H */ #include #include -#ifndef __WIN32__ +#if !defined(__WIN32__) || defined(__CYGWIN32__) #include #include #include @@ -46,14 +46,14 @@ #define INADDR_NONE 0xffffffff #endif /* INADDR_NONE */ -#ifndef __WIN32__ +#if !defined(__WIN32__) || defined(__CYGWIN32__) #ifndef INVALID_SOCKET #define INVALID_SOCKET -1 #endif /* INVALID_SOCKET */ #ifndef SOCKET_ERROR #define SOCKET_ERROR -1 #endif /* SOCKET_ERROR */ -#endif /* __WIN32__ */ +#endif SOCKET open_socket(char *host, unsigned short port) { @@ -83,7 +83,7 @@ return fd; } -#ifndef __WIN32__ +#if !defined(__WIN32__) || defined(__CYGWIN32__) long socket_write(SOCKET fd, char *buff, long bufsiz) { return write(fd, buff, bufsiz); diff -ruN TiMidity++-1.2.1/utils/net.h TiMidity++-1.3.0/utils/net.h --- TiMidity++-1.2.1/utils/net.h Mon Nov 30 18:19:08 1998 +++ TiMidity++-1.3.0/utils/net.h Tue Feb 2 17:23:59 1999 @@ -23,11 +23,11 @@ #ifndef ___NET_H_ #define ___NET_H_ -#ifdef __WIN32__ -#include -#else +#if !defined(__WIN32__) || defined(__CYGWIN32__) typedef int SOCKET; #define closesocket(fd) close(fd) +#else +#include #endif extern SOCKET open_socket(char *host, unsigned short port); diff -ruN TiMidity++-1.2.1/utils/support.c TiMidity++-1.3.0/utils/support.c --- TiMidity++-1.2.1/utils/support.c Thu Jan 1 09:00:00 1970 +++ TiMidity++-1.3.0/utils/support.c Wed Feb 3 05:18:24 1999 @@ -0,0 +1,742 @@ +/* + + TiMidity++ -- MIDI to WAVE converter and player + Copyright (C) 1999 Masanao Izumo + Copyright (C) 1995 Tuukka Toivonen + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + support.c - Define missing function + Written by Masanao Izumo +*/ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + +#include +#include +#include +#include +#include +#ifndef NO_STRING_H +#include +#else +#include +#endif + + +#include "timidity.h" +#include "mblock.h" + +#ifndef HAVE_VSNPRINTF +/* From glib-1.1.13:gstrfuncs.c + * Modified by Masanao Izumo + */ +static int printf_string_upper_bound (const char* format, + va_list args) +{ + int len = 1; + + while (*format) + { + int long_int = 0; + int extra_long = 0; + char c; + + c = *format++; + + if (c == '%') + { + int done = 0; + + while (*format && !done) + { + switch (*format++) + { + char *string_arg; + + case '*': + len += va_arg (args, int); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* add specified format length, since it might exceed the + * size we assume it to have. + */ + format -= 1; + len += strtol (format, (char**) &format, 10); + break; + case 'h': + /* ignore short int flag, since all args have at least the + * same size as an int + */ + break; + case 'l': + if (long_int) + extra_long = 1; /* linux specific */ + else + long_int = 1; + break; + case 'q': + case 'L': + long_int = 1; + extra_long = 1; + break; + case 's': + string_arg = va_arg (args, char *); + if (string_arg) + len += strlen (string_arg); + else + { + /* add enough padding to hold "(null)" identifier */ + len += 16; + } + done = 1; + break; + case 'd': + case 'i': + case 'o': + case 'u': + case 'x': + case 'X': +#ifdef G_HAVE_GINT64 + if (extra_long) + (void) va_arg (args, gint64); + else +#endif /* G_HAVE_GINT64 */ + { + if (long_int) + (void) va_arg (args, long); + else + (void) va_arg (args, int); + } + len += extra_long ? 64 : 32; + done = 1; + break; + case 'D': + case 'O': + case 'U': + (void) va_arg (args, long); + len += 32; + done = 1; + break; + case 'e': + case 'E': + case 'f': + case 'g': +#ifdef HAVE_LONG_DOUBLE + if (extra_long) + (void) va_arg (args, long double); + else +#endif /* HAVE_LONG_DOUBLE */ + (void) va_arg (args, double); + len += extra_long ? 64 : 32; + done = 1; + break; + case 'c': + (void) va_arg (args, int); + len += 1; + done = 1; + break; + case 'p': + case 'n': + (void) va_arg (args, void*); + len += 32; + done = 1; + break; + case '%': + len += 1; + done = 1; + break; + default: + /* ignore unknow/invalid flags */ + break; + } + } + } + else + len += 1; + } + + return len; +} + +void vsnprintf(char *buff, size_t bufsiz, const char *fmt, va_list ap) +{ + MBlockList pool; + char *tmpbuf = buff; + + init_mblock(&pool); + tmpbuf = new_segment(&pool, printf_string_upper_bound(fmt, ap)); + vsprintf(tmpbuf, fmt, ap); + strncpy(buff, tmpbuf, bufsiz); + reuse_mblock(&pool); +} +#endif /* HAVE_VSNPRINTF */ + +#ifndef HAVE_SNPRINTF +void snprintf(char *buff, size_t bufsiz, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsnprintf(buff, bufsiz, fmt, ap); + va_end(ap); +} +#endif /* HAVE_VSNPRINTF */ + + +#ifndef HAVE_GETOPT +/* + Copyright (c) 1986,1992 by Borland International Inc. + All Rights Reserved. +*/ +#ifdef HAVE_DOS_H +#include +#endif /* HAVE_DOS_H */ + +int optind = 1; /* index of which argument is next */ +char *optarg; /* pointer to argument of current option */ +int opterr = 1; /* allow error message */ + +static char *letP = NULL; /* remember next option char's location */ + +#if 0 +static char SW = 0; /* DOS switch character, either '-' or '/' */ +#endif +#define SW '-' /* On Win32 can't call DOS! */ +/* + Parse the command line options, System V style. + + Standard option syntax is: + + option ::= SW [optLetter]* [argLetter space* argument] + + where + - SW is either '/' or '-', according to the current setting + of the MSDOS switchar (int 21h function 37h). + - there is no space before any optLetter or argLetter. + - opt/arg letters are alphabetic, not punctuation characters. + - optLetters, if present, must be matched in optionS. + - argLetters, if present, are found in optionS followed by ':'. + - argument is any white-space delimited string. Note that it + can include the SW character. + - upper and lower case letters are distinct. + + There may be multiple option clusters on a command line, each + beginning with a SW, but all must appear before any non-option + arguments (arguments not introduced by SW). Opt/arg letters may + be repeated: it is up to the caller to decide if that is an error. + + The character SW appearing alone as the last argument is an error. + The lead-in sequence SWSW ("--" or "//") causes itself and all the + rest of the line to be ignored (allowing non-options which begin + with the switch char). + + The string *optionS allows valid opt/arg letters to be recognized. + argLetters are followed with ':'. Getopt () returns the value of + the option character found, or EOF if no more options are in the + command line. If option is an argLetter then the global optarg is + set to point to the argument string (having skipped any white-space). + + The global optind is initially 1 and is always left as the index + of the next argument of argv[] which getopt has not taken. Note + that if "--" or "//" are used then optind is stepped to the next + argument before getopt() returns EOF. + + If an error occurs, that is an SW char precedes an unknown letter, + then getopt() will return a '?' character and normally prints an + error message via perror(). If the global variable opterr is set + to false (zero) before calling getopt() then the error message is + not printed. + + For example, if the MSDOS switch char is '/' (the MSDOS norm) and + + *optionS == "A:F:PuU:wXZ:" + + then 'P', 'u', 'w', and 'X' are option letters and 'F', 'U', 'Z' + are followed by arguments. A valid command line may be: + + aCommand /uPFPi /X /A L someFile + + where: + - 'u' and 'P' will be returned as isolated option letters. + - 'F' will return with "Pi" as its argument string. + - 'X' is an isolated option. + - 'A' will return with "L" as its argument. + - "someFile" is not an option, and terminates getOpt. The + caller may collect remaining arguments using argv pointers. +*/ + +int getopt(int argc, char *argv[], char *optionS) +{ + unsigned char ch; + char *optP; + +#if 0 + if (SW == 0) { + /* get SW using dos call 0x37 */ + _AX = 0x3700; + geninterrupt(0x21); + SW = _DL; + } +#endif + if (argc > optind) { + if (letP == NULL) { + if ((letP = argv[optind]) == NULL || + *(letP++) != SW) goto gopEOF; + if (*letP == SW) { + optind++; goto gopEOF; + } + } + if (0 == (ch = *(letP++))) { + optind++; goto gopEOF; + } + if (':' == ch || (optP = strchr(optionS, ch)) == NULL) + goto gopError; + if (':' == *(++optP)) { + optind++; + if (0 == *letP) { + if (argc <= optind) goto gopError; + letP = argv[optind++]; + } + optarg = letP; + letP = NULL; + } else { + if (0 == *letP) { + optind++; + letP = NULL; + } + optarg = NULL; + } + return ch; + } +gopEOF: + optarg = letP = NULL; + return EOF; + +gopError: + if (argc > optind) + optind++; + optarg = letP = NULL; + errno = EINVAL; + if (opterr) + perror ("get command line option"); + return ('?'); +} +#endif /* HAVE_GETOPT */ + + +#ifndef HAVE_STRERROR +#ifndef HAVE_ERRNO_H +char *strerror(int errnum) { + static char s[32]; + sprintf(s, "ERROR %d", errnum); + return s; +} +#else +char *strerror(int errnum) +{ + switch(errnum) { +#ifdef EPERM + case EPERM: return "Not super-user"; +#endif /* EPERM */ +#ifdef ENOENT + case ENOENT: return "No such file or directory"; +#endif /* ENOENT */ +#ifdef ESRCH + case ESRCH: return "No such process"; +#endif /* ESRCH */ +#ifdef EINTR + case EINTR: return "interrupted system call"; +#endif /* EINTR */ +#ifdef EIO + case EIO: return "I/O error"; +#endif /* EIO */ +#ifdef ENXIO + case ENXIO: return "No such device or address"; +#endif /* ENXIO */ +#ifdef E2BIG + case E2BIG: return "Arg list too long"; +#endif /* E2BIG */ +#ifdef ENOEXEC + case ENOEXEC: return "Exec format error"; +#endif /* ENOEXEC */ +#ifdef EBADF + case EBADF: return "Bad file number"; +#endif /* EBADF */ +#ifdef ECHILD + case ECHILD: return "No children"; +#endif /* ECHILD */ +#ifdef EAGAIN + case EAGAIN: return "Resource temporarily unavailable"; +#endif /* EAGAIN */ +#ifdef EWOULDBLOCK +#if !defined(EAGAIN) || defined(EAGAIN) && EAGAIN != EWOULDBLOCK + case EWOULDBLOCK: return "Resource temporarily unavailable"; +#endif +#endif /* EWOULDBLOCK */ +#ifdef ENOMEM + case ENOMEM: return "Not enough core"; +#endif /* ENOMEM */ +#ifdef EACCES + case EACCES: return "Permission denied"; +#endif /* EACCES */ +#ifdef EFAULT + case EFAULT: return "Bad address"; +#endif /* EFAULT */ +#ifdef ENOTBLK + case ENOTBLK: return "Block device required"; +#endif /* ENOTBLK */ +#ifdef EBUSY + case EBUSY: return "Mount device busy"; +#endif /* EBUSY */ +#ifdef EEXIST + case EEXIST: return "File exists"; +#endif /* EEXIST */ +#ifdef EXDEV + case EXDEV: return "Cross-device link"; +#endif /* EXDEV */ +#ifdef ENODEV + case ENODEV: return "No such device"; +#endif /* ENODEV */ +#ifdef ENOTDIR + case ENOTDIR: return "Not a directory"; +#endif /* ENOTDIR */ +#ifdef EISDIR + case EISDIR: return "Is a directory"; +#endif /* EISDIR */ +#ifdef EINVAL + case EINVAL: return "Invalid argument"; +#endif /* EINVAL */ +#ifdef ENFILE + case ENFILE: return "File table overflow"; +#endif /* ENFILE */ +#ifdef EMFILE + case EMFILE: return "Too many open files"; +#endif /* EMFILE */ +#ifdef ENOTTY + case ENOTTY: return "Inappropriate ioctl for device"; +#endif /* ENOTTY */ +#ifdef ETXTBSY + case ETXTBSY: return "Text file busy"; +#endif /* ETXTBSY */ +#ifdef EFBIG + case EFBIG: return "File too large"; +#endif /* EFBIG */ +#ifdef ENOSPC + case ENOSPC: return "No space left on device"; +#endif /* ENOSPC */ +#ifdef ESPIPE + case ESPIPE: return "Illegal seek"; +#endif /* ESPIPE */ +#ifdef EROFS + case EROFS: return "Read only file system"; +#endif /* EROFS */ +#ifdef EMLINK + case EMLINK: return "Too many links"; +#endif /* EMLINK */ +#ifdef EPIPE + case EPIPE: return "Broken pipe"; +#endif /* EPIPE */ +#ifdef EDOM + case EDOM: return "Math arg out of domain of func"; +#endif /* EDOM */ +#ifdef ERANGE + case ERANGE: return "Math result not representable"; +#endif /* ERANGE */ +#ifdef ENOMSG + case ENOMSG: return "No message of desired type"; +#endif /* ENOMSG */ +#ifdef EIDRM + case EIDRM: return "Identifier removed"; +#endif /* EIDRM */ +#ifdef ECHRNG + case ECHRNG: return "Channel number out of range"; +#endif /* ECHRNG */ +#ifdef EL2NSYNC + case EL2NSYNC: return "Level 2 not synchronized"; +#endif /* EL2NSYNC */ +#ifdef EL3HLT + case EL3HLT: return "Level 3 halted"; +#endif /* EL3HLT */ +#ifdef EL3RST + case EL3RST: return "Level 3 reset"; +#endif /* EL3RST */ +#ifdef ELNRNG + case ELNRNG: return "Link number out of range"; +#endif /* ELNRNG */ +#ifdef EUNATCH + case EUNATCH: return "Protocol driver not attached"; +#endif /* EUNATCH */ +#ifdef ENOCSI + case ENOCSI: return "No CSI structure available"; +#endif /* ENOCSI */ +#ifdef EL2HLT + case EL2HLT: return "Level 2 halted"; +#endif /* EL2HLT */ +#ifdef EDEADLK + case EDEADLK: return "Deadlock condition."; +#endif /* EDEADLK */ +#ifdef ENOLCK + case ENOLCK: return "No record locks available."; +#endif /* ENOLCK */ +#ifdef ECANCELED + case ECANCELED: return "Operation canceled"; +#endif /* ECANCELED */ +#ifdef ENOTSUP + case ENOTSUP: return "Operation not supported"; +#endif /* ENOTSUP */ +#ifdef EDQUOT + case EDQUOT: return "Disc quota exceeded"; +#endif /* EDQUOT */ +#ifdef EBADE + case EBADE: return "invalid exchange"; +#endif /* EBADE */ +#ifdef EBADR + case EBADR: return "invalid request descriptor"; +#endif /* EBADR */ +#ifdef EXFULL + case EXFULL: return "exchange full"; +#endif /* EXFULL */ +#ifdef ENOANO + case ENOANO: return "no anode"; +#endif /* ENOANO */ +#ifdef EBADRQC + case EBADRQC: return "invalid request code"; +#endif /* EBADRQC */ +#ifdef EBADSLT + case EBADSLT: return "invalid slot"; +#endif /* EBADSLT */ +#ifdef EDEADLOCK + case EDEADLOCK: return "file locking deadlock error"; +#endif /* EDEADLOCK */ +#ifdef EBFONT + case EBFONT: return "bad font file fmt"; +#endif /* EBFONT */ +#ifdef ENOSTR + case ENOSTR: return "Device not a stream"; +#endif /* ENOSTR */ +#ifdef ENODATA + case ENODATA: return "no data (for no delay io)"; +#endif /* ENODATA */ +#ifdef ETIME + case ETIME: return "timer expired"; +#endif /* ETIME */ +#ifdef ENOSR + case ENOSR: return "out of streams resources"; +#endif /* ENOSR */ +#ifdef ENONET + case ENONET: return "Machine is not on the network"; +#endif /* ENONET */ +#ifdef ENOPKG + case ENOPKG: return "Package not installed"; +#endif /* ENOPKG */ +#ifdef EREMOTE + case EREMOTE: return "The object is remote"; +#endif /* EREMOTE */ +#ifdef ENOLINK + case ENOLINK: return "the link has been severed"; +#endif /* ENOLINK */ +#ifdef EADV + case EADV: return "advertise error"; +#endif /* EADV */ +#ifdef ESRMNT + case ESRMNT: return "srmount error"; +#endif /* ESRMNT */ +#ifdef ECOMM + case ECOMM: return "Communication error on send"; +#endif /* ECOMM */ +#ifdef EPROTO + case EPROTO: return "Protocol error"; +#endif /* EPROTO */ +#ifdef EMULTIHOP + case EMULTIHOP: return "multihop attempted"; +#endif /* EMULTIHOP */ +#ifdef EBADMSG + case EBADMSG: return "trying to read unreadable message"; +#endif /* EBADMSG */ +#ifdef ENAMETOOLONG + case ENAMETOOLONG: return "path name is too long"; +#endif /* ENAMETOOLONG */ +#ifdef EOVERFLOW + case EOVERFLOW: return "value too large to be stored in data type"; +#endif /* EOVERFLOW */ +#ifdef ENOTUNIQ + case ENOTUNIQ: return "given log. name not unique"; +#endif /* ENOTUNIQ */ +#ifdef EBADFD + case EBADFD: return "f.d. invalid for this operation"; +#endif /* EBADFD */ +#ifdef EREMCHG + case EREMCHG: return "Remote address changed"; +#endif /* EREMCHG */ +#ifdef ELIBACC + case ELIBACC: return "Can't access a needed shared lib."; +#endif /* ELIBACC */ +#ifdef ELIBBAD + case ELIBBAD: return "Accessing a corrupted shared lib."; +#endif /* ELIBBAD */ +#ifdef ELIBSCN + case ELIBSCN: return ".lib section in a.out corrupted."; +#endif /* ELIBSCN */ +#ifdef ELIBMAX + case ELIBMAX: return "Attempting to link in too many libs."; +#endif /* ELIBMAX */ +#ifdef ELIBEXEC + case ELIBEXEC: return "Attempting to exec a shared library."; +#endif /* ELIBEXEC */ +#ifdef EILSEQ + case EILSEQ: return "Illegal byte sequence."; +#endif /* EILSEQ */ +#ifdef ENOSYS + case ENOSYS: return "Unsupported file system operation"; +#endif /* ENOSYS */ +#ifdef ELOOP + case ELOOP: return "Symbolic link loop"; +#endif /* ELOOP */ +#ifdef ERESTART + case ERESTART: return "Restartable system call"; +#endif /* ERESTART */ +#ifdef ESTRPIPE + case ESTRPIPE: return "if pipe/FIFO, don't sleep in stream head"; +#endif /* ESTRPIPE */ +#ifdef ENOTEMPTY + case ENOTEMPTY: return "directory not empty"; +#endif /* ENOTEMPTY */ +#ifdef EUSERS + case EUSERS: return "Too many users (for UFS)"; +#endif /* EUSERS */ +#ifdef ENOTSOCK + case ENOTSOCK: return "Socket operation on non-socket"; +#endif /* ENOTSOCK */ +#ifdef EDESTADDRREQ + case EDESTADDRREQ: return "Destination address required"; +#endif /* EDESTADDRREQ */ +#ifdef EMSGSIZE + case EMSGSIZE: return "Message too long"; +#endif /* EMSGSIZE */ +#ifdef EPROTOTYPE + case EPROTOTYPE: return "Protocol wrong type for socket"; +#endif /* EPROTOTYPE */ +#ifdef ENOPROTOOPT + case ENOPROTOOPT: return "Protocol not available"; +#endif /* ENOPROTOOPT */ +#ifdef EPROTONOSUPPORT + case EPROTONOSUPPORT: return "Protocol not supported"; +#endif /* EPROTONOSUPPORT */ +#ifdef ESOCKTNOSUPPORT + case ESOCKTNOSUPPORT: return "Socket type not supported"; +#endif /* ESOCKTNOSUPPORT */ +#ifdef EOPNOTSUPP + case EOPNOTSUPP: return "Operation not supported on socket"; +#endif /* EOPNOTSUPP */ +#ifdef EPFNOSUPPORT + case EPFNOSUPPORT: return "Protocol family not supported"; +#endif /* EPFNOSUPPORT */ +#ifdef EAFNOSUPPORT + case EAFNOSUPPORT: return "Address family not supported by"; +#endif /* EAFNOSUPPORT */ +#ifdef EADDRINUSE + case EADDRINUSE: return "Address already in use"; +#endif /* EADDRINUSE */ +#ifdef EADDRNOTAVAIL + case EADDRNOTAVAIL: return "Can't assign requested address"; +#endif /* EADDRNOTAVAIL */ +#ifdef ENETDOWN + case ENETDOWN: return "Network is down"; +#endif /* ENETDOWN */ +#ifdef ENETUNREACH + case ENETUNREACH: return "Network is unreachable"; +#endif /* ENETUNREACH */ +#ifdef ENETRESET + case ENETRESET: return "Network dropped connection because"; +#endif /* ENETRESET */ +#ifdef ECONNABORTED + case ECONNABORTED: return "Software caused connection abort"; +#endif /* ECONNABORTED */ +#ifdef ECONNRESET + case ECONNRESET: return "Connection reset by peer"; +#endif /* ECONNRESET */ +#ifdef ENOBUFS + case ENOBUFS: return "No buffer space available"; +#endif /* ENOBUFS */ +#ifdef EISCONN + case EISCONN: return "Socket is already connected"; +#endif /* EISCONN */ +#ifdef ENOTCONN + case ENOTCONN: return "Socket is not connected"; +#endif /* ENOTCONN */ +#ifdef ESHUTDOWN + case ESHUTDOWN: return "Can't send after socket shutdown"; +#endif /* ESHUTDOWN */ +#ifdef ETOOMANYREFS + case ETOOMANYREFS: return "Too many references: can't splice"; +#endif /* ETOOMANYREFS */ +#ifdef ETIMEDOUT + case ETIMEDOUT: return "Connection timed out"; +#endif /* ETIMEDOUT */ +#ifdef ECONNREFUSED + case ECONNREFUSED: return "Connection refused"; +#endif /* ECONNREFUSED */ +#ifdef EHOSTDOWN + case EHOSTDOWN: return "Host is down"; +#endif /* EHOSTDOWN */ +#ifdef EHOSTUNREACH + case EHOSTUNREACH: return "No route to host"; +#endif /* EHOSTUNREACH */ +#ifdef EALREADY + case EALREADY: return "operation already in progress"; +#endif /* EALREADY */ +#ifdef EINPROGRESS + case EINPROGRESS: return "operation now in progress"; +#endif /* EINPROGRESS */ +#ifdef ESTALE + case ESTALE: return "Stale NFS file handle"; +#endif /* ESTALE */ + default: { + static char s[32]; + sprintf(s, "ERROR %d", errnum); + return s; + } + } + /*NOTREACHED*/ +} +#endif /* HAVE_ERRNO_H */ +#endif /* HAVE_STRERROR */ + + +#ifndef HAVE_USLEEP +int usleep(unsigned int usec) +{ +#if defined(HAVE_SELECT) + struct timeval tv; + tv.tv_sec = usec / 1000000; + tv.tv_usec = usec % 1000000; + select(0, NULL, NULL, NULL, &tv); +#elif defined(__WIN32__) + Sleep(usec / 1000); +#endif /* HAVE_SELECT */ + return 0; +} +#endif /* HAVE_USLEEP */ diff -ruN TiMidity++-1.2.1/utils/timer.c TiMidity++-1.3.0/utils/timer.c --- TiMidity++-1.2.1/utils/timer.c Mon Nov 30 18:20:47 1998 +++ TiMidity++-1.3.0/utils/timer.c Mon Feb 1 11:01:08 1999 @@ -24,7 +24,7 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ -#ifndef __WIN32__ /* UNIX */ +#if defined(HAVE_GETTIMEOFDAY) #include #include #include @@ -51,7 +51,7 @@ return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0 ; } -#else /* Windows */ +#else /* Windows API */ #include #include