[vlc-commits] macosx: improve handling the mute action in the main window. disable slider and fullvolume button in case mute is active. (fixes #5800)
Felix Paul Kühne
git at videolan.org
Sat Jan 7 18:24:11 CET 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Jan 7 18:24:08 2012 +0100| [df8a9d08077afb7de671c3d6de4bde323de5c61c] | committer: Felix Paul Kühne
macosx: improve handling the mute action in the main window. disable slider and fullvolume button in case mute is active. (fixes #5800)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=df8a9d08077afb7de671c3d6de4bde323de5c61c
---
.../macosx/Resources/English.lproj/MainMenu.xib | 16 ++++++++--------
modules/gui/macosx/MainWindow.h | 1 -
modules/gui/macosx/MainWindow.m | 9 +++++++++
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.xib b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
index f0915bf..18a5e49 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.xib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.xib
@@ -21,16 +21,16 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="2770"/>
<integer value="1617"/>
- <integer value="4756"/>
- <integer value="915"/>
- <integer value="4895"/>
<integer value="29"/>
- <integer value="2770"/>
- <integer value="2730"/>
- <integer value="4596"/>
+ <integer value="21"/>
<integer value="4722"/>
+ <integer value="915"/>
+ <integer value="4596"/>
<integer value="283"/>
+ <integer value="4895"/>
+ <integer value="2730"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -969,7 +969,7 @@
<string key="NSContents"/>
<reference key="NSSupport" ref="188716167"/>
<reference key="NSControlView" ref="474770834"/>
- <int key="NSButtonFlags">-2039217921</int>
+ <int key="NSButtonFlags">141820159</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage" id="267511931">
<string key="NSClassName">NSImage</string>
@@ -1020,7 +1020,7 @@
<string key="NSContents"/>
<reference key="NSSupport" ref="188716167"/>
<reference key="NSControlView" ref="963106097"/>
- <int key="NSButtonFlags">-2039217921</int>
+ <int key="NSButtonFlags">141820159</int>
<int key="NSButtonFlags2">2</int>
<object class="NSCustomResource" key="NSNormalImage" id="112655283">
<string key="NSClassName">NSImage</string>
diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 8d6a863..51b2f0f 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -73,7 +73,6 @@
BOOL b_nativeFullscreenMode;
BOOL b_video_playback_enabled;
int i_lastShownVolume;
- BOOL b_mute;
input_state_e cachedInputState;
NSImage * o_pause_img;
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 69203dd..8fdd2f0 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -232,6 +232,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_shuffle_btn setAlternateImage: o_shuffle_pressed_img];
[o_play_btn setImage: o_play_img];
[o_play_btn setAlternateImage: o_play_pressed_img];
+ BOOL b_mute = ![[VLCCoreInteraction sharedInstance] isMuted];
+ [o_volume_sld setEnabled: b_mute];
+ [o_volume_up_btn setEnabled: b_mute];
/* interface builder action */
[self setDelegate: self];
@@ -673,7 +676,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (sender == o_volume_sld)
[[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
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];
}
More information about the vlc-commits
mailing list