changeset 2625:29526d9db9cc

remove few more #if 0's
author Tomasz Mon <desowin@gmail.com>
date Thu, 22 May 2008 15:10:00 +0200
parents 73b785033e47
children b7ab90e4235e
files src/skins/ui_main.c src/skins/ui_main_evlisteners.c src/skins/ui_manager.c
diffstat 3 files changed, 18 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/ui_main.c	Thu May 22 12:33:08 2008 +0300
+++ b/src/skins/ui_main.c	Thu May 22 15:10:00 2008 +0200
@@ -680,16 +680,16 @@
 void
 mainwin_clear_song_info(void)
 {
-#if 0
     if (!mainwin)
         return;
 
     /* clear title */
     mainwin_set_song_title(NULL);
 
+#if 0
     /* clear sampling parameters */
     playback_set_sample_params(0, 0, 0);
-
+#endif
     UI_SKINNED_HORIZONTAL_SLIDER(mainwin_position)->pressed = FALSE;
     UI_SKINNED_HORIZONTAL_SLIDER(mainwin_sposition)->pressed = FALSE;
 
@@ -704,7 +704,7 @@
     mainwin_refresh_visible();
 
     playlistwin_hide_timer();
-#endif
+
     ui_vis_clear_data(mainwin_vis);
     ui_svis_clear_data(mainwin_svis);
 }
@@ -1006,16 +1006,15 @@
 
     /* FIXME: Disable display of current track length. It's not
        updated when track changes */
-#if 0
+
     label = gtk_label_new(_("Track length:"));
     gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 5);
 
-    len = aud_playlist_get_current_length() / 1000;
+    gint len = aud_playlist_get_current_length(aud_playlist_get_active()) / 1000;
     g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", len / 60, len % 60);
     label = gtk_label_new(time_str);
 
     gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 10);
-#endif
 
     bbox = gtk_hbutton_box_new();
     gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 0);
@@ -1416,9 +1415,7 @@
 void
 mainwin_repeat_pushed(gboolean toggled)
 {
-#if 0
     check_set( toggleaction_group_others , "playback repeat" , toggled );
-#endif
 }
 
 void mainwin_repeat_pushed_cb(void) {
@@ -1718,18 +1715,14 @@
 mainwin_set_stopaftersong(gboolean stop)
 {
     aud_cfg->stopaftersong = stop;
-#if 0
     check_set(toggleaction_group_others, "stop after current song", aud_cfg->stopaftersong);
-#endif
 }
 
 void
 mainwin_set_noplaylistadvance(gboolean no_advance)
 {
     aud_cfg->no_playlist_advance = no_advance;
-#if 0
     check_set(toggleaction_group_others, "playback no playlist advance", aud_cfg->no_playlist_advance);
-#endif
 }
 
 static void
--- a/src/skins/ui_main_evlisteners.c	Thu May 22 12:33:08 2008 +0300
+++ b/src/skins/ui_main_evlisteners.c	Thu May 22 15:10:00 2008 +0200
@@ -49,6 +49,12 @@
 static gint song_info_timeout_source = 0;
 static gint update_vis_timeout_source = 0;
 
+typedef struct {
+    gint bitrate;
+    gint samplerate;
+    gint channels;
+} PlaylistEventInfoChange;
+
 /* XXX: there has to be a better way than polling here! */
 /* also: where should this function go? should it stay here? --mf0102 */
 static gboolean
@@ -68,9 +74,7 @@
     gchar *text = (gchar *) hook_data;
 
     ui_skinned_textbox_set_text(mainwin_info, text);
-#if 0
-    playlistwin_update_list(playlist_get_active());
-#endif
+    playlistwin_update_list(aud_playlist_get_active());
 }
 
 static void
@@ -96,13 +100,9 @@
         b = 0;
 
     mainwin_set_volume_slider(v);
-#if 0
     equalizerwin_set_volume_slider(v);
-#endif
     mainwin_set_balance_slider(b);
-#if 0
     equalizerwin_set_balance_slider(b);
-#endif
 }
 
 static void
@@ -201,11 +201,9 @@
 static void
 ui_main_evlistener_playlist_info_change(gpointer hook_data, gpointer user_data)
 {
-#if 0
     PlaylistEventInfoChange *msg = (PlaylistEventInfoChange *) hook_data;
 
     mainwin_set_song_info(msg->bitrate, msg->samplerate, msg->channels);
-#endif
 }
 
 static void
@@ -225,10 +223,8 @@
 static void
 ui_main_evlistener_equalizerwin_show(gpointer hook_data, gpointer user_data)
 {
-#if 0
     gboolean *show = (gboolean*)hook_data;
     equalizerwin_show(*show);
-#endif
 }
 
 static void
--- a/src/skins/ui_manager.c	Thu May 22 12:33:08 2008 +0300
+++ b/src/skins/ui_manager.c	Thu May 22 15:10:00 2008 +0200
@@ -202,7 +202,7 @@
 	{ "anafoff", NULL, N_("Analyzer Falloff") },
 	{ "peafoff", NULL, N_("Peaks Falloff") }
 };
-#if 0
+
 static GtkActionEntry action_entries_playlist[] = {
 
 	{ "playlist", NULL, N_("Playlist") },
@@ -376,7 +376,7 @@
 	  N_("Sorts the list by playlist entry."),
 	  G_CALLBACK(action_playlist_sort_selected_by_playlist_entry) },
 };
-#endif
+
 static GtkActionEntry action_entries_others[] = {
 
 	{ "dummy", NULL, "dummy" },
@@ -559,17 +559,17 @@
     gtk_action_group_add_actions(
     action_group_playback , action_entries_playback ,
     G_N_ELEMENTS(action_entries_playback) , NULL );
-#if 0
+
   action_group_playlist = ui_manager_new_action_group("action_playlist");
     gtk_action_group_add_actions(
     action_group_playlist , action_entries_playlist ,
     G_N_ELEMENTS(action_entries_playlist) , NULL );
-#endif
+
   action_group_visualization = ui_manager_new_action_group("action_visualization");
     gtk_action_group_add_actions(
     action_group_visualization , action_entries_visualization ,
     G_N_ELEMENTS(action_entries_visualization) , NULL );
-#if 0
+
   action_group_view = ui_manager_new_action_group("action_view");
     gtk_action_group_add_actions(
     action_group_view , action_entries_view ,
@@ -599,7 +599,7 @@
   gtk_action_group_add_actions(
     action_group_playlist_sort, action_entries_playlist_sort,
     G_N_ELEMENTS(action_entries_playlist_sort), NULL );
-#endif
+
   action_group_equalizer = ui_manager_new_action_group("action_equalizer");
   gtk_action_group_add_actions(
     action_group_equalizer, action_entries_equalizer,