[vlc-devel] [PATCH 1/3] Variables declaration

Vinicius Steffens Pazzini pazzinivinicius at gmail.com
Tue Mar 5 03:25:25 CET 2013


---
 .tmp                                              |    2 ++
 modules/gui/qt4/components/simple_preferences.cpp |    4 ++++
 modules/gui/qt4/main_interface.cpp                |    5 +++++
 modules/gui/qt4/main_interface.hpp                |    5 +++++
 modules/gui/qt4/ui/sprefs_interface.ui            |   23 +++++++++++++++++++++
 src/libvlc-module.c                               |    4 ++++
 6 files changed, 43 insertions(+)
 create mode 100755 .tmp

diff --git a/.tmp b/.tmp
new file mode 100755
index 0000000..dd3f43c
--- /dev/null
+++ b/.tmp
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec /vlc -I "" "$@"
diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 8de46fa..80b40cd 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -599,6 +599,10 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             CONFIG_BOOL( "qt-pause-minimized", pauseMinimizedBox );
             CONFIG_BOOL( "playlist-tree", treePlaylist );
             CONFIG_BOOL( "play-and-pause", playPauseBox );
+            
+            CONFIG_BOOL( "qt-pause-lose-focus", playPauseFocusBox );
+            CONFIG_BOOL( "qt-mute-lose-focus", muteFocusBox );
+            
             CONFIG_GENERIC_FILE( "skins2-last", File, ui.skinFileLabel,
                                  ui.fileSkin, ui.skinBrowse );
 
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 730fcae..d6a8590 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -99,6 +99,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     b_hasPausedWhenMinimized = false;
     i_kc_offset          = false;
 
+    b_playingInFocus = false;  //contain the original state, the state before losing the focus
+    b_mutedInFocus = false; //contain the original state, the state before losing the focus
+    b_pauseOnLoseFocus = false;
+    b_muteOnLoseFocus = false;
+
     /* Ask for Privacy */
     FirstRun::CheckAndRun( this, p_intf );
 
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index 4c5b1fd..0f11d10 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -165,6 +165,11 @@ private:
     bool                 b_interfaceFullScreen;
     bool                 b_pauseOnMinimize;
 
+    bool                 b_playingInFocus; ///< save previous state
+    bool                 b_mutedInFocus;   ///< save previous state
+	bool                 b_pauseOnLoseFocus; ///< pause when loses focus option
+	bool                 b_muteOnLoseFocus; ///< mute when loses focus option
+
     /* States */
     bool                 playlistVisible;       ///< Is the playlist visible ?
 //    bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
diff --git a/modules/gui/qt4/ui/sprefs_interface.ui b/modules/gui/qt4/ui/sprefs_interface.ui
index a372240..a042f33 100644
--- a/modules/gui/qt4/ui/sprefs_interface.ui
+++ b/modules/gui/qt4/ui/sprefs_interface.ui
@@ -308,6 +308,29 @@
      </layout>
     </widget>
    </item>
+   <item row="5" column="0" colspan="2">
+    <widget class="QGroupBox" name="playlistGroupBox">
+     <property name="title">
+      <string>Focus Options</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_4">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="playPauseFocusBox">
+        <property name="text">
+         <string>Pause</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2" colspan="2">
+       <widget class="QCheckBox" name="muteFocusBox">
+        <property name="text">
+         <string>Mute</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
    <item row="1" column="0" colspan="2">
     <widget class="QGroupBox" name="LooknfeelBox">
      <property name="title">
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 3835ccb..67e6701 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1747,6 +1747,10 @@ vlc_module_begin ()
     add_string( "bookmarks", NULL,
                  BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, true )
         change_safe ()
+        
+    add_bool( "qt-pause-lose-focus", 0, PAP_TEXT, PAP_LONGTEXT, false )
+    add_bool( "qt-mute-lose-focus", 0, PAP_TEXT, PAP_LONGTEXT, false )
+		change_safe()
 
     set_section( N_( "Default devices") , NULL )
 
-- 
1.7.9.5




More information about the vlc-devel mailing list