vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Jul 1 20:38:20 2012 +0300| [9b965746c5d851d99b1351f05d9cbda78cee3e9b] | committer: Rémi Denis-Courmont
aout_MuteToggle: fix name and remove unused or misused volume parameter In particular, show OSD mute icon when mute is enabled, rather than when volume is nul (which is orthogonal). > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b965746c5d851d99b1351f05d9cbda78cee3e9b --- include/vlc_aout_intf.h | 4 ++-- lib/audio.c | 2 +- modules/control/gestures.c | 2 +- modules/control/hotkeys.c | 13 ++++++------- modules/control/rc.c | 2 +- modules/gui/macosx/CoreInteraction.m | 2 +- modules/gui/qt4/actions_manager.cpp | 2 +- modules/gui/skins2/commands/cmd_input.cpp | 2 +- src/audio_output/intf.c | 11 +++-------- src/libvlccore.sym | 2 +- 10 files changed, 18 insertions(+), 24 deletions(-) diff --git a/include/vlc_aout_intf.h b/include/vlc_aout_intf.h index e81f747..b31d980 100644 --- a/include/vlc_aout_intf.h +++ b/include/vlc_aout_intf.h @@ -36,8 +36,8 @@ VLC_API int aout_VolumeSet( vlc_object_t *, audio_volume_t ); VLC_API int aout_VolumeUp( vlc_object_t *, int, audio_volume_t * ); #define aout_VolumeUp(a, b, c) aout_VolumeUp(VLC_OBJECT(a), b, c) #define aout_VolumeDown(a, b, c) aout_VolumeUp(a, -(b), c) -VLC_API int aout_ToggleMute( vlc_object_t *, audio_volume_t * ); -#define aout_ToggleMute(a, b) aout_ToggleMute(VLC_OBJECT(a), b) +VLC_API int aout_MuteToggle( vlc_object_t * ); +#define aout_MuteToggle(a) aout_MuteToggle(VLC_OBJECT(a)) VLC_API int aout_SetMute( vlc_object_t *, audio_volume_t *, bool ); VLC_API bool aout_IsMuted( vlc_object_t * ); diff --git a/lib/audio.c b/lib/audio.c index c0c8cf7..7a5a288 100644 --- a/lib/audio.c +++ b/lib/audio.c @@ -313,7 +313,7 @@ void libvlc_audio_output_set_device_type( libvlc_media_player_t *mp, *****************************************************************************/ void libvlc_audio_toggle_mute( libvlc_media_player_t *mp ) { - aout_ToggleMute( mp, NULL ); + aout_MuteToggle( mp ); } int libvlc_audio_get_mute( libvlc_media_player_t *mp ) diff --git a/modules/control/gestures.c b/modules/control/gestures.c index 05ecb25..486f1f6 100644 --- a/modules/control/gestures.c +++ b/modules/control/gestures.c @@ -274,7 +274,7 @@ static void ProcessGesture( intf_thread_t *p_intf ) case GESTURE(UP,DOWN,NONE,NONE): case GESTURE(DOWN,UP,NONE,NONE): msg_Dbg( p_intf, "Mute sound" ); - aout_ToggleMute( p_playlist, NULL ); + aout_MuteToggle( p_playlist ); break; case GESTURE(UP,RIGHT,NONE,NONE): diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c index 74e74f0..d7e1eee 100644 --- a/modules/control/hotkeys.c +++ b/modules/control/hotkeys.c @@ -201,21 +201,20 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) } case ACTIONID_VOL_MUTE: - { - audio_volume_t i_newvol = -1; - aout_ToggleMute( p_playlist, &i_newvol ); - if( p_vout ) + if( aout_MuteToggle( p_playlist ) == 0 && p_vout != NULL ) { - if( i_newvol == 0 ) + if( aout_IsMuted( VLC_OBJECT(p_playlist) ) ) { ClearChannels( p_intf, p_vout ); DisplayIcon( p_vout, OSD_MUTE_ICON ); } else - DisplayVolume( p_intf, p_vout, i_newvol ); + { + audio_volume_t i_vol = aout_VolumeGet( p_playlist ); + DisplayVolume( p_intf, p_vout, i_vol ); + } } break; - } /* Interface showing */ case ACTIONID_INTF_TOGGLE_FSC: diff --git a/modules/control/rc.c b/modules/control/rc.c index 655a127..360ece2 100644 --- a/modules/control/rc.c +++ b/modules/control/rc.c @@ -1499,7 +1499,7 @@ static int Volume( vlc_object_t *p_this, char const *psz_cmd, /* Set. */ audio_volume_t i_volume = atoi( newval.psz_string ); if( i_volume == 0 ) - aout_ToggleMute( p_playlist, NULL ); + aout_MuteToggle( p_playlist ); if( !aout_VolumeSet( p_playlist, i_volume ) ) i_error = VLC_SUCCESS; osd_Volume( p_this ); diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m index ca5b23f..0602a6f 100644 --- a/modules/gui/macosx/CoreInteraction.m +++ b/modules/gui/macosx/CoreInteraction.m @@ -494,7 +494,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; if( !p_intf ) return; - aout_ToggleMute( pl_Get( p_intf ), NULL ); + aout_MuteToggle( pl_Get( p_intf ) ); } - (BOOL)isMuted diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp index 93a346c..00c8dfe 100644 --- a/modules/gui/qt4/actions_manager.cpp +++ b/modules/gui/qt4/actions_manager.cpp @@ -179,7 +179,7 @@ void ActionsManager::frame() void ActionsManager::toggleMuteAudio() { - aout_ToggleMute( THEPL, NULL ); + aout_MuteToggle( THEPL ); } void ActionsManager::AudioUp() diff --git a/modules/gui/skins2/commands/cmd_input.cpp b/modules/gui/skins2/commands/cmd_input.cpp index 63f4f47..e83ba02 100644 --- a/modules/gui/skins2/commands/cmd_input.cpp +++ b/modules/gui/skins2/commands/cmd_input.cpp @@ -102,7 +102,7 @@ void CmdFaster::execute() void CmdMute::execute() { - aout_ToggleMute( getIntf()->p_sys->p_playlist, NULL ); + aout_MuteToggle( getIntf()->p_sys->p_playlist ); } diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c index 0ae35f7..7f61e7b 100644 --- a/src/audio_output/intf.c +++ b/src/audio_output/intf.c @@ -180,23 +180,18 @@ int aout_VolumeUp (vlc_object_t *obj, int value, audio_volume_t *volp) return ret; } -#undef aout_ToggleMute +#undef aout_MuteToggle /** * Toggles the mute state. */ -int aout_ToggleMute (vlc_object_t *obj, audio_volume_t *volp) +int aout_MuteToggle (vlc_object_t *obj) { audio_output_t *aout; - int ret; - float vol; bool mute; prepareVolume (obj, &aout, &vol, &mute); mute = !mute; - ret = commitVolume (obj, aout, vol, mute); - if (volp != NULL) - *volp = lroundf (vol * AOUT_VOLUME_DEFAULT); - return ret; + return commitVolume (obj, aout, vol, mute); } /** diff --git a/src/libvlccore.sym b/src/libvlccore.sym index 931d923..6e8c49e 100644 --- a/src/libvlccore.sym +++ b/src/libvlccore.sym @@ -17,7 +17,7 @@ aout_MixerRun aout_VolumeGet aout_VolumeSet aout_VolumeUp -aout_ToggleMute +aout_MuteToggle aout_IsMuted aout_SetMute aout_VolumeSoftInit _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
