]> git.sesse.net Git - vlc/commitdiff
Qt4 - Add an option to have the volume slider from 0 to 400 %. Close #952 Close ...
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 23 Nov 2007 07:15:53 +0000 (07:15 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 23 Nov 2007 07:15:53 +0000 (07:15 +0000)
Also the soundSlider takes it first value from the preferences...

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/qt4.cpp
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.hpp

index f95b3785bbbfec3e7e51e3d282f42520ed21b6eb..6ab38a191442a85df9c9f631b134f17e3e5f3ebc 100644 (file)
@@ -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 ) );
index a51427c8dbb029358505a915ce8d80243fefaea1..d00c4b9f4ffee0863e3fea690aafea729d2118c1 100644 (file)
@@ -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,
index 85e1d6ba27148f3956f52cb0c2f300f0a78204b1..ff3dbdfb594990bf2809abf4357929c5f19f4308 100644 (file)
@@ -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 );
index fc07341f4ee4a708f98ab2d47be8ada886cdafd2..cc7c5d5368aae145f7c113389c0584bac61ecc1f 100644 (file)
@@ -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;