[vlc-devel] [PATCH 2/3] Added methods to toggle mute, verify whether the video is muted, and setVolume
Rémi Denis-Courmont
remi at remlab.net
Sat Mar 9 09:18:12 CET 2013
Le mardi 5 mars 2013 04:25:26, Vinicius Steffens Pazzini a écrit :
> ---
> modules/gui/qt4/input_manager.cpp | 25 +++++++++++++++++++++++++
> modules/gui/qt4/input_manager.hpp | 4 ++++
> 2 files changed, 29 insertions(+)
>
> diff --git a/modules/gui/qt4/input_manager.cpp
> b/modules/gui/qt4/input_manager.cpp index 2653e11..3ef4c9b 100644
> --- a/modules/gui/qt4/input_manager.cpp
> +++ b/modules/gui/qt4/input_manager.cpp
> @@ -1152,6 +1152,31 @@ void MainInputManager::pause()
> }
> }
>
> +void MainInputManager::toggleMute()
> +{
> + audio_output_t* aout = getAout();
> + if (aout_MuteGet(aout) == 1){
> + aout_MuteSet(aout, false);
> + } else {
> + aout_MuteSet(aout, true);
> + }
> +}
> +
> +bool MainInputManager::isMuted()
> +{
> + audio_output_t* aout = getAout();
> + if(aout_MuteGet(aout) == 1){
> + return true;
> + }
> + return false;
> +}
> +
> +void MainInputManager::setVolume(float volume)
> +{
> + audio_output_t* aout = getAout();
> + aout_VolumeSet (aout, volume);
> +}
> +
getAout() could in theory return NULL.
> void MainInputManager::toggleRandom()
> {
> config_PutInt( p_intf, "random", var_ToggleBool( THEPL, "random" ) );
> diff --git a/modules/gui/qt4/input_manager.hpp
> b/modules/gui/qt4/input_manager.hpp index 33648a3..0e59f69 100644
> --- a/modules/gui/qt4/input_manager.hpp
> +++ b/modules/gui/qt4/input_manager.hpp
> @@ -285,6 +285,10 @@ private:
> QVLCBool mute;
>
> public slots:
> +
> + void toggleMute();
> + bool isMuted();
> + void setVolume(float volume);
> void togglePlayPause();
> void play();
> void pause();
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list