vlc | branch: master | Felix Paul Kühne <[email protected]> | Sun Feb 19 20:40:27 2012 +0100| [f70cd93da07d2f421791e83101c3796f34365fbc] | committer: Felix Paul Kühne
macosx: implement visual feedback for volume changes (close #5837) the osd sliders don't display correctly - no idea why yet so far > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f70cd93da07d2f421791e83101c3796f34365fbc --- modules/gui/macosx/CoreInteraction.m | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m index 3a7f1be..d773774 100644 --- a/modules/gui/macosx/CoreInteraction.m +++ b/modules/gui/macosx/CoreInteraction.m @@ -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 { intf_thread_t *p_intf = VLCIntf; @@ -472,6 +485,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; return; aout_VolumeUp( pl_Get( p_intf ), 1, NULL ); + [self displayVolume]; } - (void)volumeDown @@ -481,6 +495,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; return; aout_VolumeDown( pl_Get( p_intf ), 1, NULL ); + [self displayVolume]; } - (void)mute @@ -490,6 +505,19 @@ static VLCCoreInteraction *_o_sharedInstance = nil; return; 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 _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
