[vlc-devel] commit: Qt: menus, add VolumeMute/VolumeUp/ VolumeDown in the audio menu to match OSX Audio menu. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sun Feb 8 01:11:57 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Feb 8 01:11:11 2009 +0100| [5a4afbeb5bcdf6515871efdd0bd9fe4d435a2be9] | committer: Jean-Baptiste Kempf
Qt: menus, add VolumeMute/VolumeUp/VolumeDown in the audio menu to match OSX Audio menu.
We still have one more separator than OSX has.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5a4afbeb5bcdf6515871efdd0bd9fe4d435a2be9
---
modules/gui/qt4/actions_manager.cpp | 15 +++++++++++++++
modules/gui/qt4/actions_manager.hpp | 8 +++++---
modules/gui/qt4/components/controller_widget.cpp | 2 --
modules/gui/qt4/menus.cpp | 12 ++++++++++++
4 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index 9e5cd8c..ee5bcb6 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -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 );
+}
diff --git a/modules/gui/qt4/actions_manager.hpp b/modules/gui/qt4/actions_manager.hpp
index 6ab2089..9fa3e88 100644
--- a/modules/gui/qt4/actions_manager.hpp
+++ b/modules/gui/qt4/actions_manager.hpp
@@ -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
diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 8cad93a..31f0063 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -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;
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 82e11eb..9d55d26 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -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" ) );
More information about the vlc-devel
mailing list