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 * );
*****************************************************************************/
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 )
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):
}
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:
/* 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 );
if( !p_intf )
return;
- aout_ToggleMute( pl_Get( p_intf ), NULL );
+ aout_MuteToggle( pl_Get( p_intf ) );
}
- (BOOL)isMuted
void ActionsManager::toggleMuteAudio()
{
- aout_ToggleMute( THEPL, NULL );
+ aout_MuteToggle( THEPL );
}
void ActionsManager::AudioUp()
void CmdMute::execute()
{
- aout_ToggleMute( getIntf()->p_sys->p_playlist, NULL );
+ aout_MuteToggle( getIntf()->p_sys->p_playlist );
}
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);
}
/**
aout_VolumeGet
aout_VolumeSet
aout_VolumeUp
-aout_ToggleMute
+aout_MuteToggle
aout_IsMuted
aout_SetMute
aout_VolumeSoftInit