* 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: menus.cpp,v 1.33 2004/02/26 12:04:14 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
/* 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 );
}
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 ?
}
/* 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;
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: playlist.cpp,v 1.45 2004/02/26 08:24:29 gbazin Exp $
+ * $Id: playlist.cpp,v 1.46 2004/02/26 12:04:14 gbazin Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*
}
/* Update the colour of items */
- vlc_mutex_lock( &p_playlist->object_lock );
- if( p_intf->p_sys->i_playing != p_playlist->i_index )
+ int i_playlist_index = p_playlist->i_index;
+ if( p_intf->p_sys->i_playing != i_playlist_index )
{
wxListItem listitem;
- listitem.m_itemId = p_playlist->i_index;
+ listitem.m_itemId = i_playlist_index;
listitem.SetTextColour( *wxRED );
listview->SetItem( listitem );
listitem.SetTextColour( *wxBLACK );
listview->SetItem( listitem );
}
- p_intf->p_sys->i_playing = p_playlist->i_index;
+ p_intf->p_sys->i_playing = i_playlist_index;
}
- vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}