* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: menus.cpp,v 1.32 2004/02/26 00:23:04 gbazin Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
ppsz_varnames[i] = "fullscreen";
pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "zoom";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "deinterlace";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "aspect-ratio";
FIND_ANYWHERE );
if( p_object != NULL )
{
+ ppsz_varnames[i] = "bookmark";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "title";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter";
ppsz_varnames[i] = "fullscreen";
pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "zoom";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "deinterlace";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "aspect-ratio";
FIND_ANYWHERE );
if( p_object != NULL )
{
+ ppsz_varnames[i] = "bookmark";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "title";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter";
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING:
case VLC_VAR_INTEGER:
+ case VLC_VAR_FLOAT:
break;
default:
/* Variable doesn't exist or isn't handled */
/* Get the descriptive name of the variable */
var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
- var_Get( p_object, psz_var, &val );
-
if( i_type & VLC_VAR_HASCHOICE )
{
menu->Append( MenuDummy_Event,
switch( i_type & VLC_VAR_TYPE )
{
case VLC_VAR_VOID:
+ var_Get( p_object, psz_var, &val );
menuitem = new wxMenuItemExt( menu, ++i_item_id,
wxU(text.psz_string ?
text.psz_string : psz_var),
break;
case VLC_VAR_BOOL:
+ var_Get( p_object, psz_var, &val );
val.b_bool = !val.b_bool;
menuitem = new wxMenuItemExt( menu, ++i_item_id,
wxU(text.psz_string ?
menu->Append( menuitem );
Check( i_item_id, val.b_bool ? FALSE : TRUE );
break;
-
- default:
- if( text.psz_string ) free( text.psz_string );
- return;
}
- if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
}
case VLC_VAR_VARIABLE:
case VLC_VAR_STRING:
case VLC_VAR_INTEGER:
+ case VLC_VAR_FLOAT:
break;
default:
/* Variable doesn't exist or isn't handled */
return NULL;
}
- if( var_Get( p_object, psz_var, &val ) < 0 )
- {
- return NULL;
- }
-
if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
&val_list, &text_list ) < 0 )
{
- if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
return NULL;
}
break;
case VLC_VAR_STRING:
+ var_Get( p_object, psz_var, &val );
+
another_val.psz_string =
strdup(val_list.p_list->p_values[i].psz_string);
menuitem =
menu->Append( menuitem );
- if( !(i_type & VLC_VAR_ISCOMMAND) &&
+ if( !(i_type & VLC_VAR_ISCOMMAND) && val.psz_string &&
!strcmp( val.psz_string,
val_list.p_list->p_values[i].psz_string ) )
menu->Check( i_item_id, TRUE );
+
+ if( val.psz_string ) free( val.psz_string );
break;
case VLC_VAR_INTEGER:
+ var_Get( p_object, psz_var, &val );
+
menuitem =
new wxMenuItemExt( menu, ++i_item_id,
text_list.p_list->p_values[i].psz_string ?
menu->Check( i_item_id, TRUE );
break;
+ case VLC_VAR_FLOAT:
+ var_Get( p_object, psz_var, &val );
+
+ menuitem =
+ new wxMenuItemExt( menu, ++i_item_id,
+ text_list.p_list->p_values[i].psz_string ?
+ (wxString)wxU(
+ text_list.p_list->p_values[i].psz_string) :
+ wxString::Format(wxT("%.2f"),
+ val_list.p_list->p_values[i].f_float),wxT(""),
+ i_type & VLC_VAR_ISCOMMAND ?
+ wxITEM_NORMAL : wxITEM_RADIO,
+ strdup(psz_var),
+ p_object->i_object_id,
+ val_list.p_list->p_values[i], i_type );
+
+ menu->Append( menuitem );
+
+ if( !(i_type & VLC_VAR_ISCOMMAND) &&
+ val_list.p_list->p_values[i].f_float == val.f_float )
+ menu->Check( i_item_id, TRUE );
+ break;
+
default:
break;
}
}
/* clean up everything */
- if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
return menu;