changeset 4360:313dd79a2d24

move some more GUI functions
author mf0102 <0102@gmx.at>
date Tue, 18 Mar 2008 14:57:10 +0100
parents 0becb809bdc9
children 3cd896ac4d49
files src/audacious/playback.c src/audacious/playlist.c src/audacious/ui_main_evlisteners.c
diffstat 3 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playback.c	Mon Mar 17 23:47:24 2008 +0100
+++ b/src/audacious/playback.c	Tue Mar 18 14:57:10 2008 +0100
@@ -46,7 +46,6 @@
 #include "output.h"
 #include "playlist.h"
 #include "pluginenum.h"
-#include "ui_equalizer.h"
 #include "util.h"
 
 #include "playback.h"
@@ -180,14 +179,6 @@
 #endif
     playback_play_file(entry);
 
-//    if (playback_get_time() != -1) {
-        equalizerwin_load_auto_preset(entry->filename);
-        input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
-                     cfg.equalizer_bands);
-        output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
-                      cfg.equalizer_bands);
-//    }
-
     playlist_check_pos_current(playlist);
 
     hook_call("playback begin", entry);
--- a/src/audacious/playlist.c	Mon Mar 17 23:47:24 2008 +0100
+++ b/src/audacious/playlist.c	Tue Mar 18 14:57:10 2008 +0100
@@ -60,7 +60,6 @@
 #include "util.h"
 #include "configdb.h"
 #include "vfs.h"
-#include "ui_equalizer.h"
 #include "playback.h"
 #include "playlist.h"
 #include "playlist_container.h"
--- a/src/audacious/ui_main_evlisteners.c	Mon Mar 17 23:47:24 2008 +0100
+++ b/src/audacious/ui_main_evlisteners.c	Tue Mar 18 14:57:10 2008 +0100
@@ -97,15 +97,20 @@
 static void
 ui_main_evlistener_playback_begin(gpointer hook_data, gpointer user_data)
 {
+    PlaylistEntry *entry = (PlaylistEntry*)hook_data;
+    g_return_if_fail(entry != NULL);
+
+    equalizerwin_load_auto_preset(entry->filename);
+    input_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
+                 cfg.equalizer_bands);
+    output_set_eq(cfg.equalizer_active, cfg.equalizer_preamp,
+                  cfg.equalizer_bands);
+
     ui_vis_clear_data(mainwin_vis);
     ui_svis_clear_data(mainwin_svis);
     mainwin_disable_seekbar();
     mainwin_update_song_info();
 
-    /* FIXME: use g_timeout_add_seconds when glib-2.14 is required */
-    song_info_timeout_source = g_timeout_add(1000,
-        (GSourceFunc) mainwin_update_song_info, NULL);
-
     if (cfg.player_shaded) {
         gtk_widget_show(mainwin_stime_min);
         gtk_widget_show(mainwin_stime_sec);
@@ -119,8 +124,11 @@
         gtk_widget_show(mainwin_position);
     }
 
-    update_vis_timeout_source = g_timeout_add(10,
-    (GSourceFunc) update_vis_func, NULL);
+    song_info_timeout_source = 
+        g_timeout_add_seconds(1, (GSourceFunc) mainwin_update_song_info, NULL);
+
+    update_vis_timeout_source =
+        g_timeout_add(10, (GSourceFunc) update_vis_func, NULL);
 
     vis_playback_start();