Commit 32486e65 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

variables: remove VLC_VAR_GETLIST (same as VLC_VAR_GETCHOICES)

parent c320bf79
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
#define VLC_VAR_CLEARCHOICES 0x0022 #define VLC_VAR_CLEARCHOICES 0x0022
#define VLC_VAR_SETDEFAULT 0x0023 #define VLC_VAR_SETDEFAULT 0x0023
#define VLC_VAR_GETCHOICES 0x0024 #define VLC_VAR_GETCHOICES 0x0024
#define VLC_VAR_GETLIST 0x0025
#define VLC_VAR_CHOICESCOUNT 0x0026 #define VLC_VAR_CHOICESCOUNT 0x0026
/**@}*/ /**@}*/
......
...@@ -1466,7 +1466,7 @@ libvlc_track_description_t * ...@@ -1466,7 +1466,7 @@ libvlc_track_description_t *
return NULL; return NULL;
vlc_value_t val_list, text_list; vlc_value_t val_list, text_list;
int i_ret = var_Change( p_input, psz_variable, VLC_VAR_GETLIST, &val_list, &text_list ); int i_ret = var_Change( p_input, psz_variable, VLC_VAR_GETCHOICES, &val_list, &text_list );
if( i_ret != VLC_SUCCESS ) if( i_ret != VLC_SUCCESS )
return NULL; return NULL;
......
...@@ -495,7 +495,7 @@ void libvlc_toggle_teletext( libvlc_media_player_t *p_mi ) ...@@ -495,7 +495,7 @@ void libvlc_toggle_teletext( libvlc_media_player_t *p_mi )
else else
{ {
vlc_value_t list; vlc_value_t list;
if( !var_Change( p_input_thread, "teletext-es", VLC_VAR_GETLIST, &list, NULL ) ) if( !var_Change( p_input_thread, "teletext-es", VLC_VAR_GETCHOICES, &list, NULL ) )
{ {
if( list.p_list->i_count > 0 ) if( list.p_list->i_count > 0 )
var_SetInteger( p_input_thread, "spu-es", list.p_list->p_values[0].i_int ); var_SetInteger( p_input_thread, "spu-es", list.p_list->p_values[0].i_int );
......
...@@ -805,7 +805,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -805,7 +805,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{ {
vlc_value_t val={0}, val_list, text_list; vlc_value_t val={0}, val_list, text_list;
var_Get( p_vout, "aspect-ratio", &val ); var_Get( p_vout, "aspect-ratio", &val );
if( var_Change( p_vout, "aspect-ratio", VLC_VAR_GETLIST, if( var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES,
&val_list, &text_list ) >= 0 ) &val_list, &text_list ) >= 0 )
{ {
int i; int i;
...@@ -835,7 +835,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -835,7 +835,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{ {
vlc_value_t val={0}, val_list, text_list; vlc_value_t val={0}, val_list, text_list;
var_Get( p_vout, "crop", &val ); var_Get( p_vout, "crop", &val );
if( var_Change( p_vout, "crop", VLC_VAR_GETLIST, if( var_Change( p_vout, "crop", VLC_VAR_GETCHOICES,
&val_list, &text_list ) >= 0 ) &val_list, &text_list ) >= 0 )
{ {
int i; int i;
...@@ -957,7 +957,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -957,7 +957,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
{ {
vlc_value_t val={0}, val_list, text_list; vlc_value_t val={0}, val_list, text_list;
var_Get( p_vout, "zoom", &val ); var_Get( p_vout, "zoom", &val );
if( var_Change( p_vout, "zoom", VLC_VAR_GETLIST, if( var_Change( p_vout, "zoom", VLC_VAR_GETCHOICES,
&val_list, &text_list ) >= 0 ) &val_list, &text_list ) >= 0 )
{ {
int i; int i;
......
...@@ -1127,7 +1127,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1127,7 +1127,7 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
i_value = val.i_int; i_value = val.i_int;
if ( var_Change( p_input, psz_variable, if ( var_Change( p_input, psz_variable,
VLC_VAR_GETLIST, &val, &text ) < 0 ) VLC_VAR_GETCHOICES, &val, &text ) < 0 )
goto out; goto out;
msg_rc( "+----[ %s ]", val_name.psz_string ); msg_rc( "+----[ %s ]", val_name.psz_string );
...@@ -1584,7 +1584,7 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd, ...@@ -1584,7 +1584,7 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
} }
if ( var_Change( p_vout, psz_variable, if ( var_Change( p_vout, psz_variable,
VLC_VAR_GETLIST, &val, &text ) < 0 ) VLC_VAR_GETCHOICES, &val, &text ) < 0 )
{ {
vlc_object_release( p_vout ); vlc_object_release( p_vout );
free( psz_value ); free( psz_value );
...@@ -1689,7 +1689,7 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd, ...@@ -1689,7 +1689,7 @@ static int AudioChannel( vlc_object_t *obj, char const *cmd,
/* Retrieve all registered ***. */ /* Retrieve all registered ***. */
vlc_value_t val, text; vlc_value_t val, text;
if ( var_Change( p_aout, "stereo-mode", if ( var_Change( p_aout, "stereo-mode",
VLC_VAR_GETLIST, &val, &text ) < 0 ) VLC_VAR_GETCHOICES, &val, &text ) < 0 )
{ {
ret = VLC_ENOVAR; ret = VLC_ENOVAR;
goto out; goto out;
......
...@@ -1430,7 +1430,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1430,7 +1430,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
return; return;
} }
if (var_Change(p_object, psz_variable, VLC_VAR_GETLIST, if (var_Change(p_object, psz_variable, VLC_VAR_GETCHOICES,
&val_list, &text_list) < 0) { &val_list, &text_list) < 0) {
if ((i_type & VLC_VAR_TYPE) == VLC_VAR_STRING) free(val.psz_string); if ((i_type & VLC_VAR_TYPE) == VLC_VAR_STRING) free(val.psz_string);
return; return;
......
...@@ -1567,7 +1567,7 @@ static void CycleESTrack(intf_sys_t *sys, const char *var) ...@@ -1567,7 +1567,7 @@ static void CycleESTrack(intf_sys_t *sys, const char *var)
return; return;
vlc_value_t val; vlc_value_t val;
if (var_Change(input, var, VLC_VAR_GETLIST, &val, NULL) < 0) if (var_Change(input, var, VLC_VAR_GETCHOICES, &val, NULL) < 0)
return; return;
vlc_list_t *list = val.p_list; vlc_list_t *list = val.p_list;
......
...@@ -270,7 +270,7 @@ void AspectRatioComboBox::updateRatios() ...@@ -270,7 +270,7 @@ void AspectRatioComboBox::updateRatios()
return; return;
} }
var_Change( p_vout, "aspect-ratio", VLC_VAR_GETLIST, &val_list, &text_list ); var_Change( p_vout, "aspect-ratio", VLC_VAR_GETCHOICES, &val_list, &text_list );
for( int i = 0; i < val_list.p_list->i_count; i++ ) for( int i = 0; i < val_list.p_list->i_count; i++ )
addItem( qfu( text_list.p_list->p_values[i].psz_string ), addItem( qfu( text_list.p_list->p_values[i].psz_string ),
QString( val_list.p_list->p_values[i].psz_string ) ); QString( val_list.p_list->p_values[i].psz_string ) );
......
...@@ -828,7 +828,7 @@ void InputManager::sectionMenu() ...@@ -828,7 +828,7 @@ void InputManager::sectionMenu()
{ {
vlc_value_t val, text; vlc_value_t val, text;
if( var_Change( p_input, "title 0", VLC_VAR_GETLIST, &val, &text ) < 0 ) if( var_Change( p_input, "title 0", VLC_VAR_GETCHOICES, &val, &text ) < 0 )
return; return;
/* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */ /* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */
...@@ -877,7 +877,7 @@ void InputManager::activateTeletext( bool b_enable ) ...@@ -877,7 +877,7 @@ void InputManager::activateTeletext( bool b_enable )
{ {
vlc_value_t list; vlc_value_t list;
vlc_value_t text; vlc_value_t text;
if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETLIST, &list, &text ) ) if( hasInput() && !var_Change( p_input, "teletext-es", VLC_VAR_GETCHOICES, &list, &text ) )
{ {
if( list.p_list->i_count > 0 ) if( list.p_list->i_count > 0 )
{ {
......
...@@ -1243,7 +1243,7 @@ static bool IsMenuEmpty( const char *psz_var, ...@@ -1243,7 +1243,7 @@ static bool IsMenuEmpty( const char *psz_var,
} }
/* Check children variables in case of VLC_VAR_VARIABLE */ /* Check children variables in case of VLC_VAR_VARIABLE */
if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 ) if( var_Change( p_object, psz_var, VLC_VAR_GETCHOICES, &val_list, NULL ) < 0 )
{ {
return true; return true;
} }
...@@ -1428,7 +1428,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -1428,7 +1428,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, if( var_Change( p_object, psz_var, VLC_VAR_GETCHOICES,
&val_list, &text_list ) < 0 ) &val_list, &text_list ) < 0 )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -218,7 +218,7 @@ static int vlclua_var_get_list( lua_State *L ) ...@@ -218,7 +218,7 @@ static int vlclua_var_get_list( lua_State *L )
vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" ); vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" );
const char *psz_var = luaL_checkstring( L, 2 ); const char *psz_var = luaL_checkstring( L, 2 );
int i_ret = var_Change( *pp_obj, psz_var, VLC_VAR_GETLIST, &val, &text ); int i_ret = var_Change( *pp_obj, psz_var, VLC_VAR_GETCHOICES, &val, &text );
if( i_ret < 0 ) if( i_ret < 0 )
return vlclua_push_ret( L, i_ret ); return vlclua_push_ret( L, i_ret );
......
...@@ -3014,7 +3014,7 @@ static void input_SubtitleAdd( input_thread_t *p_input, ...@@ -3014,7 +3014,7 @@ static void input_SubtitleAdd( input_thread_t *p_input,
/* Select the ES */ /* Select the ES */
vlc_value_t list; vlc_value_t list;
if( var_Change( p_input, "spu-es", VLC_VAR_GETLIST, &list, NULL ) ) if( var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES, &list, NULL ) )
return; return;
if( count.i_int == 0 ) if( count.i_int == 0 )
count.i_int++; count.i_int++;
......
...@@ -531,7 +531,6 @@ int var_Change( vlc_object_t *p_this, const char *psz_name, ...@@ -531,7 +531,6 @@ int var_Change( vlc_object_t *p_this, const char *psz_name,
p_var->ops->pf_free( &oldval ); p_var->ops->pf_free( &oldval );
break; break;
case VLC_VAR_GETCHOICES: case VLC_VAR_GETCHOICES:
case VLC_VAR_GETLIST:
p_val->p_list = xmalloc( sizeof(vlc_list_t) ); p_val->p_list = xmalloc( sizeof(vlc_list_t) );
p_val->p_list->p_values = p_val->p_list->p_values =
xmalloc( p_var->choices.i_count * sizeof(vlc_value_t) ); xmalloc( p_var->choices.i_count * sizeof(vlc_value_t) );
......
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