Commit 72f13c9d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Add an option to have the volume slider from 0 to 400 %. Close #952 Close #1317

Also the soundSlider takes it first value from the preferences...
parent 604c1802
......@@ -495,12 +495,14 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
volMuteLabel->installEventFilter( hVolLabel );
controlLayout->addWidget( volMuteLabel, 3, 15 );
volumeSlider = new SoundSlider( this );
volumeSlider = new SoundSlider( this, config_GetInt( p_intf, "qt-volume-complete" ) );
volumeSlider->setMaximumSize( QSize( 200, 40 ) );
volumeSlider->setMinimumSize( QSize( 80, 20 ) );
controlLayout->addWidget( volumeSlider, 3, 16, 1, 2 );
volumeSlider->setMaximum( VOLUME_MAX );
volumeSlider->setFocusPolicy( Qt::NoFocus );
controlLayout->addWidget( volumeSlider, 3, 16, 1, 2 );
/* Set the volume from the config */
volumeSlider->setValue( (config_GetInt( p_intf, "volume" ) )* VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
/* Volume control connection */
CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
......
......@@ -98,6 +98,12 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define UPDATER_TEXT N_("Activate the new updates notification")
#define UPDATER_LONGTEXT N_("Activate the automatic notification of new " \
"versions of the software. It runs once a week." )
#define COMPLETEVOL_TEXT N_("Allow the volume to be set to 400%" )
#define COMPLETEVOL_LONGTEXT N_("Allow the volume to have range from 0% to " \
"400%, instead of 0% to 200%. This option " \
"can distort the audio, since it uses " \
"software amplification.")
vlc_module_begin();
set_shortname( (char *)"Qt" );
......@@ -123,6 +129,8 @@ vlc_module_begin();
add_bool( "qt-minimal-view", VLC_FALSE, NULL, MINIMAL_TEXT,
MINIMAL_TEXT, VLC_TRUE );
add_bool( "qt-volume-complete", VLC_FALSE, NULL, COMPLETEVOL_TEXT,
COMPLETEVOL_LONGTEXT, VLC_TRUE);
add_bool( "qt-name-in-title", VLC_TRUE, NULL, TITLE_TEXT,
TITLE_LONGTEXT, VLC_FALSE );
add_string( "qt-filedialog-path", NULL, NULL, FILEDIALOG_PATH_TEXT,
......
......@@ -80,10 +80,10 @@ void InputSlider::mouseMoveEvent(QMouseEvent *event)
#define SOUNDMAX 200 // % OR 400 ?
#define SOUNDSTEP 5 // %
SoundSlider::SoundSlider( QWidget *_parent ) : QAbstractSlider( _parent )
SoundSlider::SoundSlider( QWidget *_parent, bool b_hard ) : QAbstractSlider( _parent )
{
padding = 5;
setRange( SOUNDMIN, SOUNDMAX );
setRange( SOUNDMIN, b_hard ? (2 * SOUNDMAX) : SOUNDMAX );
pixGradient = QPixmap( QSize( WLENGTH, WHEIGHT ) );
// QBixmap mask = QBitmap( QPixmap );
......
......@@ -54,7 +54,7 @@ class SoundSlider : public QAbstractSlider
{
Q_OBJECT
public:
SoundSlider( QWidget *_parent );
SoundSlider( QWidget *_parent, bool b_softamp );
virtual ~SoundSlider() {};
protected:
int padding;
......
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