Commit 87b64a6b authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/MainWindow: fixed mute toggle and removed some minor code duplication

parent fe17d440
......@@ -64,6 +64,7 @@
- (void)volumeUp;
- (void)volumeDown;
- (void)toggleMute;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
......
......@@ -446,6 +446,15 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
aout_VolumeDown( pl_Get( p_intf ), 1, NULL );
}
- (void)toggleMute
{
intf_thread_t *p_intf = VLCIntf;
if( !p_intf )
return;
aout_MuteToggle( pl_Get( p_intf ) );
}
- (void)setMute:(BOOL)b_value
{
intf_thread_t *p_intf = VLCIntf;
......
......@@ -1204,9 +1204,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
if (sender == o_volume_sld)
[[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
else if (sender == o_volume_down_btn)
{
[[VLCCoreInteraction sharedInstance] setMute: YES];
}
[[VLCCoreInteraction sharedInstance] toggleMute];
else
[[VLCCoreInteraction sharedInstance] setVolume: AOUT_VOLUME_MAX];
}
......@@ -1568,8 +1566,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)updateVolumeSlider
{
playlist_t * p_playlist = pl_Get( VLCIntf );
int i_volume = lroundf(aout_VolumeGet( p_playlist ) * AOUT_VOLUME_DEFAULT);
int i_volume = [[VLCCoreInteraction sharedInstance] volume];
BOOL b_muted = [[VLCCoreInteraction sharedInstance] mute];
if( !b_muted )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment