Commit 1979486d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

libvlc_audio_*: remove useless exception parameters

parent 1e399ae2
......@@ -962,27 +962,24 @@ VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
* Toggle mute status.
*
* \param p_instance libvlc instance
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t * );
/**
* Get current mute status.
*
* \param p_instance libvlc instance
* \param p_e an initialized exception pointer
* \return the mute status (boolean)
*/
VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t * );
/**
* Set mute status.
*
* \param p_instance libvlc instance
* \param status If status is true then mute, otherwise unmute
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int );
/**
* Get current audio level.
......@@ -991,7 +988,7 @@ VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exc
* \param p_e an initialized exception pointer
* \return the audio level (int)
*/
VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t * );
/**
* Set current audio level.
......
......@@ -504,7 +504,7 @@ void VLCPlugin::initVLC()
libvlc_audio_set_volume(_p_libvlc, _i_volume, NULL);
if( _b_mute )
{
libvlc_audio_set_mute(_p_libvlc, TRUE, NULL);
libvlc_audio_set_mute(_p_libvlc, TRUE);
}
// initial playlist item
......
......@@ -349,13 +349,7 @@ STDMETHODIMP VLCControl::toggleMute(void)
libvlc_instance_t* p_libvlc;
HRESULT result = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(result) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_audio_toggle_mute(p_libvlc, &ex);
result = exception_bridge(&ex);
}
libvlc_audio_toggle_mute(p_libvlc);
return result;
};
......
......@@ -148,14 +148,8 @@ STDMETHODIMP VLCAudio::get_mute(VARIANT_BOOL* mute)
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
*mute = libvlc_audio_get_mute(p_libvlc, &ex) ?
*mute = libvlc_audio_get_mute(p_libvlc) ?
VARIANT_TRUE : VARIANT_FALSE;
hr = exception_bridge(&ex);
}
return hr;
};
......@@ -164,13 +158,7 @@ STDMETHODIMP VLCAudio::put_mute(VARIANT_BOOL mute)
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_audio_set_mute(p_libvlc, VARIANT_FALSE != mute, &ex);
hr = exception_bridge(&ex);
}
libvlc_audio_set_mute(p_libvlc, VARIANT_FALSE != mute);
return hr;
};
......@@ -182,13 +170,7 @@ STDMETHODIMP VLCAudio::get_volume(long* volume)
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
*volume = libvlc_audio_get_volume(p_libvlc, &ex);
hr = exception_bridge(&ex);
}
*volume = libvlc_audio_get_volume(p_libvlc);
return hr;
};
......@@ -349,13 +331,7 @@ STDMETHODIMP VLCAudio::toggleMute()
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_audio_toggle_mute(p_libvlc, &ex);
hr = exception_bridge(&ex);
}
libvlc_audio_toggle_mute(p_libvlc);
return hr;
};
......
......@@ -50,17 +50,12 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
- (void)setMute:(BOOL)value
{
libvlc_audio_set_mute([library instance], value, NULL);
libvlc_audio_set_mute([library instance], value);
}
- (BOOL)isMuted
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
BOOL result = libvlc_audio_get_mute([library instance], &ex);
catch_exception(&ex);
return result;
return libvlc_audio_get_mute([library instance]);
}
- (void)setVolume:(int)value
......@@ -74,10 +69,6 @@ NSString * VLCMediaPlayerVolumeChanged = @"VLCMediaPlayerVolumeChanged";
- (int)volume
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
int result = libvlc_audio_get_volume([library instance], &ex);
catch_exception(&ex);
return result;
return libvlc_audio_get_volume([library instance]);
}
@end
......@@ -225,8 +225,7 @@ LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
}
case ID_audio_volume:
{
int volume = libvlc_audio_get_volume(p_plugin->getVLC(), &ex);
RETURN_ON_EXCEPTION(this,ex);
int volume = libvlc_audio_get_volume(p_plugin->getVLC());
INT32_TO_NPVARIANT(volume, result);
return INVOKERESULT_NO_ERROR;
}
......@@ -280,8 +279,7 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
if( NPVARIANT_IS_BOOLEAN(value) )
{
libvlc_audio_set_mute(p_plugin->getVLC(),
NPVARIANT_TO_BOOLEAN(value), &ex);
RETURN_ON_EXCEPTION(this,ex);
NPVARIANT_TO_BOOLEAN(value));
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_INVALID_VALUE;
......@@ -349,8 +347,7 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
case ID_audio_togglemute:
if( argCount == 0 )
{
libvlc_audio_toggle_mute(p_plugin->getVLC(), &ex);
RETURN_ON_EXCEPTION(this,ex);
libvlc_audio_toggle_mute(p_plugin->getVLC());
VOID_TO_NPVARIANT(result);
return INVOKERESULT_NO_ERROR;
}
......
......@@ -748,8 +748,7 @@ void VlcPlugin::redrawToolbar()
libvlc_exception_init( &ex );
/* get mute info */
b_mute = libvlc_audio_get_mute( getVLC(), &ex );
libvlc_exception_clear( &ex );
b_mute = libvlc_audio_get_mute( getVLC() );
gcv.foreground = BlackPixel( p_display, 0 );
gc = XCreateGC( p_display, control, GCForeground, &gcv );
......@@ -857,8 +856,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
libvlc_exception_clear( &ex );
/* get mute info */
b_mute = libvlc_audio_get_mute( getVLC(), &ex );
libvlc_exception_clear( &ex );
b_mute = libvlc_audio_get_mute( getVLC() );
/* is Pause of Play button clicked */
if( (is_playing != 1) &&
......
......@@ -313,24 +313,19 @@ void libvlc_audio_output_set_device_type( libvlc_instance_t *p_instance,
/*****************************************************************************
* libvlc_audio_get_mute : Get the volume state, true if muted
*****************************************************************************/
void libvlc_audio_toggle_mute( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
void libvlc_audio_toggle_mute( libvlc_instance_t *p_instance )
{
VLC_UNUSED(p_e);
aout_ToggleMute( p_instance->p_libvlc_int, NULL );
}
int libvlc_audio_get_mute( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
int libvlc_audio_get_mute( libvlc_instance_t *p_instance )
{
return (libvlc_audio_get_volume(p_instance, p_e) == 0);
return (libvlc_audio_get_volume(p_instance) == 0);
}
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute,
libvlc_exception_t *p_e )
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute )
{
if ( mute ^ libvlc_audio_get_mute( p_instance, p_e ) )
if ( !mute != !libvlc_audio_get_mute( p_instance ) )
{
aout_ToggleMute( p_instance->p_libvlc_int, NULL );
}
......@@ -339,11 +334,8 @@ void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute,
/*****************************************************************************
* libvlc_audio_get_volume : Get the current volume (range 0-200 %)
*****************************************************************************/
int libvlc_audio_get_volume( libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
int libvlc_audio_get_volume( libvlc_instance_t *p_instance )
{
VLC_UNUSED(p_e);
audio_volume_t i_volume;
aout_VolumeGet( p_instance->p_libvlc_int, &i_volume );
......
......@@ -206,14 +206,11 @@ unsigned short
mediacontrol_sound_get_volume( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
int i_ret = 0;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
i_ret = libvlc_audio_get_volume( self->p_instance, &ex );
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
i_ret = libvlc_audio_get_volume( self->p_instance );
/* FIXME: Normalize in [0..100] */
return (unsigned short)i_ret;
}
......
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