[vlc-devel] [PATCH 2/3] Added methods to toggle mute, verify whether the video is muted, and setVolume

Vinicius Steffens Pazzini pazzinivinicius at gmail.com
Tue Mar 5 03:25:26 CET 2013


---
 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);
+}
+
 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();
-- 
1.7.9.5




More information about the vlc-devel mailing list