changeset 3197:5dd8bc77a590 trunk

now "hide seekbar on streaming" uses message passing.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Wed, 01 Aug 2007 13:55:02 +0900
parents be1d387e1f66
children 88b8338b8cf4
files src/audacious/playlist.c src/audacious/ui_main.c src/audacious/ui_main_evlisteners.c
diffstat 3 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Mon Jul 30 20:42:40 2007 +0900
+++ b/src/audacious/playlist.c	Wed Aug 01 13:55:02 2007 +0900
@@ -1037,6 +1037,10 @@
     PlaylistEventInfoChange *msg;
     gchar *text;
 
+    if(length == -1) {
+        event_queue("hide seekbar", (gpointer)0xdeadbeef); // event_queue hates NULL --yaz
+    }
+
     g_return_if_fail(playlist != NULL);
 
     if (playlist->position) {
--- a/src/audacious/ui_main.c	Mon Jul 30 20:42:40 2007 +0900
+++ b/src/audacious/ui_main.c	Wed Aug 01 13:55:02 2007 +0900
@@ -2952,16 +2952,6 @@
         g_free(time_str);
     }
 
-    if (length == -1) {
-        gtk_widget_hide(mainwin_position);
-        gtk_widget_hide(mainwin_sposition);
-        return TRUE;
-    } else {
-        gtk_widget_show(mainwin_position);
-        if (cfg.player_shaded)
-            gtk_widget_show(mainwin_sposition);
-    }
-
     time /= 1000;
     length /= 1000;
     if (length > 0) {
--- a/src/audacious/ui_main_evlisteners.c	Mon Jul 30 20:42:40 2007 +0900
+++ b/src/audacious/ui_main_evlisteners.c	Wed Aug 01 13:55:02 2007 +0900
@@ -38,8 +38,15 @@
     g_free(text);
 }
 
+static void
+ui_main_evlistener_hide_seekbar(gpointer hook_data, gpointer user_data)
+{
+    mainwin_disable_seekbar();
+}
+
 void
 ui_main_evlistener_init(void)
 {
     hook_associate("title change", ui_main_evlistener_title_change, NULL);
+    hook_associate("hide seekbar", ui_main_evlistener_hide_seekbar, NULL);
 }