changeset 4587:ab8bc8a89a52

remove ui_main_set_initial_volume, call volume set hook instead
author Tomasz Mon <desowin@gmail.com>
date Sun, 25 May 2008 15:12:17 +0200
parents 5fa09aa0b14a
children df2b2c6810e1
files src/audacious/input.c src/audacious/main.c src/audacious/ui_main.c src/audacious/ui_main.h
diffstat 4 files changed, 5 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/input.c	Fri May 23 15:37:45 2008 +0200
+++ b/src/audacious/input.c	Sun May 25 15:12:17 2008 +0200
@@ -725,7 +725,7 @@
     h_vol[0] = l;
     h_vol[1] = r;
     hook_call("volume set", h_vol);
-    
+
     if (playback_get_playing())
         if ((playback = get_current_input_playback()) != NULL)
 	    if (playback->plugin->set_volume != NULL)
--- a/src/audacious/main.c	Fri May 23 15:37:45 2008 +0200
+++ b/src/audacious/main.c	Sun May 25 15:12:17 2008 +0200
@@ -765,7 +765,10 @@
          * but not if we're running headless --nenolod
          */
         mainwin_setup_menus();
-        ui_main_set_initial_volume();
+
+        gint h_vol[2];
+        input_get_volume(&h_vol[0], &h_vol[1]);
+        hook_call("volume set", h_vol);
 
         /* FIXME: delayed, because it deals directly with the plugin
          * interface to set menu items */
--- a/src/audacious/ui_main.c	Fri May 23 15:37:45 2008 +0200
+++ b/src/audacious/ui_main.c	Sun May 25 15:12:17 2008 +0200
@@ -1948,29 +1948,6 @@
     GDK_THREADS_LEAVE();
 }
 
-void
-ui_main_set_initial_volume(void)
-{
-    gint vl, vr, b, v;
-
-    input_get_volume(&vl, &vr);
-
-    vl = CLAMP(vl, 0, 100);
-    vr = CLAMP(vr, 0, 100);
-    v = MAX(vl, vr);
-    if (vl > vr)
-        b = (gint) rint(((gdouble) vr / vl) * 100) - 100;
-    else if (vl < vr)
-        b = 100 - (gint) rint(((gdouble) vl / vr) * 100);
-    else
-        b = 0;
-
-    mainwin_set_volume_slider(v);
-    equalizerwin_set_volume_slider(v);
-    mainwin_set_balance_slider(b);
-    equalizerwin_set_balance_slider(b);
-}
-
 static void
 set_timer_mode(TimerMode mode)
 {
--- a/src/audacious/ui_main.h	Fri May 23 15:37:45 2008 +0200
+++ b/src/audacious/ui_main.h	Sun May 25 15:12:17 2008 +0200
@@ -115,7 +115,6 @@
 extern GtkWidget *mainwin_position, *mainwin_sposition;
 
 void mainwin_create(void);
-void ui_main_set_initial_volume(void);
 
 void mainwin_lock_info_text(const gchar * text);
 void mainwin_release_info_text(void);