]> git.sesse.net Git - vlc/commitdiff
Qt: menus, add VolumeMute/VolumeUp/VolumeDown in the audio menu to match OSX Audio...
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 8 Feb 2009 00:11:11 +0000 (01:11 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 8 Feb 2009 00:11:11 +0000 (01:11 +0100)
We still have one more separator than OSX has.

modules/gui/qt4/actions_manager.cpp
modules/gui/qt4/actions_manager.hpp
modules/gui/qt4/components/controller_widget.cpp
modules/gui/qt4/menus.cpp

index 9e5cd8cba2b51488edf18dfec44a1e6a241d338e..ee5bcb6adb30f7da82f39ecfca1c85b62c6c0ed4 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <vlc_vout.h>
+#include <vlc_aout.h>
 #include <vlc_keys.h>
 
 #include "actions_manager.hpp"
@@ -167,4 +168,18 @@ void ActionsManager::frame()
         var_SetVoid( p_input, "frame-next" );
 }
 
+void ActionsManager::toggleMuteAudio()
+{
+     aout_VolumeMute( p_intf, NULL );
+}
+
+void ActionsManager::AudioUp()
+{
+    aout_VolumeUp( p_intf, 1, NULL );
+}
+
+void ActionsManager::AudioDown()
+{
+    aout_VolumeDown( p_intf, 2, NULL );
+}
 
index 6ab208978be8ce2eaef90384d4d74fcfa7b024ac..9fa3e886ce9a7cff8221bd9a36590c6ce50cbd22 100644 (file)
@@ -75,9 +75,10 @@ private:
     ActionsManager( intf_thread_t  *_p_i, QObject *_parent );
     intf_thread_t       *p_intf;
 
-protected slots:
-    virtual void doAction( int );
-
+public slots:
+    void toggleMuteAudio();
+    void AudioUp();
+    void AudioDown();
 protected slots:
     void play();
     void fullscreen();
@@ -86,6 +87,7 @@ protected slots:
     void record();
     void frame();
 
+    virtual void doAction( int );
 };
 
 #endif
index 8cad93a81bf51c7dffce232c889265bba3f879dc..31f0063284a853df8fa43bb79a2fc151c4f38596 100644 (file)
@@ -139,8 +139,6 @@ bool SoundWidget::eventFilter( QObject *obj, QEvent *e )
         else
         {
             aout_VolumeMute( p_intf, NULL );
-            audio_volume_t i_volume;
-            aout_VolumeGet( p_intf, &i_volume );
         }
         e->accept();
         return true;
index 82e11eb0c00ae94d1407978c2bc522fbd100c07f..9d55d264fa2d6f4db430c3c38723dbcecbcaa7ce 100644 (file)
@@ -40,6 +40,7 @@
 #include "dialogs_provider.hpp"  /* Dialogs display */
 #include "input_manager.hpp"     /* Input Management */
 #include "recents.hpp"           /* Recent Items */
+#include "actions_manager.hpp"
 
 #include <QMenu>
 #include <QMenuBar>
@@ -493,6 +494,17 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
 
     if( current->isEmpty() )
     {
+        QAction *action = current->addAction( qtr( "Mute Audio" ),
+                ActionsManager::getInstance( p_intf ), SLOT( toggleMuteAudio() ) );
+        action->setData( true );
+        action = current->addAction( qtr( "Increase Volume" ),
+                ActionsManager::getInstance( p_intf ), SLOT( AudioUp() ) );
+        action->setData( true );
+        action = current->addAction( qtr( "Decrease Volume" ),
+                ActionsManager::getInstance( p_intf ), SLOT( AudioDown() ) );
+        action->setData( true );
+
+        current->addSeparator();
         ACT_ADD( current, "visual", qtr( "&Visualizations" ) );
         current->addSeparator();
         ACT_ADD( current, "audio-es", qtr( "Audio &Track" ) );