]> git.sesse.net Git - vlc/commitdiff
Keep the authoritative fullscreen status on the playlist
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 10 Feb 2010 17:38:47 +0000 (19:38 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 10 Feb 2010 17:55:20 +0000 (19:55 +0200)
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.

modules/control/gestures.c
modules/control/hotkeys.c
modules/control/http/macro.c
modules/control/rc.c
modules/gui/ncurses.c
modules/gui/qt4/actions_manager.cpp
modules/gui/qt4/menus.cpp
modules/gui/skins2/commands/cmd_fullscreen.cpp

index 8e8d9291043c5b9c26b0ef0aa0089f9ee423d7ea..cfc7a37f67588e4b34b1d0fcf061839c8a31a6eb 100644 (file)
@@ -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!"*/
index 8f7c3f556f32c09772444d357d20eae887ade891..801abe66b6df900765f10e6c2586323b90c1a043 100644 (file)
@@ -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:
index f8d322607cf48eb1f0955760e9c5cb9606a26a81..1b846a977000f945d302fc6f9d2cf11ff2d7c900 100644 (file)
@@ -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" );
                         }
index 8a85af2c01ed4319e20356c8a2825bb7032607bb..2c6d574137c31ad9b3bf3c3f7b13771a025b738f 100644 (file)
@@ -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':
             ;
index 0ea1a53b4bc632c8fb076e85bf1a87ea2ca00226..3a019519155f63bb874105c317bac50f8e89a1ba 100644 (file)
@@ -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;
index f2c7f35807def60e5a218218c06c338ecc017f30..c3d8423d36acf259e469e5fa5eef85b7f0275200 100644 (file)
@@ -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 );
     }
 }
index b40351b764f0ba6a2a15596211cdf868d4c0f3df..2f5a0168ec1e25a4e9c9f86a116d664e4ff6cf06 100644 (file)
@@ -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" );
index 09177eaedb5e406c667d558d04fca8e854ff9271..e8b56b9802815afc0e1dd8020272cfef9e56d330 100644 (file)
 
 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 );
     }
 }