[vlc-devel] [PATCH 1/3] Qt forced default value is different than libvlc's saved

Francois Cartegnie fcvlcdev at free.fr
Sat Jul 10 19:49:40 CEST 2010


---
 modules/gui/qt4/components/simple_preferences.cpp |    2 +-
 modules/gui/qt4/qt4.cpp                           |    3 +++
 modules/gui/qt4/qt4.hpp                           |    4 ++++
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index f56468a..d99d291 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -310,7 +310,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 #undef audioCommon
 
             /* Audio Options */
-            CONFIG_GENERIC_NO_BOOL( "volume" , IntegerRangeSlider, NULL,
+            CONFIG_GENERIC_NO_BOOL( "qt-startvolume" , IntegerRangeSlider, NULL,
                                      defaultVolume );
             CONNECT( ui.defaultVolume, valueChanged( int ),
                      this, updateAudioVolume( int ) );
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 990b255..a1990d9 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -128,6 +128,7 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
                                  "software amplification." )
 
 #define SAVEVOL_TEXT N_( "Automatically save the volume on exit" )
+#define STARTVOL_TEXT N_( "Default start volume" )
 
 #define PRIVACY_TEXT N_( "Ask for network policy at start" )
 
@@ -200,6 +201,8 @@ vlc_module_begin ()
               COMPLETEVOL_LONGTEXT, true )
     add_bool( "qt-autosave-volume", false, NULL, SAVEVOL_TEXT,
               SAVEVOL_TEXT, true )
+    add_integer_with_range( "qt-startvolume", QT_VOLUME_DEFAULT, 0,
+               QT_VOLUME_MAX, NULL, STARTVOL_TEXT, STARTVOL_TEXT, true )
 
     add_bool( "qt-embedded-open", false, NULL, QT_NATIVEOPEN_TEXT,
                QT_NATIVEOPEN_TEXT, false )
diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
index 8678b79..577d434 100644
--- a/modules/gui/qt4/qt4.hpp
+++ b/modules/gui/qt4/qt4.hpp
@@ -32,6 +32,7 @@
 #include <vlc_common.h>    /* VLC_COMMON_MEMBERS for vlc_interface.h */
 #include <vlc_interface.h> /* intf_thread_t */
 #include <vlc_playlist.h>  /* playlist_t */
+#include <vlc_aout.h>      /* AOUT_VOLUME_ */
 
 #define QT_NO_CAST_TO_ASCII
 #include <QString>
@@ -117,6 +118,9 @@ struct intf_sys_t
 
 #define getSettings() p_intf->p_sys->mainSettings
 
+#define QT_VOLUME_DEFAULT AOUT_VOLUME_DEFAULT
+#define QT_VOLUME_MAX (AOUT_VOLUME_DEFAULT * 2)
+
 static inline QString QVLCUserDir( vlc_userdir_t type )
 {
     char *dir = config_GetUserDir( type );
-- 
1.6.4.4




More information about the vlc-devel mailing list