Commit 5a4afbeb authored by Jean-Baptiste Kempf's avatar 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.
parent e81539dd
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#endif #endif
#include <vlc_vout.h> #include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_keys.h> #include <vlc_keys.h>
#include "actions_manager.hpp" #include "actions_manager.hpp"
...@@ -167,4 +168,18 @@ void ActionsManager::frame() ...@@ -167,4 +168,18 @@ void ActionsManager::frame()
var_SetVoid( p_input, "frame-next" ); 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 );
}
...@@ -75,9 +75,10 @@ private: ...@@ -75,9 +75,10 @@ private:
ActionsManager( intf_thread_t *_p_i, QObject *_parent ); ActionsManager( intf_thread_t *_p_i, QObject *_parent );
intf_thread_t *p_intf; intf_thread_t *p_intf;
protected slots: public slots:
virtual void doAction( int ); void toggleMuteAudio();
void AudioUp();
void AudioDown();
protected slots: protected slots:
void play(); void play();
void fullscreen(); void fullscreen();
...@@ -86,6 +87,7 @@ protected slots: ...@@ -86,6 +87,7 @@ protected slots:
void record(); void record();
void frame(); void frame();
virtual void doAction( int );
}; };
#endif #endif
......
...@@ -139,8 +139,6 @@ bool SoundWidget::eventFilter( QObject *obj, QEvent *e ) ...@@ -139,8 +139,6 @@ bool SoundWidget::eventFilter( QObject *obj, QEvent *e )
else else
{ {
aout_VolumeMute( p_intf, NULL ); aout_VolumeMute( p_intf, NULL );
audio_volume_t i_volume;
aout_VolumeGet( p_intf, &i_volume );
} }
e->accept(); e->accept();
return true; return true;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "dialogs_provider.hpp" /* Dialogs display */ #include "dialogs_provider.hpp" /* Dialogs display */
#include "input_manager.hpp" /* Input Management */ #include "input_manager.hpp" /* Input Management */
#include "recents.hpp" /* Recent Items */ #include "recents.hpp" /* Recent Items */
#include "actions_manager.hpp"
#include <QMenu> #include <QMenu>
#include <QMenuBar> #include <QMenuBar>
...@@ -493,6 +494,17 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) ...@@ -493,6 +494,17 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
if( current->isEmpty() ) 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" ) ); ACT_ADD( current, "visual", qtr( "&Visualizations" ) );
current->addSeparator(); current->addSeparator();
ACT_ADD( current, "audio-es", qtr( "Audio &Track" ) ); ACT_ADD( current, "audio-es", qtr( "Audio &Track" ) );
......
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