1 /*****************************************************************************
2 * menus.cpp : wxWindows plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000-2004 VideoLAN
5 * $Id: menus.cpp,v 1.32 2004/02/26 00:23:04 gbazin Exp $
7 * Authors: Gildas Bazin <gbazin@netcourrier.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 #include <stdlib.h> /* malloc(), free() */
28 #include <errno.h> /* ENOMEM */
29 #include <string.h> /* strerror() */
35 #include "wxwindows.h"
37 class wxMenuItemExt: public wxMenuItem
41 wxMenuItemExt( wxMenu* parentMenu, int id, const wxString& text,
42 const wxString& helpString, wxItemKind kind,
43 char *_psz_var, int _i_object_id, vlc_value_t _val,
46 virtual ~wxMenuItemExt();
57 /*****************************************************************************
59 *****************************************************************************/
61 /* IDs for the controls and the menu commands */
65 MenuDummy_Event = wxID_HIGHEST + 1000,
66 OpenFileSimple_Event = wxID_HIGHEST + 1100,
70 FirstAutoGenerated_Event = wxID_HIGHEST + 1999,
71 SettingsMenu_Events = wxID_HIGHEST + 5000,
72 AudioMenu_Events = wxID_HIGHEST + 2000,
73 VideoMenu_Events = wxID_HIGHEST + 3000,
74 NavigMenu_Events = wxID_HIGHEST + 4000,
75 PopupMenu_Events = wxID_HIGHEST + 6000
78 BEGIN_EVENT_TABLE(Menu, wxMenu)
81 BEGIN_EVENT_TABLE(MenuEvtHandler, wxEvtHandler)
82 EVT_MENU(OpenFileSimple_Event, MenuEvtHandler::OnShowDialog)
83 EVT_MENU(OpenFile_Event, MenuEvtHandler::OnShowDialog)
84 EVT_MENU(OpenDisc_Event, MenuEvtHandler::OnShowDialog)
85 EVT_MENU(OpenNet_Event, MenuEvtHandler::OnShowDialog)
86 EVT_MENU(-1, MenuEvtHandler::OnMenuEvent)
89 wxMenu *OpenStreamMenu( intf_thread_t *p_intf )
91 wxMenu *menu = new wxMenu;
92 menu->Append( OpenFileSimple_Event, wxU(_("Quick &Open File...")) );
93 menu->Append( OpenFile_Event, wxU(_("Open &File...")) );
94 menu->Append( OpenDisc_Event, wxU(_("Open &Disc...")) );
95 menu->Append( OpenNet_Event, wxU(_("Open &Network Stream...")) );
99 void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
102 #define MAX_POPUP_ITEMS 35
104 vlc_object_t *p_object;
105 char *ppsz_varnames[MAX_POPUP_ITEMS];
106 int pi_objects[MAX_POPUP_ITEMS];
109 /* Initializations */
110 memset( pi_objects, 0, MAX_POPUP_ITEMS * sizeof(int) );
113 ppsz_varnames[i++] = _("Audio menu");
114 ppsz_varnames[i++] = NULL; /* Separator */
116 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
118 if( p_object != NULL )
120 ppsz_varnames[i] = "audio-device";
121 pi_objects[i++] = p_object->i_object_id;
122 ppsz_varnames[i] = "audio-channels";
123 pi_objects[i++] = p_object->i_object_id;
124 ppsz_varnames[i] = "visual";
125 pi_objects[i++] = p_object->i_object_id;
126 vlc_object_release( p_object );
130 ppsz_varnames[i++] = NULL; /* Separator */
131 ppsz_varnames[i++] = _("Video menu");
132 ppsz_varnames[i++] = NULL; /* Separator */
134 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
136 if( p_object != NULL )
138 vlc_object_t *p_dec_obj;
140 ppsz_varnames[i] = "fullscreen";
141 pi_objects[i++] = p_object->i_object_id;
142 ppsz_varnames[i] = "deinterlace";
143 pi_objects[i++] = p_object->i_object_id;
144 ppsz_varnames[i] = "aspect-ratio";
145 pi_objects[i++] = p_object->i_object_id;
146 ppsz_varnames[i] = "crop";
147 pi_objects[i++] = p_object->i_object_id;
148 ppsz_varnames[i] = "video-on-top";
149 pi_objects[i++] = p_object->i_object_id;
151 p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
154 if( p_dec_obj != NULL )
156 ppsz_varnames[i] = "ffmpeg-pp-q";
157 pi_objects[i++] = p_dec_obj->i_object_id;
158 vlc_object_release( p_dec_obj );
161 vlc_object_release( p_object );
165 ppsz_varnames[i++] = NULL; /* Separator */
166 ppsz_varnames[i++] = _("Input menu");
167 ppsz_varnames[i++] = NULL; /* Separator */
169 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
171 if( p_object != NULL )
173 ppsz_varnames[i] = "title";
174 pi_objects[i++] = p_object->i_object_id;
175 ppsz_varnames[i] = "chapter";
176 pi_objects[i++] = p_object->i_object_id;
177 ppsz_varnames[i] = "program";
178 pi_objects[i++] = p_object->i_object_id;
179 ppsz_varnames[i] = "navigation";
180 pi_objects[i++] = p_object->i_object_id;
181 ppsz_varnames[i] = "dvd_menus";
182 pi_objects[i++] = p_object->i_object_id;
184 ppsz_varnames[i] = "video-es";
185 pi_objects[i++] = p_object->i_object_id;
186 ppsz_varnames[i] = "audio-es";
187 pi_objects[i++] = p_object->i_object_id;
188 ppsz_varnames[i] = "spu-es";
189 pi_objects[i++] = p_object->i_object_id;
191 vlc_object_release( p_object );
195 ppsz_varnames[i++] = NULL; /* Separator */
196 ppsz_varnames[i++] = _("Interface menu");
197 ppsz_varnames[i++] = NULL; /* Separator */
199 /* vlc_object_find is needed because of the dialogs provider case */
200 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INTF,
202 if( p_object != NULL )
204 ppsz_varnames[i] = "intf-switch";
205 pi_objects[i++] = p_object->i_object_id;
206 ppsz_varnames[i] = "intf-add";
207 pi_objects[i++] = p_object->i_object_id;
209 vlc_object_release( p_object );
213 Menu popupmenu( p_intf, p_parent, i,
214 ppsz_varnames, pi_objects, PopupMenu_Events );
217 /* Add static entries */
218 popupmenu.AppendSeparator();
219 popupmenu.Append( MenuDummy_Event, wxU("Open..."),
220 OpenStreamMenu( p_intf ), wxT("") );
223 p_intf->p_sys->p_popup_menu = &popupmenu;
224 p_parent->PopupMenu( &popupmenu, pos.x, pos.y );
225 p_intf->p_sys->p_popup_menu = NULL;
228 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
230 #define MAX_AUDIO_ITEMS 10
232 vlc_object_t *p_object;
233 char *ppsz_varnames[MAX_AUDIO_ITEMS];
234 int pi_objects[MAX_AUDIO_ITEMS];
237 /* Initializations */
238 memset( pi_objects, 0, MAX_AUDIO_ITEMS * sizeof(int) );
240 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
242 if( p_object != NULL )
244 ppsz_varnames[i] = "audio-es";
245 pi_objects[i++] = p_object->i_object_id;
246 vlc_object_release( p_object );
249 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_AOUT,
251 if( p_object != NULL )
253 ppsz_varnames[i] = "audio-device";
254 pi_objects[i++] = p_object->i_object_id;
255 ppsz_varnames[i] = "audio-channels";
256 pi_objects[i++] = p_object->i_object_id;
257 ppsz_varnames[i] = "visual";
258 pi_objects[i++] = p_object->i_object_id;
259 vlc_object_release( p_object );
263 return new Menu( _p_intf, p_parent, i,
264 ppsz_varnames, pi_objects, AudioMenu_Events );
267 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
269 #define MAX_VIDEO_ITEMS 15
271 vlc_object_t *p_object;
272 char *ppsz_varnames[MAX_VIDEO_ITEMS];
273 int pi_objects[MAX_VIDEO_ITEMS];
276 /* Initializations */
277 memset( pi_objects, 0, MAX_VIDEO_ITEMS * sizeof(int) );
279 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
281 if( p_object != NULL )
283 ppsz_varnames[i] = "video-es";
284 pi_objects[i++] = p_object->i_object_id;
285 ppsz_varnames[i] = "spu-es";
286 pi_objects[i++] = p_object->i_object_id;
287 vlc_object_release( p_object );
290 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_VOUT,
292 if( p_object != NULL )
294 vlc_object_t *p_dec_obj;
296 ppsz_varnames[i] = "fullscreen";
297 pi_objects[i++] = p_object->i_object_id;
298 ppsz_varnames[i] = "deinterlace";
299 pi_objects[i++] = p_object->i_object_id;
300 ppsz_varnames[i] = "aspect-ratio";
301 pi_objects[i++] = p_object->i_object_id;
302 ppsz_varnames[i] = "crop";
303 pi_objects[i++] = p_object->i_object_id;
304 ppsz_varnames[i] = "directx-on-top";
305 pi_objects[i++] = p_object->i_object_id;
306 ppsz_varnames[i] = "xvideo-on-top";
307 pi_objects[i++] = p_object->i_object_id;
308 ppsz_varnames[i] = "x11-on-top";
309 pi_objects[i++] = p_object->i_object_id;
311 p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
314 if( p_dec_obj != NULL )
316 ppsz_varnames[i] = "ffmpeg-pp-q";
317 pi_objects[i++] = p_dec_obj->i_object_id;
318 vlc_object_release( p_dec_obj );
321 vlc_object_release( p_object );
325 return new Menu( _p_intf, p_parent, i,
326 ppsz_varnames, pi_objects, VideoMenu_Events );
329 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
331 #define MAX_NAVIG_ITEMS 10
333 vlc_object_t *p_object;
334 char *ppsz_varnames[MAX_NAVIG_ITEMS];
335 int pi_objects[MAX_NAVIG_ITEMS];
338 /* Initializations */
339 memset( pi_objects, 0, MAX_NAVIG_ITEMS * sizeof(int) );
341 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
343 if( p_object != NULL )
345 ppsz_varnames[i] = "title";
346 pi_objects[i++] = p_object->i_object_id;
347 ppsz_varnames[i] = "chapter";
348 pi_objects[i++] = p_object->i_object_id;
349 ppsz_varnames[i] = "program";
350 pi_objects[i++] = p_object->i_object_id;
351 ppsz_varnames[i] = "navigation";
352 pi_objects[i++] = p_object->i_object_id;
353 ppsz_varnames[i] = "dvd_menus";
354 pi_objects[i++] = p_object->i_object_id;
356 ppsz_varnames[i] = "prev-title";
357 pi_objects[i++] = p_object->i_object_id;
358 ppsz_varnames[i] = "next-title";
359 pi_objects[i++] = p_object->i_object_id;
360 ppsz_varnames[i] = "prev-chapter";
361 pi_objects[i++] = p_object->i_object_id;
362 ppsz_varnames[i] = "next-chapter";
363 pi_objects[i++] = p_object->i_object_id;
365 vlc_object_release( p_object );
369 return new Menu( _p_intf, p_parent, i,
370 ppsz_varnames, pi_objects, NavigMenu_Events );
373 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent )
375 #define MAX_SETTINGS_ITEMS 10
377 vlc_object_t *p_object;
378 char *ppsz_varnames[MAX_SETTINGS_ITEMS];
379 int pi_objects[MAX_SETTINGS_ITEMS];
382 /* Initializations */
383 memset( pi_objects, 0, MAX_SETTINGS_ITEMS * sizeof(int) );
385 p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INTF,
387 if( p_object != NULL )
389 ppsz_varnames[i] = "intf-switch";
390 pi_objects[i++] = p_object->i_object_id;
391 ppsz_varnames[i] = "intf-add";
392 pi_objects[i++] = p_object->i_object_id;
393 vlc_object_release( p_object );
397 return new Menu( _p_intf, p_parent, i,
398 ppsz_varnames, pi_objects, SettingsMenu_Events );
401 /*****************************************************************************
403 *****************************************************************************/
404 Menu::Menu( intf_thread_t *_p_intf, wxWindow *p_parent,
405 int i_count, char **ppsz_varnames, int *pi_objects,
406 int i_start_id ): wxMenu( )
408 vlc_object_t *p_object;
409 vlc_bool_t b_section_empty = VLC_FALSE;
412 /* Initializations */
415 i_item_id = i_start_id;
417 for( i = 0; i < i_count; i++ )
419 if( !ppsz_varnames[i] )
421 if( b_section_empty )
423 Append( MenuDummy_Event + i, wxU(_("Empty")) );
424 Enable( MenuDummy_Event + i, FALSE );
428 b_section_empty = VLC_TRUE;
434 Append( MenuDummy_Event, wxU(ppsz_varnames[i]) );
435 b_section_empty = VLC_FALSE;
439 p_object = (vlc_object_t *)vlc_object_get( p_intf, pi_objects[i] );
440 if( p_object == NULL ) continue;
442 b_section_empty = VLC_FALSE;
443 CreateMenuItem( this, ppsz_varnames[i], p_object );
444 vlc_object_release( p_object );
447 /* Special case for empty menus */
448 if( GetMenuItemCount() == 0 || b_section_empty )
450 Append( MenuDummy_Event + i, wxU(_("Empty")) );
451 Enable( MenuDummy_Event + i, FALSE );
459 /*****************************************************************************
461 *****************************************************************************/
462 static bool IsMenuEmpty( char *psz_var, vlc_object_t *p_object,
465 vlc_value_t val, val_list;
466 int i_type, i_result, i;
468 /* Check the type of the object variable */
469 i_type = var_Type( p_object, psz_var );
471 /* Check if we want to display the variable */
472 if( !(i_type & VLC_VAR_HASCHOICE) ) return FALSE;
474 var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
475 if( val.i_int == 0 ) return TRUE;
477 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
479 if( val.i_int == 1 && b_root ) return TRUE;
483 /* Check children variables in case of VLC_VAR_VARIABLE */
484 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 )
489 for( i = 0, i_result = TRUE; i < val_list.p_list->i_count; i++ )
491 if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
499 /* clean up everything */
500 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
505 void Menu::CreateMenuItem( wxMenu *menu, char *psz_var,
506 vlc_object_t *p_object )
508 wxMenuItemExt *menuitem;
509 vlc_value_t val, text;
512 /* Check the type of the object variable */
513 i_type = var_Type( p_object, psz_var );
515 switch( i_type & VLC_VAR_TYPE )
519 case VLC_VAR_VARIABLE:
521 case VLC_VAR_INTEGER:
524 /* Variable doesn't exist or isn't handled */
528 /* Make sure we want to display the variable */
529 if( IsMenuEmpty( psz_var, p_object ) ) return;
531 /* Get the descriptive name of the variable */
532 var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
534 var_Get( p_object, psz_var, &val );
536 if( i_type & VLC_VAR_HASCHOICE )
538 menu->Append( MenuDummy_Event,
539 wxU(text.psz_string ? text.psz_string : psz_var),
540 CreateChoicesMenu( psz_var, p_object, TRUE ),
541 wxT("")/* Nothing for now (maybe use a GETLONGTEXT) */ );
543 if( text.psz_string ) free( text.psz_string );
548 switch( i_type & VLC_VAR_TYPE )
551 menuitem = new wxMenuItemExt( menu, ++i_item_id,
552 wxU(text.psz_string ?
553 text.psz_string : psz_var),
554 wxT(""), wxITEM_NORMAL, strdup(psz_var),
555 p_object->i_object_id, val, i_type );
556 menu->Append( menuitem );
560 val.b_bool = !val.b_bool;
561 menuitem = new wxMenuItemExt( menu, ++i_item_id,
562 wxU(text.psz_string ?
563 text.psz_string : psz_var),
564 wxT(""), wxITEM_CHECK, strdup(psz_var),
565 p_object->i_object_id, val, i_type );
566 menu->Append( menuitem );
567 Check( i_item_id, val.b_bool ? FALSE : TRUE );
571 if( text.psz_string ) free( text.psz_string );
575 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
576 if( text.psz_string ) free( text.psz_string );
579 wxMenu *Menu::CreateChoicesMenu( char *psz_var, vlc_object_t *p_object,
582 vlc_value_t val, val_list, text_list;
585 /* Check the type of the object variable */
586 i_type = var_Type( p_object, psz_var );
588 /* Make sure we want to display the variable */
589 if( IsMenuEmpty( psz_var, p_object, b_root ) ) return NULL;
591 switch( i_type & VLC_VAR_TYPE )
595 case VLC_VAR_VARIABLE:
597 case VLC_VAR_INTEGER:
600 /* Variable doesn't exist or isn't handled */
604 if( var_Get( p_object, psz_var, &val ) < 0 )
609 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
610 &val_list, &text_list ) < 0 )
612 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
616 wxMenu *menu = new wxMenu;
617 for( i = 0; i < val_list.p_list->i_count; i++ )
619 vlc_value_t another_val;
620 wxMenuItemExt *menuitem;
622 switch( i_type & VLC_VAR_TYPE )
624 case VLC_VAR_VARIABLE:
625 menu->Append( MenuDummy_Event,
626 wxU(text_list.p_list->p_values[i].psz_string ?
627 text_list.p_list->p_values[i].psz_string :
628 val_list.p_list->p_values[i].psz_string),
630 val_list.p_list->p_values[i].psz_string,
631 p_object, FALSE ), wxT("") );
635 another_val.psz_string =
636 strdup(val_list.p_list->p_values[i].psz_string);
638 new wxMenuItemExt( menu, ++i_item_id,
639 wxU(text_list.p_list->p_values[i].psz_string ?
640 text_list.p_list->p_values[i].psz_string :
641 another_val.psz_string), wxT(""),
642 i_type & VLC_VAR_ISCOMMAND ?
643 wxITEM_NORMAL : wxITEM_RADIO,
645 p_object->i_object_id, another_val, i_type );
647 menu->Append( menuitem );
649 if( !(i_type & VLC_VAR_ISCOMMAND) &&
650 !strcmp( val.psz_string,
651 val_list.p_list->p_values[i].psz_string ) )
652 menu->Check( i_item_id, TRUE );
655 case VLC_VAR_INTEGER:
657 new wxMenuItemExt( menu, ++i_item_id,
658 text_list.p_list->p_values[i].psz_string ?
660 text_list.p_list->p_values[i].psz_string) :
661 wxString::Format(wxT("%d"),
662 val_list.p_list->p_values[i].i_int), wxT(""),
663 i_type & VLC_VAR_ISCOMMAND ?
664 wxITEM_NORMAL : wxITEM_RADIO,
666 p_object->i_object_id,
667 val_list.p_list->p_values[i], i_type );
669 menu->Append( menuitem );
671 if( !(i_type & VLC_VAR_ISCOMMAND) &&
672 val_list.p_list->p_values[i].i_int == val.i_int )
673 menu->Check( i_item_id, TRUE );
681 /* clean up everything */
682 if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
683 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
688 void Menu::OnShowDialog( wxCommandEvent& event )
690 if( p_intf->p_sys->pf_show_dialog )
694 switch( event.GetId() )
696 case OpenFileSimple_Event:
697 i_id = INTF_DIALOG_FILE_SIMPLE;
700 i_id = INTF_DIALOG_FILE;
703 i_id = INTF_DIALOG_DISC;
706 i_id = INTF_DIALOG_NET;
709 i_id = INTF_DIALOG_FILE;
714 p_intf->p_sys->pf_show_dialog( p_intf, i_id, 1, 0 );
718 /*****************************************************************************
719 * A small helper class which intercepts all popup menu events
720 *****************************************************************************/
721 MenuEvtHandler::MenuEvtHandler( intf_thread_t *_p_intf,
722 Interface *_p_main_interface )
724 /* Initializations */
726 p_main_interface = _p_main_interface;
729 MenuEvtHandler::~MenuEvtHandler()
733 void MenuEvtHandler::OnShowDialog( wxCommandEvent& event )
735 if( p_intf->p_sys->pf_show_dialog )
739 switch( event.GetId() )
741 case OpenFileSimple_Event:
742 i_id = INTF_DIALOG_FILE_SIMPLE;
745 i_id = INTF_DIALOG_FILE;
748 i_id = INTF_DIALOG_DISC;
751 i_id = INTF_DIALOG_NET;
754 i_id = INTF_DIALOG_FILE;
759 p_intf->p_sys->pf_show_dialog( p_intf, i_id, 1, 0 );
763 void MenuEvtHandler::OnMenuEvent( wxCommandEvent& event )
765 wxMenuItem *p_menuitem = NULL;
767 /* Check if this is an auto generated menu item */
768 if( event.GetId() < FirstAutoGenerated_Event )
774 if( !p_main_interface ||
775 (p_menuitem = p_main_interface->GetMenuBar()->FindItem(event.GetId()))
778 if( p_intf->p_sys->p_popup_menu )
781 p_intf->p_sys->p_popup_menu->FindItem( event.GetId() );
787 wxMenuItemExt *p_menuitemext = (wxMenuItemExt *)p_menuitem;
788 vlc_object_t *p_object;
790 p_object = (vlc_object_t *)vlc_object_get( p_intf,
791 p_menuitemext->i_object_id );
792 if( p_object == NULL ) return;
794 var_Set( p_object, p_menuitemext->psz_var, p_menuitemext->val );
796 vlc_object_release( p_object );
802 /*****************************************************************************
803 * A small helper class which encapsulate wxMenuitem with some other useful
805 *****************************************************************************/
806 wxMenuItemExt::wxMenuItemExt( wxMenu* parentMenu, int id, const wxString& text,
807 const wxString& helpString, wxItemKind kind,
808 char *_psz_var, int _i_object_id, vlc_value_t _val, int _i_val_type ):
809 wxMenuItem( parentMenu, id, text, helpString, kind )
811 /* Initializations */
813 i_val_type = _i_val_type;
814 i_object_id = _i_object_id;
818 wxMenuItemExt::~wxMenuItemExt()
820 if( psz_var ) free( psz_var );
821 if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
822 && val.psz_string ) free( val.psz_string );