OSDN Git Service

* timidity/common.c
authorKeishi Suenaga <s_keishi@mutt.freemail.ne.jp>
Sat, 5 Apr 2008 21:30:29 +0000 (21:30 +0000)
committerKeishi Suenaga <s_keishi@mutt.freemail.ne.jp>
Sat, 5 Apr 2008 21:30:29 +0000 (21:30 +0000)
  timidity/speex_a.c     fix compliation
* timidity/midi_a.c      BorlancC patch

ChangeLog
configure
configure.in
timidity/common.c
timidity/midi_a.c
timidity/speex_a.c

index c2aac36..fce4a82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-06  Keishi Suenaga <skeishi@yahoo.co.jp>
+       * timidity/common.c
+         timidity/speex_a.c     fix compliation
+       * timidity/midi_a.c      BorlancC patch
+
 2008-04-05  TAMUKI Shoichi <tamuki@linet.gr.jp>
 
        * timidity/timidity.c: Remove short option -Od(n) for output
index a1c0c73..b1d83e0 100755 (executable)
--- a/configure
+++ b/configure
@@ -15448,7 +15448,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-  #include <speex.h>
+  #include <speex/speex.h>
   #include <ogg/ogg.h>
 
 int
index 729058d..d8faa12 100644 (file)
@@ -1406,7 +1406,7 @@ AC_MSG_CHECKING(enable_audio=speex)
 if test "x$au_enable_speex" = xyes; then
   AC_CACHE_VAL(have_speex,
   [AC_TRY_LINK([
-  #include <speex.h>
+  #include <speex/speex.h>
   #include <ogg/ogg.h>
   ],
   [
index a212209..76b13aa 100644 (file)
@@ -1093,16 +1093,6 @@ void code_convert(char *in, char *out, int outsiz, char *icode, char *ocode)
 #endif
 }
 
-static int is_playlist(char *file)
-{
-  FILE *f; char sig[20], *ret;
-  if ((f = fopen(file, "r")) == NULL) return 0;
-  ret = fgets(sig, 20, f); 
-  fclose(f);
-  if ((!ret) || (strcmp(sig, "timidity playlist:\n"))) return 0;
-  return 1;
-}
-
 /* EAW -- insert stuff from playlist files
  *
  * Tue Apr 6 1999: Modified by Masanao Izumo <mo@goice.co.jp>
@@ -1148,7 +1138,7 @@ static char **expand_file_lists(char **files, int *nfiles_in_out)
        /* extract the file extension */
        pfile = strrchr(files[i], '.');
 
-       if(*files[i] == '@' || (pfile != NULL && strstr(testext, pfile)) || is_playlist(files[i]))
+       if(*files[i] == '@' || (pfile != NULL && strstr(testext, pfile)))
        {
            /* Playlist file */
             if(*files[i] == '@')
index 2458f08..9d284ca 100644 (file)
@@ -109,11 +109,25 @@ PlayMode dmp = {
 };
 
 static size_t m_fwrite(const void *ptr, size_t size);
-#define M_FWRITE(...) do { \
-       uint8_t __arg[] = { __VA_ARGS__ }; \
-       m_fwrite(__arg, sizeof(__arg)); \
-} while (0)
 #define M_FWRITE_STR(s) m_fwrite(s, sizeof(s) - 1)
+#define M_FWRITE1(a) do { \
+    uint8 __arg[1]; \
+    __arg[0] = a; \
+    m_fwrite(__arg, 1); \
+} while (0)
+#define M_FWRITE2(a, b) do { \
+    uint8 __arg[2]; \
+    __arg[0] = a; \
+    __arg[1] = b; \
+    m_fwrite(__arg, 2); \
+} while (0)
+#define M_FWRITE3(a, b, c) do { \
+    uint8 __arg[3]; \
+    __arg[0] = a; \
+    __arg[1] = b; \
+    __arg[2] = c; \
+    m_fwrite(__arg, 3); \
+} while (0)
 
 static size_t m_fwrite(const void *ptr, size_t size)
 {
@@ -164,7 +178,7 @@ static void finalize_midi_header(void)
 static void set_tempo(void)
 {
     M_FWRITE_STR("\xff\x51\3");
-    M_FWRITE(tempo >> 16, tempo >> 8, tempo);
+    M_FWRITE3(tempo >> 16, tempo >> 8, tempo);
 }
 
 static void set_time_sig(void)
@@ -205,10 +219,10 @@ static void midout_write_delta_time(int32 time)
     for (idx = 0; idx < 3; idx++) {
        if (started_printing || c[idx]) {
            started_printing = 1;
-           M_FWRITE(c[idx] | 0x80);
+           M_FWRITE1(c[idx] | 0x80);
        }
     }
-    M_FWRITE(c[3]);
+    M_FWRITE1(c[3]);
 }
 
 static void start_midi_track(void)
@@ -288,43 +302,43 @@ static void close_output(void)
 static void midout_noteon(int chn, int note, int vel, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_NOTEON, note & 0x7f, vel & 0x7f);
+    M_FWRITE3((chn & 0x0f) | MIDI_NOTEON, note & 0x7f, vel & 0x7f);
 }
 
 static void midout_noteoff(int chn, int note, int vel, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_NOTEOFF, note & 0x7f, vel & 0x7f);
+    M_FWRITE3((chn & 0x0f) | MIDI_NOTEOFF, note & 0x7f, vel & 0x7f);
 }
 
 static void midout_control(int chn, int control, int value, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_CTL_CHANGE, control & 0x7f, value & 0x7f);
+    M_FWRITE3((chn & 0x0f) | MIDI_CTL_CHANGE, control & 0x7f, value & 0x7f);
 }
 
 static void midout_keypressure(int chn, int control, int value, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_KEY_PRESSURE, control & 0x7f, value & 0x7f);
+    M_FWRITE3((chn & 0x0f) | MIDI_KEY_PRESSURE, control & 0x7f, value & 0x7f);
 }
 
 static void midout_channelpressure(int chn, int vel, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_CHN_PRESSURE, vel & 0x7f);
+    M_FWRITE2((chn & 0x0f) | MIDI_CHN_PRESSURE, vel & 0x7f);
 }
 
 static void midout_bender(int chn, int pitch, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_PITCH_BEND, pitch & 0x7f, (pitch >> 7) & 0x7f);
+    M_FWRITE3((chn & 0x0f) | MIDI_PITCH_BEND, pitch & 0x7f, (pitch >> 7) & 0x7f);
 }
 
 static void midout_program(int chn, int pgm, int32 time)
 {
     midout_write_delta_time(time);
-    M_FWRITE((chn & 0x0f) | MIDI_PGM_CHANGE, pgm & 0x7f);
+    M_FWRITE2((chn & 0x0f) | MIDI_PGM_CHANGE, pgm & 0x7f);
 }
 
 static void midout_tempo(int chn, int a, int b, int32 time)
@@ -355,7 +369,7 @@ static void midout_timesig(int chn, int a, int b, int32 time)
        midout_write_delta_time(time);
        M_FWRITE_STR("\xff\x58\4");
     }
-    M_FWRITE(a, b);
+    M_FWRITE2(a, b);
 }
 
 static int do_event(MidiEvent * ev)
index 0a672ce..0dbe480 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 #include <stdio.h>
+#include <stdlib.h>
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <fcntl.h>
 #endif
 
-#include <speex.h>
-#include <speex_header.h>
+#include <speex/speex.h>
+#include <speex/speex_header.h>
+#include <speex/speex_stereo.h>
 #include <ogg/ogg.h>
 
 #include "timidity.h"
+#include "common.h"
 #include "output.h"
 #include "controls.h"
 #include "timer.h"