Commit 40d199a4 authored by Rémi Denis-Courmont's avatar 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.
parent 31612911
...@@ -379,11 +379,12 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -379,11 +379,12 @@ static void RunIntf( intf_thread_t *p_intf )
break; break;
case GESTURE(UP,LEFT,NONE,NONE): case GESTURE(UP,LEFT,NONE,NONE):
{
bool val = var_ToggleBool( pl_Get( p_intf ), "fullscreen" );
if( p_sys->p_vout ) if( p_sys->p_vout )
{ var_SetBool( p_sys->p_vout, "fullscreen", val );
var_ToggleBool( p_sys->p_vout, "fullscreen" );
}
break; break;
}
case GESTURE(DOWN,LEFT,NONE,NONE): case GESTURE(DOWN,LEFT,NONE,NONE):
/* FIXME: Should close the vout!"*/ /* FIXME: Should close the vout!"*/
......
...@@ -229,15 +229,16 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -229,15 +229,16 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
case ACTIONID_TOGGLE_FULLSCREEN: case ACTIONID_TOGGLE_FULLSCREEN:
{ {
vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout) bool fs = var_ToggleBool( p_playlist, "fullscreen" );
: VLC_OBJECT(p_playlist); if( p_vout )
var_ToggleBool( obj, "fullscreen" ); var_SetBool( p_vout, "fullscreen", fs );
break; break;
} }
case ACTIONID_LEAVE_FULLSCREEN: case ACTIONID_LEAVE_FULLSCREEN:
if( p_vout ) if( p_vout )
var_SetBool( p_vout, "fullscreen", false ); var_SetBool( p_vout, "fullscreen", false );
var_SetBool( p_playlist, "fullscreen", false );
break; break;
case ACTIONID_ZOOM_QUARTER: case ACTIONID_ZOOM_QUARTER:
......
...@@ -230,12 +230,12 @@ static void MacroDo( httpd_file_sys_t *p_args, ...@@ -230,12 +230,12 @@ static void MacroDo( httpd_file_sys_t *p_args,
case MVLC_FULLSCREEN: case MVLC_FULLSCREEN:
if( p_sys->p_input ) if( p_sys->p_input )
{ {
vout_thread_t *p_vout; bool fs = var_ToggleBool( p_sys->p_playlist,
"fullscreen" );
p_vout = input_GetVout( p_sys->p_input ); vout_thread_t *p_vout = input_GetVout( p_sys->p_input );
if( p_vout ) if( p_vout )
{ {
var_ToggleBool( p_vout, "fullscreen" ); var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
msg_Dbg( p_intf, "requested fullscreen toggle" ); msg_Dbg( p_intf, "requested fullscreen toggle" );
} }
......
...@@ -741,36 +741,27 @@ static void Run( intf_thread_t *p_intf ) ...@@ -741,36 +741,27 @@ static void Run( intf_thread_t *p_intf )
{ {
case 'f': case 'f':
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 ) if( p_input )
{ {
vout_thread_t *p_vout = input_GetVout( p_input ); vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout ) if( p_vout )
{ {
vlc_value_t val; var_SetBool( p_vout, "fullscreen", fs );
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 );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
} }
break; break;
}
case 's': case 's':
case 'S': case 'S':
; ;
......
...@@ -1115,18 +1115,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key ) ...@@ -1115,18 +1115,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
/* Common control */ /* Common control */
case 'f': case 'f':
{ {
bool fs = var_ToggleBool( p_playlist, "fullscreen" );
if( p_intf->p_sys->p_input ) if( p_intf->p_sys->p_input )
{ {
vout_thread_t *p_vout = inputGetVout( p_intf->p_sys->p_input ); vout_thread_t *p_vout = inputGetVout( p_intf->p_sys->p_input );
if( p_vout ) if( p_vout )
{ {
var_ToggleBool( p_vout, "fullscreen" ); var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
else
{
var_ToggleBool( p_playlist, "fullscreen" );
}
} }
i_ret = 0; i_ret = 0;
break; break;
......
...@@ -118,10 +118,11 @@ void ActionsManager::play() ...@@ -118,10 +118,11 @@ void ActionsManager::play()
*/ */
void ActionsManager::fullscreen() void ActionsManager::fullscreen()
{ {
bool fs = var_ToggleBool( THEPL, "fullscreen" );
vout_thread_t *p_vout = THEMIM->getVout(); vout_thread_t *p_vout = THEMIM->getVout();
if( p_vout) if( p_vout)
{ {
var_ToggleBool( p_vout, "fullscreen" ); var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
} }
......
...@@ -219,6 +219,7 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object, ...@@ -219,6 +219,7 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
{ {
PUSH_INPUTVAR( "video-es" ); PUSH_INPUTVAR( "video-es" );
PUSH_INPUTVAR( "spu-es" ); PUSH_INPUTVAR( "spu-es" );
#warning This is wrong:
PUSH_VAR( "fullscreen" ); PUSH_VAR( "fullscreen" );
PUSH_VAR( "video-on-top" ); PUSH_VAR( "video-on-top" );
PUSH_VAR( "video-wallpaper" ); PUSH_VAR( "video-wallpaper" );
......
...@@ -29,15 +29,15 @@ ...@@ -29,15 +29,15 @@
void CmdFullscreen::execute() void CmdFullscreen::execute()
{ {
bool fs = var_ToggleBool( pl_Get( getIntf() ), "fullscreen" );
if( getIntf()->p_sys->p_input == NULL ) if( getIntf()->p_sys->p_input == NULL )
return; return;
vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input ); vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input );
if( pVout ) if( pVout )
{ {
// Switch to fullscreen // Switch fullscreen
var_ToggleBool( pVout, "fullscreen" ); var_SetBool( pVout, "fullscreen", fs );
vlc_object_release( pVout ); vlc_object_release( pVout );
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment