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 @@
#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 );
}
......@@ -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
......
......@@ -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;
......
......@@ -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" ) );
......
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