diff -ruN ump.old/Makefile.am ump/Makefile.am --- ump.old/Makefile.am Mon Apr 10 13:16:39 2000 +++ ump/Makefile.am Mon Apr 10 13:19:25 2000 @@ -1,5 +1,5 @@ # TiMidity++ -- MIDI to WAVE converter and player -# Copyright (C) 1999 Masanao Izumo +# Copyright (C) 1999,2000 Masanao Izumo # Copyright (C) 1995 Tuukka Toivonen # # This program is free software; you can redistribute it and/or modify @@ -26,6 +26,7 @@ -I$(top_srcdir)/interface \ -I$(top_srcdir)/utils \ -I$(top_srcdir)/timidity \ + -I$(top_srcdir)/libunimod \ $(EXTRAINCS) noinst_LIBRARIES = libump.a @@ -73,7 +74,9 @@ all: ump -ump: $(UMPOBJS) +ump: $(UMP) + +$(UMP): $(UMPOBJS) for f in libarc utils interface; do (cd $(top_builddir)/$$f; $(MAKE)); done cd $(top_builddir)/timidity; $(MAKE) objs $(SHLD) -o $(UMP) $(LDFLAGS) $(UMPOBJS) \ @@ -81,6 +84,7 @@ $(top_builddir)/libarc/*.o \ $(top_builddir)/utils/*.o \ $(top_builddir)/interface/*.o \ + $(top_builddir)/libunimod/*.o \ $(UMPLINKS) clean: diff -ruN ump.old/Makefile.in ump/Makefile.in --- ump.old/Makefile.in Mon Apr 10 13:16:39 2000 +++ ump/Makefile.in Mon Apr 10 13:04:09 2000 @@ -32,7 +32,7 @@ # TiMidity++ -- MIDI to WAVE converter and player -# Copyright (C) 1999 Masanao Izumo +# Copyright (C) 1999,2000 Masanao Izumo # Copyright (C) 1995 Tuukka Toivonen # # This program is free software; you can redistribute it and/or modify @@ -50,6 +50,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Define follows if you want to change. +# Note that the definition of beginning with just one `#' implies +# default value from configure. srcdir = @srcdir@ @@ -72,8 +74,6 @@ oldincludedir = /usr/include DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. @@ -109,7 +109,6 @@ ESD_CFLAGS = @ESD_CFLAGS@ ESD_CONFIG = @ESD_CONFIG@ ESD_LIBS = @ESD_LIBS@ -EXEEXT = @EXEEXT@ EXTRALIBS = @EXTRALIBS@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ @@ -130,17 +129,20 @@ program_transform_name = @program_transform_name@ so = @so@ tcltk_dep = @tcltk_dep@ +timidity_LDFLAGS = @timidity_LDFLAGS@ SHELL = /bin/sh #CC= gcc -#CFLAGS = -O3 -Wall -mv8 -funroll-all-loops -fomit-frame-pointer -msupersparc -DAUDIO_FILLING_MILSEC=5000 -#CPPFLAGS = -I/usr1/home/mo/opt/include -I/usr/local/include -I/usr/local/X11/include -I/usr1/home/mo/opt/lib/glib/include -DENABLE_SHERRY -DSOLARIS -DAU_NAS -DAU_SUN -DTKPROGPATH=\"$(TCL_DIR)/tkmidity.tcl\" -DXAW3D -DSUPPORT_SOCKET -DSUPPORT_SOUNDSPEC -DWRDT_X -DDEFAULT_PATH=\"$(TIMID_DIR)\" +#CFLAGS = -DXP_UNIX -fPIC -O2 +# For pentium gcc +# For PGCC +#CPPFLAGS = -I/usr/local/include -I/usr/local/X11/include -DSOLARIS -DAU_SUN $(DEF_PKGDATADIR) $(DEF_PKGLIBDIR) $(DEF_DEFAULT_PATH) -DTIMIDITY_OUTPUT_ID=\"d\" #DEFS = -DHAVE_CONFIG_H -#LDFLAGS = -L/usr1/home/mo/opt/lib -L/usr/local/lib -L/usr/local/X11/lib -#LIBS = -ltk4.2jp -ltcl7.6jp -lXm -lXaw3d -lXmu -lXt -lSM -lICE -lXext -lX11 -lnsl -lsocket -lm -lncurses -lslang -L/usr1/home/mo/opt/lib -L/usr/local/X11/lib -R/usr/local/X11/lib -lgtk -lgdk -lgmodule -lglib -ldl -lintl -lXext -lX11 -lsocket -lnsl -lw -lm -ldl -lpng -lz /usr/local/X11/lib/libaudio.a -#SHLD = /usr/ccs/bin/ld -G -L/usr1/home/mo/opt/lib -L/usr/local/lib -L/usr/local/X11/lib +#LDFLAGS = -L/usr/local/lib -L/usr/local/X11/lib +#LIBS = -lXmu -lXt -lSM -lICE -lXext -lX11 -lnsl -lsocket -lm -ldl +#SHLD = /usr/ccs/bin/ld -G -L/usr/local/lib -L/usr/local/X11/lib #SHCFLAGS = -fPIC # @@ -148,19 +150,40 @@ #exec_prefix = ${prefix} #bindir = ${exec_prefix}/bin #libdir = ${exec_prefix}/lib +#datadir = ${prefix}/share #mandir = ${prefix}/man pkglibdir = $(libdir)/timidity +pkgdatadir = $(datadir)/timidity #INSTALL = ./install-sh -c -# Where to install the patches, config files, and MIDI files. -# If you change this, it's a good idea to recompile the binary, -# or you'll need to invoke timidity with the -L option. -TIMID_DIR = $(pkglibdir) +# Where to install the patches, config files. +PKGDATADIR = $(pkgdatadir) -# Where to install the Tcl code, if you use the Tcl code that is. -TCL_DIR = $(pkglibdir) +# Where to install the Tcl code and the bitmaps. +# It also contains bitmaps which are shared with XAW interface. +PKGLIBDIR = $(pkglibdir) + +# Where to install the dynamic link interface. +SHLIB_DIR = $(pkglibdir) + +# Where to install timidity.el +ELISP_DIR = $(pkgdatadir) + +# Comment out if you don't want default path. +DEF_DEFAULT_PATH = -DDEFAULT_PATH=\"$(PKGDATADIR)\" + +# If you want to change TCL_DIR, please do follows. +# * Add -DTKPROGPATH=\"$(TCL_DIR)/tkmidity.tcl\" to CPPFLAGS. +# * Make a symbolic link $(PKGLIBDIR)/bitmaps to $(TCL_DIR)/bitmaps +TCL_DIR = $(PKGLIBDIR) + +# You sould not change follows definitions. +DEF_PKGDATADIR = -DPKGDATADIR=\"$(PKGDATADIR)\" +DEF_PKGLIBDIR = -DPKGLIBDIR=\"$(PKGLIBDIR)\" +DEF_SHLIB_DIR = -DSHLIB_DIR=\"$(SHLIB_DIR)\" +BITMAP_DIR = $(TCL_DIR)/bitmaps -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libarc -I$(top_srcdir)/interface -I$(top_srcdir)/utils -I$(top_srcdir)/timidity $(EXTRAINCS) +INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libarc -I$(top_srcdir)/interface -I$(top_srcdir)/utils -I$(top_srcdir)/timidity -I$(top_srcdir)/libunimod $(EXTRAINCS) noinst_LIBRARIES = libump.a @@ -411,7 +434,9 @@ all: ump -ump: $(UMPOBJS) +ump: $(UMP) + +$(UMP): $(UMPOBJS) for f in libarc utils interface; do (cd $(top_builddir)/$$f; $(MAKE)); done cd $(top_builddir)/timidity; $(MAKE) objs $(SHLD) -o $(UMP) $(LDFLAGS) $(UMPOBJS) \ @@ -419,6 +444,7 @@ $(top_builddir)/libarc/*.o \ $(top_builddir)/utils/*.o \ $(top_builddir)/interface/*.o \ + $(top_builddir)/libunimod/*.o \ $(UMPLINKS) clean: diff -ruN ump.old/UnixShell.c ump/UnixShell.c --- ump.old/UnixShell.c Mon Apr 10 13:16:48 2000 +++ ump/UnixShell.c Mon Apr 10 13:27:59 2000 @@ -29,6 +29,11 @@ #include "npapi.h" #include /* struct timeval */ #include /* maximum # of file descriptors */ +#ifndef NO_STRING_H +#include +#else +#include +#endif /* ** Stuff for the NPP_SetWindow method: @@ -258,8 +263,8 @@ "audio/x-lha-midi:lzh:MIDI Audio;" "audio/x-zipped-midi:zip:MIDI Audio;" "audio/x-zipped-mod:zip:MOD Audio;" - "audio/x-mod:zip:MOD Audio;"; - + "audio/x-mod:mod,xm,s3m,it,669,amf,dsm,far,gdm,imf,med,mtm,stm,stx,ult,uni:MOD Audio;"; + return(desc); } @@ -321,17 +326,9 @@ NPSavedData* saved) { PluginInstance* This; - char* ext = "mid"; if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; - - if (strncmp(pluginType, "audio/x-zipped", 13) == 0) ext = "zip"; -#if 0 - else if (strncmp(pluginType, "audio/x-gzipped", 15) == 0) ext = "gz"; -#endif - else if (strncmp(pluginType, "audio/x-lha", 11) == 0) ext = "lzh"; - else if (strncmp(pluginType, "audio/x-mod", 11) == 0) ext = "mod"; instance->pdata = NPN_MemAlloc(sizeof(PluginInstance)); @@ -343,9 +340,7 @@ { /* construct a filename unique to this instance to store the data in */ - static char buf[256]; - snprintf(buf, sizeof(buf), "%s%x.mid", filestub, This); - This->filename = buf; + This->filename = NULL; This->pid = -1; This->pipes[1] = -1; This->pipes[0] = -1; @@ -420,7 +415,8 @@ if (This != NULL) { /* get rid of the temporary file */ - (void) unlink(This->filename); + if(This->filename != NULL) + (void) unlink(This->filename); /* clean up IPC */ close(This->pipes[1]); @@ -841,16 +837,31 @@ uint16 *stype) { PluginInstance* This; - + const char *ext, *p; + static char buf[256]; + if (instance == NULL) return NPERR_INVALID_INSTANCE_ERROR; This = (PluginInstance*) instance->pdata; - + + /* create template filename */ + ext = stream->url; + if((p = strrchr(ext, '/')) != NULL) + ext = p + 1; + if((p = strchr(ext, '.')) != NULL) + ext = p + 1; + snprintf(buf, sizeof(buf), "%s%x.%s", filestub, This, ext); + This->filename = buf; + /* open the file to store data in */ + unlink(This->filename); /* for security. */ This->fd = open(This->filename, O_RDWR|O_CREAT, 0666); - if(This->fd == -1) return NPERR_GENERIC_ERROR; - + if(This->fd == -1) { + unlink(This->filename); + This->filename = NULL; + return NPERR_GENERIC_ERROR; + } return NPERR_NO_ERROR; }