Commit 03acd6ad authored by Rémi Duraffort's avatar Rémi Duraffort

controles: use var_Get* and var_ToggleBool when applicable.

parent a15d8784
...@@ -176,7 +176,6 @@ DBUS_METHOD( PositionGet ) ...@@ -176,7 +176,6 @@ DBUS_METHOD( PositionGet )
{ /* returns position in milliseconds */ { /* returns position in milliseconds */
REPLY_INIT; REPLY_INIT;
OUT_ARGUMENTS; OUT_ARGUMENTS;
vlc_value_t position;
dbus_int32_t i_pos; dbus_int32_t i_pos;
playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) ); playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) );
...@@ -186,8 +185,7 @@ DBUS_METHOD( PositionGet ) ...@@ -186,8 +185,7 @@ DBUS_METHOD( PositionGet )
i_pos = 0; i_pos = 0;
else else
{ {
var_Get( p_input, "time", &position ); i_pos = var_GetTime( p_input, "time" ) / 1000;
i_pos = position.i_time / 1000;
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
pl_Release( ((vlc_object_t*) p_this) ); pl_Release( ((vlc_object_t*) p_this) );
...@@ -1261,7 +1259,7 @@ static int MarshalStatus( intf_thread_t* p_intf, DBusMessageIter* args ) ...@@ -1261,7 +1259,7 @@ static int MarshalStatus( intf_thread_t* p_intf, DBusMessageIter* args )
DBusMessageIter status; DBusMessageIter status;
dbus_int32_t i_state, i_random, i_repeat, i_loop; dbus_int32_t i_state, i_random, i_repeat, i_loop;
vlc_value_t val; int i_val;
playlist_t* p_playlist = NULL; playlist_t* p_playlist = NULL;
input_thread_t* p_input = NULL; input_thread_t* p_input = NULL;
...@@ -1272,12 +1270,12 @@ static int MarshalStatus( intf_thread_t* p_intf, DBusMessageIter* args ) ...@@ -1272,12 +1270,12 @@ static int MarshalStatus( intf_thread_t* p_intf, DBusMessageIter* args )
p_input = playlist_CurrentInput( p_playlist ); p_input = playlist_CurrentInput( p_playlist );
if( p_input ) if( p_input )
{ {
var_Get( p_input, "state", &val ); i_val = var_GetInteger( p_input, "state" );
if( val.i_int >= END_S ) if( i_val >= END_S )
i_state = 2; i_state = 2;
else if( val.i_int == PAUSE_S ) else if( i_val == PAUSE_S )
i_state = 1; i_state = 1;
else if( val.i_int <= PLAYING_S ) else if( i_val <= PLAYING_S )
i_state = 0; i_state = 0;
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
......
...@@ -198,7 +198,6 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -198,7 +198,6 @@ static void RunIntf( intf_thread_t *p_intf )
*/ */
if( p_sys->b_got_gesture ) if( p_sys->b_got_gesture )
{ {
vlc_value_t val;
int i_interval = 0; int i_interval = 0;
/* Do something */ /* Do something */
/* If you modify this, please try to follow this convention: /* If you modify this, please try to follow this convention:
...@@ -215,8 +214,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -215,8 +214,8 @@ static void RunIntf( intf_thread_t *p_intf )
i_interval = config_GetInt( p_intf , "short-jump-size" ); i_interval = config_GetInt( p_intf , "short-jump-size" );
if ( i_interval > 0 ) if ( i_interval > 0 )
{ {
val.i_time = ( (mtime_t)( -i_interval ) * 1000000L); mtime_t i_time = ( (mtime_t)( -i_interval ) * 1000000L);
var_Set( p_input, "time-offset", val ); var_SetTime( p_input, "time-offset", i_time );
} }
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
...@@ -230,8 +229,8 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -230,8 +229,8 @@ static void RunIntf( intf_thread_t *p_intf )
i_interval = config_GetInt( p_intf , "short-jump-size" ); i_interval = config_GetInt( p_intf , "short-jump-size" );
if ( i_interval > 0 ) if ( i_interval > 0 )
{ {
val.i_time = ( (mtime_t)( i_interval ) * 1000000L); mtime_t i_time = ( (mtime_t)( i_interval ) * 1000000L);
var_Set( p_input, "time-offset", val ); var_SetTime( p_input, "time-offset", i_time );
} }
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
...@@ -264,9 +263,9 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -264,9 +263,9 @@ static void RunIntf( intf_thread_t *p_intf )
if( p_input ) if( p_input )
{ {
var_Get( p_input, "state", &val); int i_state = var_GetInteger( p_input, "state" );
val.i_int = ( val.i_int != PLAYING_S ) ? PLAYING_S : PAUSE_S; var_SetInteger( p_input, "state", ( i_state != PLAYING_S )
var_Set( p_input, "state", val); ? PLAYING_S : PAUSE_S );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
break; break;
...@@ -297,14 +296,14 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -297,14 +296,14 @@ static void RunIntf( intf_thread_t *p_intf )
case GESTURE(UP,RIGHT,NONE,NONE): case GESTURE(UP,RIGHT,NONE,NONE):
{ {
vlc_value_t val, list, list2; vlc_value_t list, list2;
int i_count, i; int i_count, i, i_audio_es;
p_input = playlist_CurrentInput( p_playlist ); p_input = playlist_CurrentInput( p_playlist );
if( !p_input ) if( !p_input )
break; break;
var_Get( p_input, "audio-es", &val ); i_audio_es = var_GetInteger( p_input, "audio-es" );
var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES, var_Change( p_input, "audio-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
i_count = list.p_list->i_count; i_count = list.p_list->i_count;
...@@ -316,7 +315,7 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -316,7 +315,7 @@ static void RunIntf( intf_thread_t *p_intf )
} }
for( i = 0; i < i_count; i++ ) for( i = 0; i < i_count; i++ )
{ {
if( val.i_int == list.p_list->p_values[i].i_int ) if( i_audio_es == list.p_list->p_values[i].i_int )
break; break;
} }
/* value of audio-es was not in choices list */ /* value of audio-es was not in choices list */
...@@ -330,21 +329,21 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -330,21 +329,21 @@ static void RunIntf( intf_thread_t *p_intf )
i = 1; i = 1;
else else
i++; i++;
var_Set( p_input, "audio-es", list.p_list->p_values[i] ); var_SetInteger( p_input, "audio-es", list.p_list->p_values[i].i_int );
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
break; break;
case GESTURE(DOWN,RIGHT,NONE,NONE): case GESTURE(DOWN,RIGHT,NONE,NONE):
{ {
vlc_value_t val, list, list2; vlc_value_t list, list2;
int i_count, i; int i_count, i, i_spu_es;
p_input = playlist_CurrentInput( p_playlist ); p_input = playlist_CurrentInput( p_playlist );
if( !p_input ) if( !p_input )
break; break;
var_Get( p_input, "spu-es", &val ); i_spu_es = var_GetInteger( p_input, "spu-es" );
var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
&list, &list2 ); &list, &list2 );
...@@ -357,7 +356,7 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -357,7 +356,7 @@ static void RunIntf( intf_thread_t *p_intf )
} }
for( i = 0; i < i_count; i++ ) for( i = 0; i < i_count; i++ )
{ {
if( val.i_int == list.p_list->p_values[i].i_int ) if( i_spu_es == list.p_list->p_values[i].i_int )
{ {
break; break;
} }
...@@ -373,7 +372,7 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -373,7 +372,7 @@ static void RunIntf( intf_thread_t *p_intf )
i = 0; i = 0;
else else
i++; i++;
var_Set( p_input, "spu-es", list.p_list->p_values[i] ); var_SetInteger( p_input, "spu-es", list.p_list->p_values[i].i_int);
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
vlc_object_release( p_input ); vlc_object_release( p_input );
} }
...@@ -382,9 +381,7 @@ static void RunIntf( intf_thread_t *p_intf ) ...@@ -382,9 +381,7 @@ static void RunIntf( intf_thread_t *p_intf )
case GESTURE(UP,LEFT,NONE,NONE): case GESTURE(UP,LEFT,NONE,NONE):
if( p_sys->p_vout ) if( p_sys->p_vout )
{ {
var_Get( p_sys->p_vout, "fullscreen", &val ); var_ToggleBool( p_sys->p_vout, "fullscreen" );
val.b_bool = !val.b_bool;
var_Set( p_sys->p_vout, "fullscreen", val );
} }
break; break;
......
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