[vlc-devel] commit: Keep the authoritative fullscreen status on the playlist ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Feb 10 18:56:30 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 10 19:38:47 2010 +0200| [40d199a49334bba38ac01010b23155e2572999dc] | committer: Rémi Denis-Courmont 

Keep the authoritative fullscreen status on the playlist

This allows the value to be inherited most cleanly across inputs (if
the video output cannot be recycled anyway). This also enables changing
the fullscreen status in absence of video, just like LibVLC does.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40d199a49334bba38ac01010b23155e2572999dc
---

 modules/control/gestures.c                     |    7 +++--
 modules/control/hotkeys.c                      |    7 +++--
 modules/control/http/macro.c                   |    8 +++---
 modules/control/rc.c                           |   33 ++++++++---------------
 modules/gui/ncurses.c                          |    7 +---
 modules/gui/qt4/actions_manager.cpp            |    3 +-
 modules/gui/qt4/menus.cpp                      |    1 +
 modules/gui/skins2/commands/cmd_fullscreen.cpp |    6 ++--
 8 files changed, 32 insertions(+), 40 deletions(-)

diff --git a/modules/control/gestures.c b/modules/control/gestures.c
index 8e8d929..cfc7a37 100644
--- a/modules/control/gestures.c
+++ b/modules/control/gestures.c
@@ -379,11 +379,12 @@ static void RunIntf( intf_thread_t *p_intf )
                 break;
 
             case GESTURE(UP,LEFT,NONE,NONE):
+            {
+                bool val = var_ToggleBool( pl_Get( p_intf ), "fullscreen" );
                 if( p_sys->p_vout )
-                {
-                    var_ToggleBool( p_sys->p_vout, "fullscreen" );
-                }
+                    var_SetBool( p_sys->p_vout, "fullscreen", val );
                 break;
+           }
 
             case GESTURE(DOWN,LEFT,NONE,NONE):
                 /* FIXME: Should close the vout!"*/
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 8f7c3f5..801abe6 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -229,15 +229,16 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
 
         case ACTIONID_TOGGLE_FULLSCREEN:
         {
-            vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
-                                       : VLC_OBJECT(p_playlist);
-            var_ToggleBool( obj, "fullscreen" );
+            bool fs = var_ToggleBool( p_playlist, "fullscreen" );
+            if( p_vout )
+                var_SetBool( p_vout, "fullscreen", fs );
             break;
         }
 
         case ACTIONID_LEAVE_FULLSCREEN:
             if( p_vout )
                 var_SetBool( p_vout, "fullscreen", false );
+            var_SetBool( p_playlist, "fullscreen", false );
             break;
 
         case ACTIONID_ZOOM_QUARTER:
diff --git a/modules/control/http/macro.c b/modules/control/http/macro.c
index f8d3226..1b846a9 100644
--- a/modules/control/http/macro.c
+++ b/modules/control/http/macro.c
@@ -230,12 +230,12 @@ static void MacroDo( httpd_file_sys_t *p_args,
                 case MVLC_FULLSCREEN:
                     if( p_sys->p_input )
                     {
-                        vout_thread_t *p_vout;
-
-                        p_vout = input_GetVout( p_sys->p_input );
+                        bool fs = var_ToggleBool( p_sys->p_playlist,
+                                                  "fullscreen" );
+                        vout_thread_t *p_vout = input_GetVout( p_sys->p_input );
                         if( p_vout )
                         {
-                            var_ToggleBool( p_vout, "fullscreen" );
+                            var_SetBool( p_vout, "fullscreen", fs );
                             vlc_object_release( p_vout );
                             msg_Dbg( p_intf, "requested fullscreen toggle" );
                         }
diff --git a/modules/control/rc.c b/modules/control/rc.c
index 8a85af2..2c6d574 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -741,36 +741,27 @@ static void Run( intf_thread_t *p_intf )
         {
         case 'f':
         case 'F':
+        {
+            bool fs;
+
+            if( !strncasecmp( psz_arg, "on", 2 ) )
+                var_SetBool( p_playlist, "fullscreen", fs = true );
+            else if( !strncasecmp( psz_arg, "off", 3 ) )
+                var_SetBool( p_playlist, "fullscreen", fs = false );
+            else
+                fs = var_ToggleBool( p_playlist, "fullscreen" );
+
             if( p_input )
             {
                 vout_thread_t *p_vout = input_GetVout( p_input );
                 if( p_vout )
                 {
-                    vlc_value_t val;
-                    bool b_update = false;
-                    var_Get( p_vout, "fullscreen", &val );
-                    val.b_bool = !val.b_bool;
-                    if( !strncmp( psz_arg, "on", 2 )
-                        && ( val.b_bool == true ) )
-                    {
-                        b_update = true;
-                        val.b_bool = true;
-                    }
-                    else if( !strncmp( psz_arg, "off", 3 )
-                             && ( val.b_bool == false ) )
-                    {
-                        b_update = true;
-                        val.b_bool = false;
-                    }
-                    else if( strncmp( psz_arg, "off", 3 )
-                             && strncmp( psz_arg, "on", 2 ) )
-                        b_update = true;
-                    if( b_update ) var_Set( p_vout, "fullscreen", val );
+                    var_SetBool( p_vout, "fullscreen", fs );
                     vlc_object_release( p_vout );
                 }
             }
             break;
-
+        }
         case 's':
         case 'S':
             ;
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 0ea1a53..3a01951 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1115,18 +1115,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
         /* Common control */
         case 'f':
         {
+            bool fs = var_ToggleBool( p_playlist, "fullscreen" );
             if( p_intf->p_sys->p_input )
             {
                 vout_thread_t *p_vout = inputGetVout( p_intf->p_sys->p_input );
                 if( p_vout )
                 {
-                    var_ToggleBool( p_vout, "fullscreen" );
+                    var_SetBool( p_vout, "fullscreen", fs );
                     vlc_object_release( p_vout );
                 }
-                else
-                {
-                    var_ToggleBool( p_playlist, "fullscreen" );
-                }
             }
             i_ret = 0;
             break;
diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
index f2c7f35..c3d8423 100644
--- a/modules/gui/qt4/actions_manager.cpp
+++ b/modules/gui/qt4/actions_manager.cpp
@@ -118,10 +118,11 @@ void ActionsManager::play()
  */
 void ActionsManager::fullscreen()
 {
+    bool fs = var_ToggleBool( THEPL, "fullscreen" );
     vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout)
     {
-        var_ToggleBool( p_vout, "fullscreen" );
+        var_SetBool( p_vout, "fullscreen", fs );
         vlc_object_release( p_vout );
     }
 }
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index b40351b..2f5a016 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -219,6 +219,7 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
 {
     PUSH_INPUTVAR( "video-es" );
     PUSH_INPUTVAR( "spu-es" );
+#warning This is wrong:
     PUSH_VAR( "fullscreen" );
     PUSH_VAR( "video-on-top" );
     PUSH_VAR( "video-wallpaper" );
diff --git a/modules/gui/skins2/commands/cmd_fullscreen.cpp b/modules/gui/skins2/commands/cmd_fullscreen.cpp
index 09177ea..e8b56b9 100644
--- a/modules/gui/skins2/commands/cmd_fullscreen.cpp
+++ b/modules/gui/skins2/commands/cmd_fullscreen.cpp
@@ -29,15 +29,15 @@
 
 void CmdFullscreen::execute()
 {
+    bool fs = var_ToggleBool( pl_Get( getIntf() ), "fullscreen" );
 
     if( getIntf()->p_sys->p_input == NULL )
         return;
-
     vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input );
     if( pVout )
     {
-        // Switch to fullscreen
-        var_ToggleBool( pVout, "fullscreen" );
+        // Switch fullscreen
+        var_SetBool( pVout, "fullscreen", fs );
         vlc_object_release( pVout );
     }
 }




More information about the vlc-devel mailing list