diff src/audacious/ui_main.c @ 3021:e3d7490ffd15 trunk

branch merge
author Tomasz Mon <desowin@gmail.com>
date Tue, 10 Jul 2007 11:33:37 +0200
parents 6065d70cb790 89b85a1b7fd2
children 49ce30748980
line wrap: on
line diff
--- a/src/audacious/ui_main.c	Tue Jul 10 11:32:54 2007 +0200
+++ b/src/audacious/ui_main.c	Tue Jul 10 11:33:37 2007 +0200
@@ -2494,6 +2494,7 @@
         set_timer_mode(TIMER_REMAINING);
     else
         set_timer_mode(TIMER_ELAPSED);
+    mainwin_update_song_info();
 }
 
 static void
@@ -2996,21 +2997,21 @@
                                        mainwin_idle_func, NULL);
 }
 
-static void
-idle_func_update_song_info(gint time)
+gboolean
+mainwin_update_song_info(void)
 {
+    gint time = playback_get_time();
     gint length, t;
     gchar stime_prefix;
 
+    if (!playback_get_playing() || time < 0)
+        return FALSE;
+
     if (ab_position_a != -1 && ab_position_b != -1 && time > ab_position_b)
         playback_seek(ab_position_a/1000);
 
     length = playlist_get_current_length(playlist_get_active());
-    if (playback_get_playing())
-        playlistwin_set_time(time, length, cfg.timer_mode);
-    else
-        playlistwin_hide_timer();
-    input_update_vis(time);
+    playlistwin_set_time(time, length, cfg.timer_mode);
 
     if (cfg.timer_mode == TIMER_REMAINING) {
         if (length != -1) {
@@ -3070,6 +3071,8 @@
         hslider_set_position(mainwin_position, 0);
         hslider_set_position(mainwin_sposition, 1);
     }
+
+    return TRUE;
 }
 
 static gboolean
@@ -3091,7 +3094,7 @@
             break;
 
         default:
-            idle_func_update_song_info(time);
+            input_update_vis(time);
             /* nothing at this time */
     }