changeset 3086:5973397c09f2

branch merge
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 17 Jul 2007 03:38:32 +0900
parents e75fc3c056e6 (current diff) 20830a69b5f5 (diff)
children e91fddd8526d
files
diffstat 2 files changed, 9 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playback.c	Tue Jul 17 03:33:55 2007 +0900
+++ b/src/audacious/playback.c	Tue Jul 17 03:38:32 2007 +0900
@@ -50,6 +50,7 @@
 #include "ui_skinselector.h"
 #include "ui_skinned_playstatus.h"
 #include "util.h"
+#include "visualization.h"
 
 #include "playback.h"
 
@@ -121,6 +122,8 @@
         gtk_widget_show(mainwin_position);
     }
 
+    vis_playback_start();
+
     hook_call("playback begin", entry);
 }
 
@@ -187,6 +190,8 @@
     if (song_info_timeout_source)
         g_source_remove(song_info_timeout_source);
 
+    vis_playback_stop();
+
     g_return_if_fail(mainwin_playstatus != NULL);
     ui_skinned_playstatus_set_buffering(mainwin_playstatus, FALSE);
 }
--- a/src/audacious/ui_main.c	Tue Jul 17 03:33:55 2007 +0900
+++ b/src/audacious/ui_main.c	Tue Jul 17 03:38:32 2007 +0900
@@ -163,10 +163,7 @@
 
 static gint mainwin_timeout_id;
 
-G_LOCK_DEFINE_STATIC(mainwin_title);
-
 static gboolean mainwin_force_redraw = FALSE;
-static gchar *mainwin_title_text = NULL;
 static gboolean mainwin_info_text_locked = FALSE;
 
 static int ab_position_a = -1;
@@ -651,10 +648,8 @@
 void
 mainwin_set_song_title(const gchar * title)
 {
-    G_LOCK(mainwin_title);
-    g_free(mainwin_title_text);
-    mainwin_title_text = make_mainwin_title(title);
-    G_UNLOCK(mainwin_title);
+    gchar *mainwin_title_text = make_mainwin_title(title);
+    gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text);
 }
 
 static void
@@ -906,10 +901,7 @@
         return;
 
     /* clear title */
-    G_LOCK(mainwin_title);
-    g_free(mainwin_title_text);
-    mainwin_title_text = NULL;
-    G_UNLOCK(mainwin_title);
+    mainwin_set_song_title(NULL);
 
     /* clear sampling parameters */
     playback_set_sample_params(0, 0, 0);
@@ -1572,6 +1564,7 @@
     ip_data.stop = TRUE;
     mainwin_clear_song_info();
     playback_stop();
+    ab_position_a = ab_position_b = -1;
     ip_data.stop = FALSE;
 }
 
@@ -3009,13 +3002,6 @@
 
     GDK_THREADS_ENTER();
 
-    if (playback_get_playing())
-        vis_playback_start();
-    else {
-        vis_playback_stop();
-    ab_position_a = ab_position_b = -1;
-    }
-
     draw_main_window(mainwin_force_redraw);
 
     if (!count) {
@@ -3029,17 +3015,6 @@
     draw_equalizer_window(FALSE);
     draw_playlist_window(FALSE);
 
-    if (mainwin_title_text) {
-        G_LOCK(mainwin_title);
-        gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text);
-        g_free(mainwin_title_text);
-        mainwin_title_text = NULL;
-        G_UNLOCK(mainwin_title);
-
-        mainwin_set_info_text();
-        playlistwin_update_list(playlist_get_active());
-    }
-
     /* tristate buttons seek */
     if ( seek_state != MAINWIN_SEEK_NIL )
     {