Commit deb80d2a authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: implement visual feedback for volume changes (close #5837)

the osd sliders don't display correctly - no idea why yet so far
(cherry picked from commit f70cd93da07d2f421791e83101c3796f34365fbc)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent efbfd1e3
...@@ -465,6 +465,19 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -465,6 +465,19 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
} }
} }
- (void)displayVolume
{
vout_thread_t *p_vout = getVout();
if (p_vout)
{
vout_OSDSlider( p_vout, SPU_DEFAULT_CHANNEL,
[self volume]*100/AOUT_VOLUME_MAX, OSD_VERT_SLIDER );
vout_OSDMessage( p_vout, SPU_DEFAULT_CHANNEL, _( "Volume %d%%" ),
[self volume]*100/AOUT_VOLUME_DEFAULT );
vlc_object_release( p_vout );
}
}
- (void)volumeUp - (void)volumeUp
{ {
intf_thread_t *p_intf = VLCIntf; intf_thread_t *p_intf = VLCIntf;
...@@ -472,6 +485,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -472,6 +485,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
return; return;
aout_VolumeUp( pl_Get( p_intf ), 1, NULL ); aout_VolumeUp( pl_Get( p_intf ), 1, NULL );
[self displayVolume];
} }
- (void)volumeDown - (void)volumeDown
...@@ -481,6 +495,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -481,6 +495,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
return; return;
aout_VolumeDown( pl_Get( p_intf ), 1, NULL ); aout_VolumeDown( pl_Get( p_intf ), 1, NULL );
[self displayVolume];
} }
- (void)mute - (void)mute
...@@ -490,6 +505,19 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -490,6 +505,19 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
return; return;
aout_ToggleMute( pl_Get( p_intf ), NULL ); aout_ToggleMute( pl_Get( p_intf ), NULL );
vout_thread_t *p_vout = getVout();
if( p_vout )
{
if( [self isMuted] )
{
vout_OSDIcon( p_vout, SPU_DEFAULT_CHANNEL, OSD_MUTE_ICON );
}
else
[self displayVolume];
vlc_object_release( p_vout );
}
} }
- (BOOL)isMuted - (BOOL)isMuted
......
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