OSDN Git Service

Fix counter overflow in GTK+ mode
authorShohei Urabe <root@mput.dip.jp>
Thu, 9 Sep 2004 05:23:17 +0000 (05:23 +0000)
committerShohei Urabe <root@mput.dip.jp>
Thu, 9 Sep 2004 05:23:17 +0000 (05:23 +0000)
ChangeLog
NEWS
interface/gtk_c.c
interface/gtk_i.c

index 51549ba..518cbeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-09  URABE Shyouhei  <shyouhei@ice.uec.ac.jp>
+
+       * interface/gtk_c.c (ctl_total_time): ditto.
+       * interface/gtk_i.c (handle_input): Fix counter overflow
+         (fix for [timidity-bugs-en:00032])
+       * NEWS: Fix typo.
+
 2004-09-07  Eric A. Welsh <ewelsh@ccb.wustl.edu>
 
        * freq.c: mostly rewritten
diff --git a/NEWS b/NEWS
index 8147ae1..e59547b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,7 @@
           * aRts
           * JACK
           * Windows Synthesizer mode (TWSYMTH)
-          * PortAudio?
+          * PortAudio
           * PortMIDI Synthesizer mode 
     * Newly supported input format
           * MFi (Melody format for i-Mode)
index b5801d0..18a45f7 100644 (file)
@@ -203,11 +203,8 @@ ctl_refresh(void)
 static void
 ctl_total_time(int tt)
 {
-  /*int centisecs=tt/(play_mode->rate/100);*/
-  int centisecs=tt*100/play_mode->rate;
-
     gtk_pipe_int_write(TOTALTIME_MESSAGE);
-    gtk_pipe_int_write(centisecs);
+    gtk_pipe_int_write(tt);
 }
 
 static void
index 4dd747b..c10bdec 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "timidity.h"
 #include "common.h"
+#include "output.h"
 #include "gtk_h.h"
 
 #include "pixmaps/playpaus.xpm"
@@ -708,21 +709,20 @@ handle_input(gpointer client_data, gint source, GdkInputCondition ic)
 
     case TOTALTIME_MESSAGE:
        {
-           int cseconds;
+           int tt;
            int minutes,seconds;
            char local_string[20];
            GtkObject *adj;
 
-           gtk_pipe_int_read(&cseconds);
+           gtk_pipe_int_read(&tt);
 
-           seconds=cseconds/100;
+           seconds=max_sec=tt/play_mode->rate;
            minutes=seconds/60;
            seconds-=minutes*60;
            sprintf(local_string,"/ %i:%02i",minutes,seconds);
            gtk_label_set(GTK_LABEL(tot_lbl), local_string);
 
            /* Readjust the time scale */
-           max_sec=cseconds/100;
            adj = gtk_adjustment_new(0., 0., (gfloat)max_sec,
                                     1., 10., 0.);
            gtk_signal_connect(GTK_OBJECT(adj), "value_changed",