changeset 35539:9bc02a829c48

Fix bug with evSetBalance. Calculation was wrong, resulting in a strangely acting GUI item. Moreover, the wrong OSD was displayed.
author ib
date Sun, 09 Dec 2012 12:33:00 +0000
parents 68a63175f140
children 8b1322c63eeb
files gui/ui/main.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/main.c	Sun Dec 09 12:31:32 2012 +0000
+++ b/gui/ui/main.c	Sun Dec 09 12:33:00 2012 +0000
@@ -287,10 +287,6 @@
 
    case evSetVolume:
         guiInfo.Volume=param;
-	goto set_volume;
-   case evSetBalance:
-        guiInfo.Balance=param;
-set_volume:
         {
 	 float l = guiInfo.Volume * ( ( 100.0 - guiInfo.Balance ) / 50.0 );
 	 float r = guiInfo.Volume * ( ( guiInfo.Balance ) / 50.0 );
@@ -308,6 +304,17 @@
 	 }
         break;
 
+   case evSetBalance:
+        guiInfo.Balance=param;
+        mixer_setbalance( mixer,(guiInfo.Balance - 50.0 ) / 50.0 );
+        if ( osd_level )
+         {
+          osd_visible=(GetTimerMS() + 1000) | 1;
+          vo_osd_progbar_type=OSD_BALANCE;
+          vo_osd_progbar_value=( ( guiInfo.Balance ) * 256.0 ) / 100.0;
+          vo_osd_changed( OSDTYPE_PROGBAR );
+         }
+        break;
 
    case evMenu:
         /*if (guiApp.menuIsPresent)   NOTE TO MYSELF: Uncomment only after mouse