OSDN Git Service

TiMidity++-1.3.4
authorMasanao Izumo <mo@goice.co.jp>
Mon, 1 Mar 1999 10:57:31 +0000 (19:57 +0900)
committerMasanao Izumo <mo@goice.co.jp>
Mon, 1 Mar 1999 10:57:31 +0000 (19:57 +0900)
18 files changed:
AUTHORS
ChangeLog
NEWS
configure
configure.in
interface/Makefile.in
interface/gtk_i.c
interface/pixmaps/Makefile.am
interface/pixmaps/Makefile.in
interface/pixmaps/timidity.xpm [new file with mode: 0644]
interface/x_wrdwindow.c
interface/xaw_c.c
interface/xaw_i.c
timidity/aiff_a.c
timidity/au_a.c
timidity/instrum.h
timidity/wave_a.c
utils/support.c

diff --git a/AUTHORS b/AUTHORS
index 4abe63d..f26db48 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,4 +24,5 @@ TiMidity++:
      Isaku Yamahata <yamahata@kusm.kyoto-u.ac.jp>
      Yoshishige Arai <ryo2@on.rim.or.jp>
      Glenn Trigg <ggt@netspace.net.au>
+     Colour window manager icon by Tim Allen <thristian@usa.net>
   and other many people sends information and bug-fix codes.
index 0b1256b..bb6a084 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+-- 1.3.4
+Mon Mar 1 1999
+Summary:
+    * In XAW interface, fixed bug about MIDI title displaying.
+    * In GTK interface:
+      Fixed the button highlight problem.
+      Added a new WM-icon provided by Tim Allen.
+      Defined the wmclass & wmname to make TiMidity friendlier to window
+      managers.
+    * Fixed otner bugs or probrems.
+
+Date: Sat Feb 27 1999
+From: Masanao Izumo <mo@goice.co.jp>
+Files: interface/xaw_c.c
+    In XAW interface, fixed bug about MIDI title displaying.
+
+Fri Feb 26 JST 1999
+From: Masanao Izumo <mo@goice.co.jp>
+Files: timidity/au_a.c timidity/wave_a.c timidity/aiff_a.c
+    Handled write error at opening.
+Files: timidity/instrum.h
+    Fixed bug of buffer over-run of inst_map_table.
+Files: utils/support.c
+    Fixed bug of strdup implementation.
+
+Date: Fri, 26 Feb 1999 22:45:34 +1100 (EST)
+From: ggt@netspace.net.au (Glenn Trigg), thristian@usa.net (Tim Allen)
+Files: interface/gtk_i.c
+    In GTK interface:
+      Fixed the button highlight problem. I'd forgotten about the mask!
+      Added a nice colorful icon provided by Tim Allen.
+      Defined the wmclass & wmname to make TiMidity friendlier to window
+      managers.
+
+Date: Thu, 25 Feb 1999 01:17:45 +0900 (JST)
+From: Yoshishige Arai <ryo2@on.rim.or.jp>
+Files: interface/xaw_i.c
+    Fixed probrem of cascade file selection popup menu.
+
 -- 1.3.3
 Wed Feb 24 1999
 Summary:
diff --git a/NEWS b/NEWS
index 3ef42ab..f2f243b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+* 3/1, 1999
+    Released TiMidity++ v1.3.4.
+    * Fixed some bugs and probrems.
+    * Added a new WM-icon for GTK.
+
 * 2/24, 1999
     Released TiMidity++ v1.3.3.
     * Improve XAW interface.
index f0f05cc..c198d8e 100755 (executable)
--- a/configure
+++ b/configure
@@ -836,7 +836,7 @@ fi
 
 PACKAGE=TiMidity++
 
-VERSION=1.3.3
+VERSION=1.3.4
 
 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; }
@@ -1039,7 +1039,7 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib"
 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 SHLDFLAGS=${SHLDFLAGS:-$LDFLAGS}
 
-if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix"; then
+if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
   LDFLAGS="-L$prefix/lib $LDFLAGS"
   SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
   CPPFLAGS="-I$prefix/include $CPPFLAGS"
index 1551925..bda6ad7 100644 (file)
@@ -54,7 +54,7 @@ dnl SHCFLAGS  - Additional flags to compile shared object library.
 
 AC_INIT(timidity/timidity.c)
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(TiMidity++, 1.3.3, no-define)
+AM_INIT_AUTOMAKE(TiMidity++, 1.3.4, no-define)
 
 dnl To use CONTAINS() macro (See acinclude.m4)
 CONTAINS_INIT
@@ -104,7 +104,7 @@ CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 SHLDFLAGS=${SHLDFLAGS:-$LDFLAGS}
 
 dnl add $prefix if specified.
-if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix"; then
+if test "x$prefix" != xNONE -a "x$prefix" != "x$ac_default_prefix" -a "x$prefix" != "x/usr"; then
   LDFLAGS="-L$prefix/lib $LDFLAGS"
   SHLDFLAGS="-L$prefix/lib $SHLDFLAGS"
   CPPFLAGS="-I$prefix/include $CPPFLAGS"
index 287d580..589543e 100644 (file)
@@ -442,7 +442,7 @@ gtk_i.o: gtk_i.c ../config.h ../timidity/timidity.h ../timidity/common.h \
        pixmaps/ff.xpm pixmaps/restart.xpm pixmaps/quit.xpm \
        pixmaps/quiet.xpm pixmaps/loud.xpm pixmaps/open.xpm \
        pixmaps/keyup.xpm pixmaps/keydown.xpm pixmaps/slow.xpm \
-       pixmaps/fast.xpm
+       pixmaps/fast.xpm pixmaps/timidity.xpm
 gtk_p.o: gtk_p.c ../config.h ../timidity/timidity.h \
        ../timidity/controls.h gtk_h.h
 motif_c.o: motif_c.c ../config.h ../timidity/timidity.h \
index ed0f9d6..144167a 100644 (file)
@@ -50,6 +50,7 @@
 #include "pixmaps/keydown.xpm"
 #include "pixmaps/slow.xpm"
 #include "pixmaps/fast.xpm"
+#include "pixmaps/timidity.xpm"
 
 static GtkWidget *create_menubar(void);
 static GtkWidget *create_button_with_pixmap(GtkWidget *, gchar **, gint, gchar *);
@@ -66,6 +67,7 @@ static void filer_cb(GtkWidget *, gpointer);
 static void tt_toggle_cb(GtkWidget *, gpointer);
 static void locate_update_cb(GtkWidget *, GdkEventButton *, gpointer);
 static void my_adjustment_set_value(GtkAdjustment *, gint);
+static void set_icon_pixmap(GtkWidget *, gchar **);
 
 static GtkWidget *window, *clist, *text, *vol_scale, *locator;
 static GtkWidget *filesel = NULL;
@@ -229,8 +231,9 @@ Launch_Gtk_Process(int pipe_number)
 
     ttip = create_yellow_tooltips();
     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-    gtk_widget_set_name(window, "Timidity - MIDI Player");
-    gtk_window_set_title(GTK_WINDOW(window), "Timidity - MIDI Player");
+    gtk_widget_set_name(window, "TiMidity");
+    gtk_window_set_title(GTK_WINDOW(window), "TiMidity - MIDI Player");
+    gtk_window_set_wmclass(GTK_WINDOW(window), "timidity", "TiMidity");
 
     gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                       GTK_SIGNAL_FUNC (delete_event), NULL);
@@ -315,6 +318,7 @@ Launch_Gtk_Process(int pipe_number)
 
     /* This is so the pixmap creation works properly. */
     gtk_widget_realize(window);
+    set_icon_pixmap(window, timidity_xpm);
 
     gtk_box_pack_start(GTK_BOX(vbox2),
                       create_pixmap_label(window, loud_xpm),
@@ -430,7 +434,7 @@ create_button_with_pixmap(GtkWidget *window, gchar **bits, gint data, gchar *the
                                          &mask,
                                          &style->bg[GTK_STATE_NORMAL],
                                          bits);
-    pw = gtk_pixmap_new(pixmap, NULL);
+    pw = gtk_pixmap_new(pixmap, mask);
     gtk_widget_show(pw);
 
     button = gtk_button_new();
@@ -457,12 +461,29 @@ create_pixmap_label(GtkWidget *window, gchar **bits)
                                          &mask,
                                          &style->bg[GTK_STATE_NORMAL],
                                          bits);
-    pw = gtk_pixmap_new(pixmap, NULL);
+    pw = gtk_pixmap_new(pixmap, mask);
     gtk_widget_show(pw);
 
     return pw;
 }
 
+static void
+set_icon_pixmap(GtkWidget *window, gchar **bits)
+{
+    GtkWidget  *pw;
+    GdkPixmap  *pixmap;
+    GdkBitmap  *mask;
+    GtkStyle   *style;
+
+    style = gtk_widget_get_style(window);
+    pixmap = gdk_pixmap_create_from_xpm_d(window->window,
+                                         &mask,
+                                         &style->bg[GTK_STATE_NORMAL],
+                                         bits);
+    gdk_window_set_icon(window->window, NULL, pixmap, mask);
+    gdk_window_set_icon_name(window->window, "TiMidity");
+}
+
 static GtkWidget *
 create_menubar(void)
 {
index 23b9fc7..ba71dbf 100644 (file)
@@ -33,6 +33,7 @@ PIXMAPS = \
        slow.xpm \
        restart.xpm \
        keyup.xpm \
-       keydown.xpm
+       keydown.xpm \
+       timidity.xpm
 
 EXTRA_DIST = $(PIXMAPS)
index af06d25..fac683d 100644 (file)
@@ -124,7 +124,8 @@ PIXMAPS = \
        slow.xpm \
        restart.xpm \
        keyup.xpm \
-       keydown.xpm
+       keydown.xpm \
+       timidity.xpm
 
 EXTRA_DIST = $(PIXMAPS)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/interface/pixmaps/timidity.xpm b/interface/pixmaps/timidity.xpm
new file mode 100644 (file)
index 0000000..eecb648
--- /dev/null
@@ -0,0 +1,496 @@
+/* XPM */
+static char * timidity_xpm[] = {
+"48 48 445 2",
+"      c None",
+".     c #7E7D73",
+"+     c #7D7C72",
+"@     c #7C7C71",
+"#     c #7C7B70",
+"$     c #7B7B6E",
+"%     c #7B7A6D",
+"&     c #7A7A6C",
+"*     c #7A796B",
+"=     c #79796A",
+"-     c #797869",
+";     c #605D42",
+">     c #7C7B6F",
+",     c #7B7A6E",
+"'     c #7A7A6D",
+")     c #565656",
+"!     c #151515",
+"~     c #131313",
+"{     c #121212",
+"]     c #111111",
+"^     c #101010",
+"/     c #0F0F0F",
+"(     c #383838",
+"_     c #030303",
+":     c #010101",
+"<     c #000000",
+"[     c #020202",
+"}     c #FBF9E2",
+"|     c #FAF8DF",
+"1     c #F8F7DD",
+"2     c #F7F6DB",
+"3     c #F6F5D8",
+"4     c #F5F4D6",
+"5     c #F4F3D4",
+"6     c #C4BE87",
+"7     c #FDFBE6",
+"8     c #FBFAE3",
+"9     c #FAF9E1",
+"0     c #F9F8DE",
+"a     c #AFAFAF",
+"b     c #303030",
+"c     c #2E2E2E",
+"d     c #2C2C2C",
+"e     c #2A2A2A",
+"f     c #272727",
+"g     c #252525",
+"h     c #727272",
+"i     c #0D0D0D",
+"j     c #090909",
+"k     c #050505",
+"l     c #0E0E0E",
+"m     c #0B0B0B",
+"n     c #080808",
+"o     c #040404",
+"p     c #0A0A0A",
+"q     c #070707",
+"r     c #D7D7D7",
+"s     c #F8F7DC",
+"t     c #F7F6DA",
+"u     c #F6F5D7",
+"v     c #F5F4D5",
+"w     c #F3F3D3",
+"x     c #FDFBE7",
+"y     c #FCFAE4",
+"z     c #363636",
+"A     c #343434",
+"B     c #323232",
+"C     c #2F2F2F",
+"D     c #2D2D2D",
+"E     c #2B2B2B",
+"F     c #1A1A1A",
+"G     c #161616",
+"H     c #0C0C0C",
+"I     c #060606",
+"J     c #818181",
+"K     c #F3F2D2",
+"L     c #FEFCE8",
+"M     c #373737",
+"N     c #353535",
+"O     c #333333",
+"P     c #313131",
+"Q     c #232323",
+"R     c #1F1F1F",
+"S     c #1C1C1C",
+"T     c #181818",
+"U     c #1E1E1E",
+"V     c #1B1B1B",
+"W     c #141414",
+"X     c #787868",
+"Y     c #F2F2D0",
+"Z     c #FFFDE9",
+"`     c #919191",
+" .    c #292929",
+"..    c #212121",
+"+.    c #262626",
+"@.    c #191919",
+"#.    c #F7F6D9",
+"$.    c #242424",
+"%.    c #202020",
+"&.    c #B9B9B9",
+"*.    c #F3F2D1",
+"=.    c #F2F1CF",
+"-.    c #F0F0CC",
+";.    c #222222",
+">.    c #1D1D1D",
+",.    c #171717",
+"'.    c #828282",
+").    c #F1F1CE",
+"!.    c #7B7B6F",
+"~.    c #F8F8E7",
+"{.    c #F7F7E5",
+"].    c #F0F0CB",
+"^.    c #EFEFC8",
+"/.    c #282828",
+"(.    c #EFEFCA",
+"_.    c #F7F7E3",
+":.    c #E1DEC3",
+"<.    c #FCFBEF",
+"[.    c #7D7C71",
+"}.    c #FBFBED",
+"|.    c #6F6E65",
+"1.    c #E2E0CE",
+"2.    c #787767",
+"3.    c #9C9C9C",
+"4.    c #646246",
+"5.    c #C5C38C",
+"6.    c #626146",
+"7.    c #C2C08A",
+"8.    c #BCBA87",
+"9.    c #B6B483",
+"0.    c #C8C8C8",
+"a.    c #616045",
+"b.    c #BFBD89",
+"c.    c #B9B785",
+"d.    c #B3B182",
+"e.    c #ADAB7E",
+"f.    c #A7A57B",
+"g.    c #5F5E44",
+"h.    c #B0AE80",
+"i.    c #AAA87C",
+"j.    c #A4A279",
+"k.    c #9E9D76",
+"l.    c #6B683F",
+"m.    c #5E5D43",
+"n.    c #A19F77",
+"o.    c #CCC88F",
+"p.    c #5C5B42",
+"q.    c #C8C68E",
+"r.    c #FBFAEC",
+"s.    c #3E3123",
+"t.    c #7F6548",
+"u.    c #FAF9EA",
+"v.    c #4B3C2A",
+"w.    c #987A55",
+"x.    c #F9F9E9",
+"y.    c #987953",
+"z.    c #987952",
+"A.    c #987A54",
+"B.    c #977951",
+"C.    c #977850",
+"D.    c #97784F",
+"E.    c #977851",
+"F.    c #97784E",
+"G.    c #97774D",
+"H.    c #96774B",
+"I.    c #644F39",
+"J.    c #CCA174",
+"K.    c #96774C",
+"L.    c #96764B",
+"M.    c #96764A",
+"N.    c #967548",
+"O.    c #FDFCF1",
+"P.    c #4D3710",
+"Q.    c #A47524",
+"R.    c #868560",
+"S.    c #43C2AE",
+"T.    c #43C1AE",
+"U.    c #967649",
+"V.    c #957546",
+"W.    c #957445",
+"X.    c #FCFCF0",
+"Y.    c #46310F",
+"Z.    c #966B21",
+"`.    c #9E7122",
+" +    c #819354",
+".+    c #5BD4C0",
+"++    c #00FFFF",
+"@+    c #32D1C2",
+"#+    c #957547",
+"$+    c #957444",
+"%+    c #957443",
+"&+    c #947342",
+"*+    c #BFFBFF",
+"=+    c #00E4FF",
+"-+    c #00DBFF",
+";+    c #00CBFF",
+">+    c #00C6FE",
+",+    c #00C1F7",
+"'+    c #00A8D8",
+")+    c #FBFBEE",
+"!+    c #3F2C0D",
+"~+    c #88611E",
+"{+    c #708650",
+"]+    c #B5A583",
+"^+    c #947341",
+"/+    c #947240",
+"(+    c #00E7FF",
+"_+    c #00CCFF",
+":+    c #00A7D6",
+"<+    c #0091BA",
+"[+    c #00A6D5",
+"}+    c #38280C",
+"|+    c #7A571A",
+"1+    c #815C1C",
+"2+    c #5B8F69",
+"3+    c #00F7FF",
+"4+    c #00FEFF",
+"5+    c #35B6B5",
+"6+    c #A77725",
+"7+    c #947340",
+"8+    c #94723F",
+"9+    c #77F5FF",
+"0+    c #93713D",
+"a+    c #93713B",
+"b+    c #00C2F8",
+"c+    c #30230A",
+"d+    c #6B4C17",
+"e+    c #735219",
+"f+    c #7B581B",
+"g+    c #00D5FF",
+"h+    c #20AEC9",
+"i+    c #67734C",
+"j+    c #7F753E",
+"k+    c #94723E",
+"l+    c #F9F8E8",
+"m+    c #2A1E08",
+"n+    c #5D4214",
+"o+    c #18D7CB",
+"p+    c #00ABDB",
+"q+    c #2197AA",
+"r+    c #9C7022",
+"s+    c #C9C68E",
+"t+    c #C4C28C",
+"u+    c #F8F8E6",
+"v+    c #231807",
+"w+    c #4F3811",
+"x+    c #13CFCA",
+"y+    c #00FAFF",
+"z+    c #27A4B2",
+"A+    c #54684B",
+"B+    c #596846",
+"C+    c #8E651F",
+"D+    c #A67624",
+"E+    c #937039",
+"F+    c #927038",
+"G+    c #926F37",
+"H+    c #926F35",
+"I+    c #926E34",
+"J+    c #916E33",
+"K+    c #916D31",
+"L+    c #0089B0",
+"M+    c #C7C48D",
+"N+    c #C2BF8A",
+"O+    c #BDBA87",
+"P+    c #B8B684",
+"Q+    c #B3B181",
+"R+    c #1C1305",
+"S+    c #402E0E",
+"T+    c #483410",
+"U+    c #503911",
+"V+    c #00A4D2",
+"W+    c #00B0E2",
+"X+    c #227078",
+"Y+    c #705018",
+"Z+    c #78561A",
+"`+    c #805B1C",
+" @    c #90671F",
+".@    c #986C21",
+"+@    c #A07223",
+"@@    c #926F36",
+"#@    c #916E32",
+"$@    c #0082A6",
+"%@    c #906C2E",
+"&@    c #C4C18B",
+"*@    c #BFBC88",
+"=@    c #BAB886",
+"-@    c #B5B383",
+";@    c #ABA97D",
+">@    c #FFFEF4",
+",@    c #140E04",
+"'@    c #32240B",
+")@    c #3A290C",
+"!@    c #422F0E",
+"~@    c #0085AB",
+"{@    c #00A1CE",
+"]@    c #1E6A73",
+"^@    c #624615",
+"/@    c #6A4B17",
+"(@    c #725119",
+"_@    c #89621E",
+":@    c #916820",
+"<@    c #996D21",
+"[@    c #916D30",
+"}@    c #906C2C",
+"|@    c #906B2B",
+"1@    c #C6C38C",
+"2@    c #C1BE89",
+"3@    c #B7B584",
+"4@    c #B2B081",
+"5@    c #A8A77B",
+"6@    c #F0EFE6",
+"7@    c #0D0902",
+"8@    c #241A08",
+"9@    c #2C1F09",
+"0@    c #34250B",
+"a@    c #00CFFF",
+"b@    c #198498",
+"c@    c #533B12",
+"d@    c #5B4114",
+"e@    c #634715",
+"f@    c #835D1C",
+"g@    c #8B631E",
+"h@    c #00FCFF",
+"i@    c #9B6E22",
+"j@    c #A37423",
+"k@    c #916D2F",
+"l@    c #906C2D",
+"m@    c #906B2C",
+"n@    c #906B2A",
+"o@    c #8F6A29",
+"p@    c #8F6A28",
+"q@    c #C3C08B",
+"r@    c #BEBC88",
+"s@    c #B4B282",
+"t@    c #AFAD7F",
+"u@    c #AAA97D",
+"v@    c #A5A47A",
+"w@    c #060401",
+"x@    c #160F04",
+"y@    c #1E1506",
+"z@    c #261B08",
+"A@    c #00DEFF",
+"B@    c #00E3FF",
+"C@    c #1499AE",
+"D@    c #3D391E",
+"E@    c #3C4A35",
+"F@    c #553D12",
+"G@    c #654816",
+"H@    c #8D641F",
+"I@    c #946A20",
+"J@    c #8F6A27",
+"K@    c #8F6926",
+"L@    c #8E6924",
+"M@    c #B6B484",
+"N@    c #B1AF81",
+"O@    c #ACAB7E",
+"P@    c #A7A67B",
+"Q@    c #A2A178",
+"R@    c #070501",
+"S@    c #0F0B03",
+"T@    c #171005",
+"U@    c #0ABCC8",
+"V@    c #069FC7",
+"W@    c #07A1CA",
+"X@    c #47320F",
+"Y@    c #00FDFF",
+"Z@    c #7E5A1B",
+"`@    c #86601D",
+" #    c #8F6925",
+".#    c #8E6823",
+"+#    c #8E6821",
+"@#    c #A5A37A",
+"##    c #A09F77",
+"$#    c #B5B4A0",
+"%#    c #010100",
+"&#    c #090602",
+"*#    c #00E2FF",
+"=#    c #00EDFF",
+"-#    c #00C4FB",
+";#    c #156976",
+">#    c #39280C",
+",#    c #00C0F6",
+"'#    c #8E6822",
+")#    c #8E6721",
+"!#    c #8D671F",
+"~#    c #8D661E",
+"{#    c #00C1E2",
+"]#    c #00D9FF",
+"^#    c #00D6FF",
+"/#    c #0293BA",
+"(#    c #1E1F13",
+"_#    c #2A1E09",
+":#    c #00E0FF",
+"<#    c #00E1FF",
+"[#    c #00C5FD",
+"}#    c #008DB5",
+"|#    c #8E6720",
+"1#    c #8D661D",
+"2#    c #8D661C",
+"3#    c #8D651B",
+"4#    c #00151B",
+"5#    c #0088AF",
+"6#    c #0097C1",
+"7#    c #08272B",
+"8#    c #1C1406",
+"9#    c #0099C4",
+"0#    c #007C9F",
+"a#    c #4C3610",
+"b#    c #543C12",
+"c#    c #936920",
+"d#    c #8D661B",
+"e#    c #8C651A",
+"f#    c #8C6519",
+"g#    c #8C6417",
+"h#    c #838281",
+"i#    c #878582",
+"j#    c #8B8882",
+"k#    c #8F8B83",
+"l#    c #938E84",
+"m#    c #979085",
+"n#    c #9B9386",
+"o#    c #9F9687",
+"p#    c #A39988",
+"q#    c #A79C89",
+"r#    c #AB9F89",
+"s#    c #AEA18A",
+"t#    c #B2A48B",
+"u#    c #B6A78C",
+"v#    c #BAAA8D",
+"w#    c #BEAC8E",
+"x#    c #C2AF8F",
+"y#    c #C6B290",
+"z#    c #CAB590",
+"A#    c #CEB891",
+"B#    c #D2BA92",
+"C#    c #D3BB93",
+"D#    c #E5D0BA",
+"E#    c #C6B38F",
+"F#    c #C6B38E",
+"G#    c #C6B28E",
+"H#    c #C6B28D",
+"I#    c #C6B28C",
+"J#    c #C6B18B",
+"K#    c #BFB2A4",
+"L#    c #CFCEBB",
+". + @ # $ % & * = - ; ; # > , ' ) ) ! ~ { ] ^ / ( ( _ : < < < < ) ) [ : < < < < ( ( : < < < < < ",
+"# } | 1 2 3 4 5 6 6 7 8 9 0 a a b c d e f g h h ^ i j k < < a a l m n o : < h h p q k _ < < a r ",
+"% s t u v w 6 6 x y } | a a z A B C D E h h F G { l < < a a G ~ ^ H j I h h / i m n < < a a : J ",
+"= 4 5 K 6 6 L 7 8 9 a a M M M N O P h h Q R S T < < a a U V T W ] l h h ! ~ ^ l < < a a n k [ J ",
+"X Y 6 6 Z x y } | 1 a ( ` ` M z h h d  .g ..< < a a +.Q R S @.G h h F T G W < < a a l H j I _ J ",
+"; 6 Z L 7 8 9 0 s #.a ( ( ( ` ` z B c e < < a a c E f $...U h h %.U S @.< < a a ! { ^ i p q h &.",
+". Z x y } | 1 t 3 v a < ( ( ( h M A < < a a z O C d  .+.h h +.Q ..R < < a a S @.G ~ ] l h h k J ",
+"+ 7 8 9 0 s #.4 5 *.=.-.< < ( h < < a a M M M A P c h h E  .f $.< < a a ;.%.>.F ,.! h h H j q '.",
+"# } | 1 t 3 v w Y ).6 6 7 8 < < s #.a ( ` ` M z h h P C d e < < a a  .+.$...U V h h ~ ^ l m < J ",
+"!.0 s #.4 5 *.=.6 6 x y } | 1 t 3 v a ( ( ( ` ` z A B b < < a a b D e f g ;.h h F ,.W { < < *.~.",
+"' t 3 v w Y 6 6 L 7 8 9 0 s #.4 5 *.a < ( ( ( h M N < < a a z A P c E  .h h ..U S @.< < w Y ).{.",
+"* 4 5 *.6 6 Z x y } | 1 t 3 v w Y ).].^.< < ( h < < a a M M M N B C h h /.g Q %.< < 5 *.=.-.(._.",
+"- w 6 6 Z L 7 8 9 0 s #.4 5 *.=.-.(.6 6 7 8 < < s #.a ( ` ` M z h h C d  .f < < v w Y ).].^.^._.",
+"; 6 Z Z x y } | 1 t 3 v w Y ).].6 6 x y } | 1 t 3 v a ( ( ( ` ` z O P c < < 4 5 *.=.-.(.^.^.^._.",
+". Z L 7 8 9 0 s #.4 5 *.=.-.6 6 L 7 8 9 0 s #.4 5 *.a < ( ( ( h M N < < 3 v w Y ).].^.^.^.^.6 :.",
+". x y } | 1 t 3 v w Y ).6 6 Z x y } | 1 t 3 v w Y ).].^.< < ( h < < #.4 5 *.=.-.(.^.^.^.6 6 } <.",
+"[.8 9 0 s #.4 5 *.=.6 6 Z L 7 8 9 0 s #.4 5 *.=.-.(.6 6 y } < < t 3 v w Y ).].^.^.^.6 6 8 9 0 }.",
+"|.1.1 t 3 v w Y 6 6 Z Z x y } | 1 t 3 v w Y ).].6 6 7 8 9 0 s #.4 5 *.=.-.(.^.^.6 6 y } | 1 a r ",
+"2.*.1.1.5 *.6 6 Z Z L 7 8 9 0 s #.4 5 *.=.-.6 6 x y } | 1 t 3 v w Y ).].^.^.6 6 7 8 9 0 a a ( 3.",
+"; 6 *.*.1.1.Z Z Z x y } | 1 t 3 v w Y ).6 6 L 7 8 9 0 s #.4 5 *.=.-.(.^.6 6 x y } | a a ( ( ( 3.",
+"4.5.6 6 *.*.1.1.7 8 9 0 s #.4 5 *.=.6 6 Z x y } | 1 t 3 v w Y ).].^.6 6 L 7 8 9 0 s a ( ` ` ( 3.",
+"6.7.8.9.6 6 *.*.1.1.1 t 3 v w Y 6 6 Z L 7 8 9 0 s #.4 5 *.=.-.(.6 6 Z x y } | 1 t 3 a ( ( ( ` 0.",
+"a.b.c.d.e.f.6 6 *.*.1.1.5 *.6 6 Z Z x y } | 1 t 3 v w Y ).].6 6 Z L 7 8 9 0 s #.4 5 a < ( ( ( &.",
+"g.8.9.h.i.j.k.l.6 6 *.*.1.1.Z Z L 7 8 9 0 s #.4 5 *.=.-.6 6 Z Z x y } | 1 t 3 v w Y ).].< < ( &.",
+"m.c.d.e.f.n.k.l.o.5.6 6 *.*.1.1.y } | 1 t 3 v w Y ).6 6 Z Z L 7 8 9 0 s #.4 5 *.=.-.6 6 7 8 < J ",
+"p.9.h.i.j.k.k.l.q.7.8.9.6 6 *.*.1.1.s #.4 5 *.=.6 6 Z Z Z x y } | 1 t 3 v w Y ).6 6 x y } | 1 r.",
+"s.t.e.f.n.k.k.l.5.b.c.d.e.f.6 6 *.*.1.1.w Y 6 6 Z Z Z L 7 8 9 0 s #.4 5 *.=.6 6 L 7 8 9 0 s #.u.",
+"v.w.t.t.k.k.k.l.7.8.9.h.i.j.k.l.6 6 *.*.1.1.Z Z Z Z x y } | 1 t 3 v w Y 6 6 Z x y } | 1 t 3 v x.",
+"v.w.y.z.t.t.k.l.b.c.d.e.f.n.k.l.o.5.6 6 *.*.1.1.L 7 8 9 0 s #.4 5 *.6 6 Z L 7 8 9 0 s #.4 5 *.~.",
+"v.A.y.B.C.D.t.t.8.9.h.i.j.k.k.l.q.7.8.9.6 6 *.*.1.1.| 1 t 3 v w 6 6 Z Z x y } | 1 t 3 v w Y ).{.",
+"v.y.z.E.D.F.G.H.t.t.e.f.n.k.k.l.5.b.c.d.e.f.6 6 *.*.1.1.4 5 6 6 Z Z L 7 8 9 0 s #.4 5 *.=.-.6 :.",
+"I.J.B.C.D.G.K.L.M.N.t.t.k.k.k.l.7.8.9.h.i.j.k.l.6 6 *.*.1.1.Z Z Z x y } | 1 t 3 v w Y ).6 6 x O.",
+"P.Q.J.J.F.R.S.T.U.N.V.W.t.t.k.l.b.c.d.e.f.n.k.l.o.o.6 6 *.*.1.1.7 8 9 0 s #.4 5 *.=.6 6 L 7 8 X.",
+"Y.Z.`. +.+++++@+N.#+V.$+%+&+t.*+=+-+;+>+>+>+>+,+'+o.o.5.6 6 *.*.1.1.1 t 3 v w Y 6 6 Z x y } | )+",
+"!+~+{+++++++++]+N.V.W.$+&+^+/+*+(+_+:+<+<+<+<+:+[+o.q.7.8.9.6 6 *.*.1.1.5 *.6 6 Z L 7 8 9 0 s r.",
+"}+|+1+2+3+4+5+6+J.J.$+%+&+7+8+9+0+a+t.t.k.k.k.l.b+o.5.b.c.d.e.l.6 6 *.*.1.1.Z Z x y } | 1 t 3 u.",
+"c+d+e+f+g+-+h+i+j+6+J.J.^+/+k+9+=+-+;+>+>+>+>+,+'+q.7.8.9.h.i.l.o.o.6 6 *.*.1.1.8 9 0 s #.4 5 l+",
+"m+n+++o+++++=+p+q+r+Q.6+J.J.k+=+(+_+:+<+<+<+<+:+[+5.b.c.d.e.f.l.o.s+t+b.6 6 *.*.1.1.t 3 v w Y u+",
+"v+w+x+++++y+z+A+B+C+Z.`.D+6+J.=+a+E+F+G+H+I+J+K+L+t.8.9.h.i.j.l.o.M+N+O+P+Q+6 6 *.*.1.1.*.=.6 :.",
+"R+S+T+U+V+W+X+Y+Z+`+~+ @.@+@6+9+J.J.G+@@H+J+#@K+$@%@t.t.e.f.n.l.s+&@*@=@-@h.;@l.6 6 *.*.1.1.Z >@",
+",@'@)@!@~@{@]@^@/@(@|+1+_@:@<@9+6+6+J.J.I+J+K+[@,+%@}@|@t.t.k.l.1@2@8.3@4@e.5@l.o.5.6 6 *.*.1.6@",
+"7@8@9@0@,+a@b@c@d@e@d+e+f+f@g@h@i@j@6+6+J.J.K+k@h@l@m@n@o@p@t.t.q@r@c.s@t@u@v@l.q.7.8.9.6 6 *.l+",
+"w@x@y@z@A@B@C@D@E@F@n+G@++++++++H@I@r+Q.6+++++++++}@|@n@p@J@K@L@t.t.M@N@O@P@Q@l.5.b.c.d.e.f.6 :.",
+"< R@S@T@A@=+U@V@W@X@w+++++++++Y@Z@`@C+Z.++++++++Y@J.n@o@p@K@ #L@.#+#t.t.i.@###l.7.8.9.h.i.j.k.$#",
+"< < %#&#A@*#=#-#;#>#S+y+++++3+,#Y+Z+`+~+y+++++3+,#6+J.J.J@K@L@.#'#)#!#~#t.t.k.l.b.c.d.e.f.n.k.$#",
+"< < < < {#]#^#/#(#_#'@:#<#*#[#}#^@/@(@|+:#<#*#[#}#6+6+6+J.J.L@.#+#|#!#1#2#3#t.t.8.9.h.i.j.k.k.$#",
+"< < < < 4#5#6#7#,@8#8@9@W+9#0#a#b#d@e@d+e+W+9#0#c#i@j@6+6+6+J.J.)#!#~#1#d#e#f#g#t.t.e.f.n.k.k.$#",
+"< J J J J J J J h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#A#B#C#C#C#D#D#E#F#G#H#I#I#J#J#K#K#L#L#L#$#"};
index 7181ab4..2890565 100644 (file)
@@ -150,7 +150,7 @@ static int ppixel2pal(unsigned long ppixel){
   i++;
   while(ppixel!=1){
     i++;
-    ppixel >> 1; // statement with no effect?? (Masanao Izumo <mo@goice.co.jp>)
+    ppixel >> 1; // statement with no effect??
   }
   return i;
 }
index 0522556..e6e2d9b 100644 (file)
@@ -448,9 +448,12 @@ static void ctl_pass_playing_list(int init_number_of_files,
   for (;;) {
     /* Play file */
     if (command==RC_LOAD_FILE&&number_of_files!=0) {
+      char *title;
       snprintf(local_buf,sizeof(local_buf),"E %s",titles[file_table[current_no]]);
       a_pipe_write(local_buf);
-         snprintf(local_buf,sizeof(local_buf),"e %s",get_midi_title(list_of_files[current_no]));
+      if((title = get_midi_title(list_of_files[current_no])) == NULL)
+         title = list_of_files[current_no];
+         snprintf(local_buf,sizeof(local_buf),"e %s", title);
          a_pipe_write(local_buf);
       command=play_midi_file(list_of_files[file_table[current_no]]);
     } else {
index f6a5d3e..233ead8 100644 (file)
@@ -1916,7 +1916,7 @@ static void leaveSubmenu(Widget w, XEvent *e, String *v, Cardinal *n) {
 static void checkRightAndPopupSubmenu(Widget w, XEvent *e, String *v, Cardinal *n) {
   XLeaveWindowEvent *leave_ev = (XLeaveWindowEvent *)e;
   Dimension nheight,height,width;
-  Position y;
+  Position x,y;
   int i;
 
   if(!maxentry_on_a_menu) return;
@@ -1937,11 +1937,12 @@ static void checkRightAndPopupSubmenu(Widget w, XEvent *e, String *v, Cardinal *
   
   /* neighbor menu height */
   XtVaGetValues((i>0)? psmenu[i-1]:title_sm,
-                XtNwidth,&width,XtNheight,&nheight,XtNy,&y,NULL);
+                XtNwidth,&width,XtNheight,&nheight,XtNx,&x,XtNy,&y,NULL);
   if(leave_ev->x > 0 && leave_ev->y > nheight - 22) {
-       XtVaSetValues(psmenu[i],XtNx,leave_ev->x_root-60,
-                                 XtNy,y +((height)? nheight-height:0),NULL);
+       XtVaSetValues(psmenu[i],XtNx,x+80,NULL);
        XtPopup(psmenu[i],XtGrabNone);  
+       XtVaGetValues(psmenu[i],XtNheight,&height,NULL);
+       XtVaSetValues(psmenu[i],XtNy,y +((height)? nheight-height:0),NULL);
   }
 }
 
index cd719ad..8495838 100644 (file)
@@ -57,8 +57,8 @@ static int flush_output(void);
 static void purge_output(void);
 static int32 current_samples(void);
 static int play_loop(void);
-static int write_u32(int fd, uint32 value);
-static int write_u16(int fd, uint16 value);
+static int write_u32(uint32 value);
+static int write_u16(uint16 value);
 static void ConvertToIeeeExtended(double num, char *bytes);
 
 extern int default_play_event(void *);
@@ -90,35 +90,74 @@ PlayMode dpm = {
 static uint32 bytes_output;
 static int32  play_counter;
 
-static int write_u32(int fd, uint32 value)
+static int write_u32(uint32 value)
 {
+    int n;
     value = BE_LONG(value);
-    return write(fd, (char *)&value, 4);
+    if((n = write(dpm.fd, (char *)&value, 4)) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
 }
 
-static int write_u16(int fd, uint16 value)
+static int write_u16(uint16 value)
 {
+    int n;
     value = BE_SHORT(value);
-    return write(fd, (char *)&value, 2);
+    if((n = write(dpm.fd, (char *)&value, 2)) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
 }
 
-static int write_ieee_80bitfloat(int fd, double num)
+static int write_str(char *s)
+{
+    int n;
+    if((n = write(dpm.fd, s, strlen(s))) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
+}
+
+static int write_ieee_80bitfloat(double num)
 {
     char bytes[10];
+    int n;
     ConvertToIeeeExtended(num, bytes);
-    return write(fd, bytes, 10);
+
+    if((n = write(dpm.fd, bytes, 10)) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
 }
 
-static int chunk_start(int fd, char *id, uint32 chunk_len)
+static int chunk_start(char *id, uint32 chunk_len)
 {
     int i, j;
 
-    i = write(fd, id, 4);
-    if(i < 4)
-       return i;
-
-    j = write_u32(fd, chunk_len);
-    if(j == -1)
+    if((i = write_str(id)) == -1)
+       return -1;
+    if((j = write_u32(chunk_len)) == -1)
        return -1;
     return i + j;
 }
@@ -149,43 +188,51 @@ static int open_output(void)
     }
 
     /* magic */
-    write(dpm.fd, "FORM", 4);
+    if(write_str("FORM") == -1) return -1;
 
     /* file size - 8 (dmy) */
-    write_u32(dpm.fd, (uint32)0xffffffff);
+    if(write_u32((uint32)0xffffffff) == -1) return -1;
 
     /* chunk start tag */
-    write(dpm.fd, "AIFF", (int32)4);
+    if(write_str("AIFF") == -1) return -1;
 
     /* COMM chunk */
-    chunk_start(dpm.fd, "COMM", 18);
+    if(chunk_start("COMM", 18) == -1) return -1;
 
     /* number of channels */
     if(dpm.encoding & PE_MONO)
-       write_u16(dpm.fd, (uint16)1);
+    {
+       if(write_u16((uint16)1) == -1) return -1;
+    }
     else
-       write_u16(dpm.fd, (uint16)2);
+    {
+       if(write_u16((uint16)2) == -1) return -1;
+    }
 
     /* number of frames (dmy) */
-    write_u32(dpm.fd, (uint32)0xffffffff);
+    if(write_u32((uint32)0xffffffff) == -1) return -1;
 
     /* bits per sample */
     if(dpm.encoding & PE_16BIT)
-       write_u16(dpm.fd, (uint16)16);
+    {
+       if(write_u16((uint16)16) == -1) return -1;
+    }
     else
-       write_u16(dpm.fd, (uint16)8);
+    {
+       if(write_u16((uint16)8) == -1) return -1;
+    }
 
     /* sample rate */
-    write_ieee_80bitfloat(dpm.fd, (double)dpm.rate);
+    if(write_ieee_80bitfloat((double)dpm.rate) == -1) return -1;
 
     /* SSND chunk */
-    chunk_start(dpm.fd, "SSND", (int32)0xffffffff);
+    if(chunk_start("SSND", (int32)0xffffffff) == -1) return -1;
 
     /* offset */
-    write_u32(dpm.fd, (uint32)0);
+    if(write_u32((uint32)0) == -1) return -1;
 
     /* block size */
-    write_u32(dpm.fd, (uint32)0);
+    if(write_u32((uint32)0) == -1) return -1;
 
     play_counter = 0;
     return 0;
@@ -224,10 +271,11 @@ static void close_output(void)
            uint32 f;
 
            /* file size - 8 */
-           write_u32(dpm.fd, (uint32)(4                /* "AIFF" */
-                                      + 26             /* COMM chunk */
-                                      + 16 + bytes_output/* SSND chunk */
-                                      ));
+           if(write_u32((uint32)(4             /* "AIFF" */
+                                 + 26          /* COMM chunk */
+                                 + 16 + bytes_output/* SSND chunk */
+                                 )) == -1) return;
+
            /* COMM chunk */
            /* number of frames */
            lseek(dpm.fd, 12+10, SEEK_SET);
@@ -236,11 +284,11 @@ static void close_output(void)
                f /= 2;
            if(dpm.encoding & PE_16BIT)
                f /= 2;
-           write_u32(dpm.fd, f);
+           if(write_u32(f) == -1) return;
 
            /* SSND chunk */
            lseek(dpm.fd, 12+26+4, SEEK_SET);
-           write_u32(dpm.fd, (uint32)(8 + bytes_output));
+           if(write_u32((uint32)(8 + bytes_output)) == -1) return;
        }
        close(dpm.fd);
     }
index 9f8d018..819dd0d 100644 (file)
@@ -61,7 +61,7 @@ static int flush_output(void);
 static void purge_output(void);
 static int32 current_samples(void);
 static int play_loop(void);
-static int write_u32(int fd, uint32 value);
+static int write_u32(uint32 value);
 
 extern int default_play_event(void *);
 
@@ -91,10 +91,33 @@ PlayMode dpm = {
    closing the file */
 static uint32 bytes_output;
 
-static int write_u32(int fd, uint32 value)
+static int write_u32(uint32 value)
 {
+    int n;
     value = BE_LONG(value);
-    return write(fd, &value, 4);
+    if((n = write(dpm.fd, &value, 4)) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
+}
+
+static int write_str(char *s)
+{
+    int n;
+    if((n = write(dpm.fd, s, strlen(s))) == -1)
+    {
+       ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+                 dpm.name, strerror(errno));
+       close(dpm.fd);
+       dpm.fd = -1;
+       return -1;
+    }
+    return n;
 }
 
 /* Sun Audio File Encoding Tags */
@@ -105,8 +128,7 @@ static int write_u32(int fd, uint32 value)
 
 static int open_output(void)
 {
-    int32 comment_len = 0;
-    char *comment = "";
+    char *comment;
 
     dpm.encoding &= ~PE_BYTESWAP;
     dpm.encoding |= PE_SIGNED;
@@ -118,8 +140,8 @@ static int open_output(void)
 
     if(dpm.name && dpm.name[0] == '-' && dpm.name[1] == '\0')
     {
-       dpm.fd=1; /* data to stdout */
-       comment_len = 0;
+       dpm.fd = 1; /* data to stdout */
+       comment = "(stdout)";
     }
     else
     {
@@ -132,41 +154,51 @@ static int open_output(void)
            return -1;
        }
        comment = dpm.name;
-       comment_len = (int32)strlen(comment);
     }
 
     /* magic */
-    write(dpm.fd, ".snd", 4);
+    if(write_str(".snd") == -1) return -1;
 
     /* header size */
-    write_u32(dpm.fd, (uint32)(24 + comment_len));
+    if(write_u32((uint32)(24 + strlen(comment))) == -1) return -1;
 
     /* sample data size */
-    write_u32(dpm.fd, (uint32)0xffffffff);
+    if(write_u32((uint32)0xffffffff) == -1) return -1;
 
     /* audio file encoding */
     if(dpm.encoding & PE_ULAW)
-       write_u32(dpm.fd, (uint32)AUDIO_FILE_ENCODING_MULAW_8);
+    {
+       if(write_u32((uint32)AUDIO_FILE_ENCODING_MULAW_8) == -1) return -1;
+    }
     else if(dpm.encoding & PE_ALAW)
-       write_u32(dpm.fd, (uint32)AUDIO_FILE_ENCODING_ALAW_8);
+    {
+       if(write_u32((uint32)AUDIO_FILE_ENCODING_ALAW_8) == -1) return -1;
+    }
     else if(dpm.encoding & PE_16BIT)
-       write_u32(dpm.fd, (uint32)AUDIO_FILE_ENCODING_LINEAR_16);
+    {
+       if(write_u32((uint32)AUDIO_FILE_ENCODING_LINEAR_16) == -1) return -1;
+    }
     else
-       write_u32(dpm.fd, (uint32)AUDIO_FILE_ENCODING_LINEAR_8);
+    {
+       if(write_u32((uint32)AUDIO_FILE_ENCODING_LINEAR_8) == -1) return -1;
+    }
 
     /* sample rate */
-    write_u32(dpm.fd, (uint32)dpm.rate);
+    if(write_u32((uint32)dpm.rate) == -1) return -1;
 
     /* number of channels */
     if(dpm.encoding & PE_MONO)
-       write_u32(dpm.fd, (uint32)1);
+    {
+       if(write_u32((uint32)1) == -1) return -1;
+    }
     else
-       write_u32(dpm.fd, (uint32)2);
-    if(write(dpm.fd, comment, comment_len) != comment_len)
     {
-       close(dpm.fd);
-       return -1;
+       if(write_u32((uint32)2) == -1) return -1;
     }
+
+    /* comment */
+    if(write_str(comment) == -1) return -1;
+
     return 0;
 }
 
@@ -204,7 +236,7 @@ static void close_output(void)
        /* It's not stdout, so it's probably a file, and we can try
           fixing the block lengths in the header before closing. */
        if(lseek(dpm.fd, 8, SEEK_SET) >= 0)
-           write_u32(dpm.fd, bytes_output);
+           write_u32(bytes_output);
        close(dpm.fd);
     }
     dpm.fd = -1;
index f1239f9..9b28e43 100644 (file)
@@ -100,7 +100,7 @@ typedef struct _SpecialPatch /* To be used MIDI Module play mode */
 
 enum instrument_mapID
 {
-    INST_NO_MAP = -1,
+    INST_NO_MAP = 0,
     SC_55_TONE_MAP,
     SC_55_DRUM_MAP,
     SC_88_TONE_MAP,
index bc5e17b..00bf425 100644 (file)
@@ -171,7 +171,14 @@ static int open_output(void)
 
   if (!(dpm.encoding & PE_16BIT)) RIFFheader[34]='\010';
 
-  write(dpm.fd, RIFFheader, 44);
+  if(write(dpm.fd, RIFFheader, 44) == -1)
+  {
+      ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: write: %s",
+               dpm.name, strerror(errno));
+      close(dpm.fd);
+      dpm.fd = -1;
+      return -1;
+  }
 
   /* Reset the length counter */
   bytes_output=0;
index cbe7f57..c4286c9 100644 (file)
@@ -766,8 +766,7 @@ char *strdup(const char *s)
     len = strlen(s);
     if((p = (char *)malloc(len + 1)) == NULL)
        return NULL;
-    p[len] = '\0';
-    return p;
+    return strcpy(p, s);
 }
 #endif /* HAVE_STRDUP */