Commit ad80d3c3 authored by Rémi Duraffort's avatar Rémi Duraffort

Use var_ToggleBool when applicable.

parent 9f3dc2d6
......@@ -231,8 +231,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{
vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
: VLC_OBJECT(p_playlist);
bool b = var_GetBool( obj, "fullscreen" );
var_SetBool( obj, "fullscreen", !b );
var_ToggleBool( obj, "fullscreen" );
break;
}
......@@ -265,8 +264,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{ /* FIXME: this is invalid if not using DirectX output!!! */
vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
: VLC_OBJECT(p_playlist);
bool b = var_GetBool( obj, "directx-wallpaper" );
var_SetBool( obj, "directx-wallpaper", !b );
var_ToggleBool( obj, "directx-wallpaper" );
}
#endif
......@@ -287,8 +285,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
case ACTIONID_RANDOM:
{
bool b = var_GetBool( p_playlist, "random" );
var_SetBool( p_playlist, "random", !b );
var_ToggleBool( p_playlist, "random" );
}
case ACTIONID_PLAY_PAUSE:
......
......@@ -235,7 +235,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
p_vout = input_GetVout( p_sys->p_input );
if( p_vout )
{
var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
var_ToggleBool( p_vout, "fullscreen" );
vlc_object_release( p_vout );
msg_Dbg( p_intf, "requested fullscreen toggle" );
}
......
......@@ -506,9 +506,7 @@
if( [o_title isEqualToString: _NS("Fullscreen")] ||
[sender isKindOfClass:[NSButton class]] )
{
vlc_value_t val;
var_Get( p_playlist, "fullscreen", &val );
var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
var_ToggleBool( p_playlist, "fullscreen" );
}
pl_Release( VLCIntf );
......
......@@ -563,19 +563,13 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
vlc_value_t val;
/* Playlist Settings */
case 'r':
var_Get( p_playlist, "random", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "random", val );
var_ToggleBool( p_playlist, "random" );
goto end;
case 'l':
var_Get( p_playlist, "loop", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "loop", val );
var_ToggleBool( p_playlist, "loop" );
goto end;
case 'R':
var_Get( p_playlist, "repeat", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "repeat", val );
var_ToggleBool( p_playlist, "repeat" );
goto end;
/* Playlist sort */
......@@ -1137,16 +1131,12 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
{
var_Get( p_vout, "fullscreen", &val );
val.b_bool = !val.b_bool;
var_Set( p_vout, "fullscreen", val );
var_ToggleBool( p_vout, "fullscreen" );
vlc_object_release( p_vout );
}
else
{
var_Get( p_playlist, "fullscreen", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "fullscreen", val );
var_ToggleBool( p_playlist, "fullscreen" );
}
}
i_ret = 0;
......
......@@ -117,7 +117,7 @@ void ActionsManager::fullscreen()
vout_thread_t *p_vout = THEMIM->getVout();
if( p_vout)
{
var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
var_ToggleBool( p_vout, "fullscreen" );
vlc_object_release( p_vout );
}
}
......@@ -143,8 +143,7 @@ void ActionsManager::record()
if( p_input )
{
/* This method won't work fine if the stream can't be cut anywhere */
const bool b_recording = var_GetBool( p_input, "record" );
var_SetBool( p_input, "record", !b_recording );
var_ToggleBool( p_input, "record" );
#if 0
else
{
......
......@@ -37,7 +37,7 @@ void CmdFullscreen::execute()
if( pVout )
{
// Switch to fullscreen
var_SetBool( pVout, "fullscreen", !var_GetBool( pVout, "fullscreen" ) );
var_ToggleBool( pVout, "fullscreen" );
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