[vlc-commits] macosx: proper gui update when toogle mute state

David Fuhrmann git at videolan.org
Thu Feb 23 19:14:50 CET 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Feb 23 18:47:44 2012 +0100| [53dfe2b3a26c1f6ae97ab466fa2c871896e7258d] | committer: Felix Paul Kühne

macosx: proper gui update when toogle mute state

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=53dfe2b3a26c1f6ae97ab466fa2c871896e7258d
---

 modules/gui/macosx/MainWindow.m |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 050b61a..4b870e1 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -750,10 +750,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
     else if (sender == o_volume_down_btn)
     {
         [[VLCCoreInteraction sharedInstance] mute];
-        [o_volume_sld setIntValue: 0];
-        BOOL b_mute = ![[VLCCoreInteraction sharedInstance] isMuted];
-        [o_volume_sld setEnabled: b_mute];
-        [o_volume_up_btn setEnabled: b_mute];
     }
     else
         [[VLCCoreInteraction sharedInstance] setVolume: AOUT_VOLUME_MAX];
@@ -1096,13 +1092,19 @@ static VLCMainWindow *_o_sharedInstance = nil;
     playlist_t * p_playlist = pl_Get( VLCIntf );
 
     i_volume = aout_VolumeGet( p_playlist );
+    BOOL b_muted = [[VLCCoreInteraction sharedInstance] isMuted];
 
-    if( i_volume != i_lastShownVolume )
+    if( !b_muted )
     {
         i_lastShownVolume = i_volume;
         [o_volume_sld setIntValue: i_volume];
         [o_fspanel setVolumeLevel: i_volume];
     }
+    else
+        [o_volume_sld setIntValue: 0];
+
+    [o_volume_sld setEnabled: !b_muted];
+    [o_volume_up_btn setEnabled: !b_muted];
 }
 
 - (void)updateName



More information about the vlc-commits mailing list