1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: ClÃment Stenac <zorglub@videolan.org>
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
25 #include "dialogs_provider.hpp"
26 #include "input_manager.hpp"
30 #include <QActionGroup>
31 #include <QSignalMapper>
40 static QActionGroup *currentGroup;
41 static char ** pp_sds;
43 // Add static entries to menus
44 #define DP_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEDP, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEDP, SLOT( slot ) ); } }
45 #define MIM_SADD( text, help, icon, slot ) { if( strlen(icon) > 0 ) { QAction *action = menu->addAction( text, THEMIM, SLOT( slot ) ); action->setIcon(QIcon(icon));} else { menu->addAction( text, THEMIM, SLOT( slot ) ); } }
48 /*****************************************************************************
49 * Definitions of variables for the dynamic menus
50 *****************************************************************************/
51 #define PUSH_VAR( var ) varnames.push_back( var ); \
52 objects.push_back( p_object->i_object_id )
54 #define PUSH_SEPARATOR if( objects.size() != i_last_separator ) { \
55 objects.push_back( 0 ); varnames.push_back( "" ); \
56 i_last_separator = objects.size(); }
58 static int InputAutoMenuBuilder( vlc_object_t *p_object,
60 vector<const char *> &varnames )
62 PUSH_VAR( "bookmark");
64 PUSH_VAR ("chapter" );
65 PUSH_VAR( "program" );
66 PUSH_VAR( "navigation" );
67 PUSH_VAR( "dvd_menus" );
71 static int VideoAutoMenuBuilder( vlc_object_t *p_object,
73 vector<const char *> &varnames )
75 PUSH_VAR( "fullscreen" );
77 PUSH_VAR( "deinterlace" );
78 PUSH_VAR( "aspect-ratio" );
80 PUSH_VAR( "video-on-top" );
81 PUSH_VAR( "directx-wallpaper" );
82 PUSH_VAR( "video-snapshot" );
84 vlc_object_t *p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
87 if( p_dec_obj != NULL )
89 PUSH_VAR( "ffmpeg-pp-q" );
90 vlc_object_release( p_dec_obj );
95 static int AudioAutoMenuBuilder( vlc_object_t *p_object,
97 vector<const char *> &varnames )
99 PUSH_VAR( "audio-device" );
100 PUSH_VAR( "audio-channels" );
101 PUSH_VAR( "visual" );
102 PUSH_VAR( "equalizer" );
106 /*****************************************************************************
108 *****************************************************************************/
110 #define BAR_ADD( func, title ) { \
111 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); }
113 #define BAR_DADD( func, title, id ) { \
114 QMenu *menu = func; menu->setTitle( title ); bar->addMenu( menu ); \
115 MenuFunc *f = new MenuFunc( menu, id ); \
116 connect( menu, SIGNAL( aboutToShow() ), \
117 THEDP->menusUpdateMapper, SLOT(map()) ); \
118 THEDP->menusUpdateMapper->setMapping( menu, f ); }
120 void QVLCMenu::createMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
122 BAR_ADD( FileMenu(), qtr("File") );
123 BAR_ADD( ToolsMenu( p_intf ), qtr("Tools") );
124 BAR_DADD( VideoMenu( p_intf, NULL ), qtr("Video"), 1 );
125 BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
126 BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
128 // BAR_ADD( HelpMenu(), qtr("Help" ) );
131 void QVLCMenu::createPlMenuBar( QMenuBar *bar, intf_thread_t *p_intf )
133 QMenu *manageMenu = new QMenu();
134 manageMenu->setTitle( qtr("Operations") );
136 QMenu *subPlaylist = new QMenu();
137 subPlaylist->setTitle( qtr("Add to current playlist") );
138 subPlaylist->addAction( "&File...", THEDP,
139 SLOT( simplePLAppendDialog() ) );
140 subPlaylist->addAction( "&Advanced add...", THEDP,
141 SLOT( PLAppendDialog() ) );
142 manageMenu->addMenu( subPlaylist );
143 manageMenu->addSeparator();
145 QMenu *subML = new QMenu();
146 subML->setTitle( qtr("Add to Media library") );
147 subML->addAction( "&File...", THEDP,
148 SLOT( simpleMLAppendDialog() ) );
149 subML->addAction( "&Advanced add...", THEDP,
150 SLOT( MLAppendDialog() ) );
151 manageMenu->addMenu( subML );
152 manageMenu->addSeparator();
154 // manageMenu->addMenu( SDMenu( p_intf ) );
156 bar->addMenu( manageMenu );
159 QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
161 QMenu *menu = new QMenu();
162 menu->setTitle( qtr( "Services Discovery" ) );
163 playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
166 assert( p_playlist );
167 vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE,
170 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
172 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object ;
173 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
176 if( i_num ) pp_sds = (char **)calloc( i_num, sizeof(void *) );
177 for( int i_index = 0 ; i_index < p_list->i_count; i_index++ )
179 module_t * p_parser = (module_t *)p_list->p_values[i_index].p_object;
180 if( !strcmp( p_parser->psz_capability, "services_discovery" ) )
182 QAction *a = menu->addAction(
183 qfu( p_parser->psz_longname ?
184 p_parser->psz_longname :
185 ( p_parser->psz_shortname ?
186 p_parser->psz_shortname :
187 p_parser->psz_object_name ) ) );
188 a->setCheckable( true );
189 /* hack to handle submodules properly */
191 while( p_parser->pp_shortcuts[++i] != NULL );
193 if( playlist_IsServicesDiscoveryLoaded( p_playlist,
194 i>=0?p_parser->pp_shortcuts[i] : p_parser->psz_object_name ) )
196 a->setChecked( true );
198 pp_sds[i_num++] = i>=0? p_parser->pp_shortcuts[i] :
199 p_parser->psz_object_name;
202 vlc_list_release( p_list );
203 vlc_object_release( p_playlist );
207 QMenu *QVLCMenu::FileMenu()
209 QMenu *menu = new QMenu();
210 DP_SADD( qtr("Quick &Open File...") , "", "", simpleOpenDialog() );
211 DP_SADD( qtr("&Advanced Open..." ), "", "", openDialog() );
212 menu->addSeparator();
213 DP_SADD( qtr("Streaming..."), "", "", streamingDialog() );
214 menu->addSeparator();
215 DP_SADD( qtr("&Quit") , "", "", quit() );
219 QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, bool with_intf )
221 QMenu *menu = new QMenu();
224 QMenu *intfmenu = InterfacesMenu( p_intf, NULL );
225 intfmenu->setTitle( qtr("Interfaces" ) );
226 menu->addMenu( intfmenu );
227 /** \todo ADD EXT GUI HERE */
228 menu->addSeparator();
230 DP_SADD( qtr("Messages" ), "", "", messagesDialog() );
231 DP_SADD( qtr("Information") , "", "", streaminfoDialog() );
232 DP_SADD( qtr("Bookmarks"), "", "", bookmarksDialog() );
233 menu->addSeparator();
234 DP_SADD( qtr("Preferences"), "", "", prefsDialog() );
238 QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
241 vector<const char *> varnames;
242 /** \todo add "switch to XXX" */
243 varnames.push_back( "intf-add" );
244 objects.push_back( p_intf->i_object_id );
246 QMenu *menu = Populate( p_intf, current, varnames, objects );
247 connect( menu, SIGNAL( aboutToShow() ),
248 THEDP->menusUpdateMapper, SLOT(map()) );
249 THEDP->menusUpdateMapper->setMapping( menu, 4 );
254 QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
257 vector<const char *> varnames;
259 vlc_object_t *p_object = (vlc_object_t *)vlc_object_find( p_intf,
260 VLC_OBJECT_INPUT, FIND_ANYWHERE );
261 if( p_object != NULL )
263 PUSH_VAR( "audio-es" );
264 vlc_object_release( p_object );
267 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
271 AudioAutoMenuBuilder( p_object, objects, varnames );
272 vlc_object_release( p_object );
274 return Populate( p_intf, current, varnames, objects );
278 QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
280 vlc_object_t *p_object;
282 vector<const char *> varnames;
284 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
286 if( p_object != NULL )
288 PUSH_VAR( "video-es" );
289 PUSH_VAR( "spu-es" );
290 vlc_object_release( p_object );
293 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
295 if( p_object != NULL )
297 VideoAutoMenuBuilder( p_object, objects, varnames );
298 vlc_object_release( p_object );
300 return Populate( p_intf, current, varnames, objects );
303 QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *current )
305 vlc_object_t *p_object;
307 vector<const char *> varnames;
310 p_object = (vlc_object_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
312 if( p_object != NULL )
314 InputAutoMenuBuilder( p_object, objects, varnames );
315 PUSH_VAR( "prev-title"); PUSH_VAR ( "next-title" );
316 PUSH_VAR( "prev-chapter"); PUSH_VAR( "next-chapter" );
317 vlc_object_release( p_object );
319 return Populate( p_intf, current, varnames, objects );
323 /*****************************************************************************
325 *****************************************************************************/
326 #define POPUP_BOILERPLATE \
327 unsigned int i_last_separator = 0; \
328 vector<int> objects; \
329 vector<const char *> varnames; \
330 input_thread_t *p_input = THEMIM->getInput();
332 #define CREATE_POPUP \
333 QMenu *menu = new QMenu(); \
334 Populate( p_intf, menu, varnames, objects ); \
335 p_intf->p_sys->p_popup_menu = menu; \
336 menu->popup( QCursor::pos() ); \
337 p_intf->p_sys->p_popup_menu = NULL; \
338 i_last_separator = 0;
340 #define POPUP_STATIC_ENTRIES \
342 MIM_SADD( qtr("Stop"), "", "", stop() ); \
343 MIM_SADD( qtr("Previous"), "", "", prev() ); \
344 MIM_SADD( qtr("Next"), "", "", next() ); \
347 var_Get( p_input, "state", &val ); \
348 if( val.i_int == PAUSE_S ) \
349 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
351 MIM_SADD( qtr("Pause"), "", "", togglePlayPause() ) \
353 else if( THEPL->i_size && THEPL->i_enabled ) \
354 MIM_SADD( qtr("Play"), "", "", togglePlayPause() ) \
356 QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); \
357 intfmenu->setTitle( qtr("Interfaces" ) ); \
358 menu->addMenu( intfmenu ); \
360 QMenu *toolsmenu = ToolsMenu( p_intf, false ); \
361 toolsmenu->setTitle( qtr("Tools" ) ); \
362 menu->addMenu( toolsmenu ); \
364 void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
369 vlc_object_yield( p_input );
370 varnames.push_back( "video-es" );
371 objects.push_back( p_input->i_object_id );
372 varnames.push_back( "spu-es" );
373 objects.push_back( p_input->i_object_id );
374 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
375 VLC_OBJECT_VOUT, FIND_CHILD );
378 VideoAutoMenuBuilder( p_vout, objects, varnames );
379 vlc_object_release( p_vout );
381 vlc_object_release( p_input );
386 void QVLCMenu::AudioPopupMenu( intf_thread_t *p_intf )
391 vlc_object_yield( p_input );
392 varnames.push_back( "audio-es" );
393 objects.push_back( p_input->i_object_id );
394 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
395 VLC_OBJECT_AOUT, FIND_ANYWHERE );
398 AudioAutoMenuBuilder( p_aout, objects, varnames );
399 vlc_object_release( p_aout );
401 vlc_object_release( p_input );
406 /* Navigation stuff, and general */
407 void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
412 vlc_object_yield( p_input );
413 varnames.push_back( "audio-es" );
414 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
418 QMenu *menu = new QMenu();
419 Populate( p_intf, menu, varnames, objects );
420 menu->addSeparator();
421 POPUP_STATIC_ENTRIES;
423 p_intf->p_sys->p_popup_menu = menu;
424 menu->popup( QCursor::pos() );
425 p_intf->p_sys->p_popup_menu = NULL;
428 void QVLCMenu::PopupMenu( intf_thread_t *p_intf )
433 vlc_object_yield( p_input );
434 InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
438 varnames.push_back( "video-es" );
439 objects.push_back( p_input->i_object_id );
440 varnames.push_back( "spu-es" );
441 objects.push_back( p_input->i_object_id );
442 vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
443 VLC_OBJECT_VOUT, FIND_CHILD );
446 VideoAutoMenuBuilder( p_vout, objects, varnames );
447 vlc_object_release( p_vout );
451 varnames.push_back( "audio-es" );
452 objects.push_back( p_input->i_object_id );
453 vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
454 VLC_OBJECT_AOUT, FIND_ANYWHERE );
457 AudioAutoMenuBuilder( p_aout, objects, varnames );
458 vlc_object_release( p_aout );
462 QMenu *menu = new QMenu();
463 Populate( p_intf, menu, varnames, objects );
464 menu->addSeparator();
465 POPUP_STATIC_ENTRIES;
467 p_intf->p_sys->p_popup_menu = menu;
468 menu->popup( QCursor::pos() );
469 p_intf->p_sys->p_popup_menu = NULL;
473 #undef PUSH_SEPARATOR
475 /*************************************************************************
476 * Builders for automenus
477 *************************************************************************/
478 QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
479 vector< const char *> & varnames,
480 vector<int> & objects, bool append )
482 QMenu *menu = current;
490 vlc_object_t *p_object;
491 vlc_bool_t b_section_empty = VLC_FALSE;
494 #define APPEND_EMPTY { QAction *action = menu->addAction( qtr("Empty" ) ); \
495 action->setEnabled( false ); }
497 for( i = 0; i < (int)objects.size() ; i++ )
499 if( !varnames[i] || !*varnames[i] )
501 if( b_section_empty )
503 menu->addSeparator();
504 b_section_empty = VLC_TRUE;
508 if( objects[i] == 0 )
510 /// \bug What is this ?
511 // Append( menu, varnames[i], NULL );
512 b_section_empty = VLC_FALSE;
516 p_object = (vlc_object_t *)vlc_object_get( p_intf,
518 if( p_object == NULL ) continue;
520 b_section_empty = VLC_FALSE;
521 /* Ugly specific stuff */
522 if( strstr(varnames[i], "intf-add" ) )
523 CreateItem( menu, varnames[i], p_object, false );
525 CreateItem( menu, varnames[i], p_object, true );
526 vlc_object_release( p_object );
529 /* Special case for empty menus */
530 if( menu->actions().size() == 0 || b_section_empty )
536 /*****************************************************************************
538 *****************************************************************************/
540 static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object,
543 vlc_value_t val, val_list;
544 int i_type, i_result, i;
546 /* Check the type of the object variable */
547 i_type = var_Type( p_object, psz_var );
549 /* Check if we want to display the variable */
550 if( !(i_type & VLC_VAR_HASCHOICE) ) return FALSE;
552 var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
553 if( val.i_int == 0 ) return TRUE;
555 if( (i_type & VLC_VAR_TYPE) != VLC_VAR_VARIABLE )
557 /* Very evil hack ! intf-switch can have only one value */
558 if( !strcmp( psz_var, "intf-switch" ) ) return FALSE;
559 if( val.i_int == 1 && b_root ) return TRUE;
563 /* Check children variables in case of VLC_VAR_VARIABLE */
564 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST, &val_list, NULL ) < 0 )
569 for( i = 0, i_result = TRUE; i < val_list.p_list->i_count; i++ )
571 if( !IsMenuEmpty( val_list.p_list->p_values[i].psz_string,
579 /* clean up everything */
580 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, NULL );
585 void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
586 vlc_object_t *p_object, bool b_submenu )
588 vlc_value_t val, text;
591 /* Check the type of the object variable */
592 i_type = var_Type( p_object, psz_var );
594 switch( i_type & VLC_VAR_TYPE )
598 case VLC_VAR_VARIABLE:
600 case VLC_VAR_INTEGER:
604 /* Variable doesn't exist or isn't handled */
608 /* Make sure we want to display the variable */
609 if( IsMenuEmpty( psz_var, p_object ) ) return;
611 /* Get the descriptive name of the variable */
612 var_Change( p_object, psz_var, VLC_VAR_GETTEXT, &text, NULL );
614 if( i_type & VLC_VAR_HASCHOICE )
616 /* Append choices menu */
619 QMenu *submenu = new QMenu();
620 submenu->setTitle( qfu( text.psz_string ?
621 text.psz_string : psz_var ) );
622 if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0)
623 menu->addMenu( submenu );
626 CreateChoicesMenu( menu, psz_var, p_object, true );
627 FREENULL( text.psz_string );
631 #define TEXT_OR_VAR qfu ( text.psz_string ? text.psz_string : psz_var )
633 switch( i_type & VLC_VAR_TYPE )
636 var_Get( p_object, psz_var, &val );
637 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_NORMAL,
638 p_object->i_object_id, val, i_type );
642 var_Get( p_object, psz_var, &val );
643 val.b_bool = !val.b_bool;
644 CreateAndConnect( menu, psz_var, TEXT_OR_VAR, "", ITEM_CHECK,
645 p_object->i_object_id, val, i_type, val.b_bool );
648 FREENULL( text.psz_string );
652 int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
653 vlc_object_t *p_object, bool b_root )
655 vlc_value_t val, val_list, text_list;
658 /* Check the type of the object variable */
659 i_type = var_Type( p_object, psz_var );
661 /* Make sure we want to display the variable */
662 if( IsMenuEmpty( psz_var, p_object, b_root ) ) return VLC_EGENERIC;
664 switch( i_type & VLC_VAR_TYPE )
668 case VLC_VAR_VARIABLE:
670 case VLC_VAR_INTEGER:
674 /* Variable doesn't exist or isn't handled */
678 if( var_Change( p_object, psz_var, VLC_VAR_GETLIST,
679 &val_list, &text_list ) < 0 )
683 #define NORMAL_OR_RADIO i_type & VLC_VAR_ISCOMMAND ? ITEM_NORMAL: ITEM_RADIO
684 #define NOTCOMMAND !(i_type & VLC_VAR_ISCOMMAND)
685 #define CURVAL val_list.p_list->p_values[i]
686 #define CURTEXT text_list.p_list->p_values[i].psz_string
688 for( i = 0; i < val_list.p_list->i_count; i++ )
690 vlc_value_t another_val;
692 QMenu *subsubmenu = new QMenu();
694 switch( i_type & VLC_VAR_TYPE )
696 case VLC_VAR_VARIABLE:
697 CreateChoicesMenu( subsubmenu, CURVAL.psz_string, p_object, false );
698 subsubmenu->setTitle( qfu( CURTEXT ? CURTEXT :CURVAL.psz_string ) );
699 submenu->addMenu( subsubmenu );
703 var_Get( p_object, psz_var, &val );
704 another_val.psz_string = strdup( CURVAL.psz_string );
706 menutext = qfu( CURTEXT ? CURTEXT : another_val.psz_string );
707 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
708 p_object->i_object_id, another_val, i_type,
709 NOTCOMMAND && val.psz_string &&
710 !strcmp( val.psz_string, CURVAL.psz_string ) );
712 if( val.psz_string ) free( val.psz_string );
715 case VLC_VAR_INTEGER:
716 var_Get( p_object, psz_var, &val );
717 if( CURTEXT ) menutext = qfu( CURTEXT );
718 else menutext.sprintf( "%d", CURVAL.i_int);
719 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
720 p_object->i_object_id, CURVAL, i_type,
721 NOTCOMMAND && CURVAL.i_int == val.i_int );
725 var_Get( p_object, psz_var, &val );
726 if( CURTEXT ) menutext = qfu( CURTEXT );
727 else menutext.sprintf( "%.2f", CURVAL.f_float );
728 CreateAndConnect( submenu, psz_var, menutext, "", NORMAL_OR_RADIO,
729 p_object->i_object_id, CURVAL, i_type,
730 NOTCOMMAND && CURVAL.f_float == val.f_float );
738 /* clean up everything */
739 var_Change( p_object, psz_var, VLC_VAR_FREELIST, &val_list, &text_list );
741 #undef NORMAL_OR_RADIO
748 void QVLCMenu::CreateAndConnect( QMenu *menu, const char *psz_var,
749 QString text, QString help,
750 int i_item_type, int i_object_id,
751 vlc_value_t val, int i_val_type,
754 QAction *action = new QAction( text, menu );
755 action->setText( text );
756 action->setToolTip( help );
758 if( i_item_type == ITEM_CHECK )
760 action->setCheckable( true );
763 else if( i_item_type == ITEM_RADIO )
765 action->setCheckable( true );
767 currentGroup = new QActionGroup(menu);
768 currentGroup->addAction( action );
772 if( checked ) action->setChecked( true );
774 MenuItemData *itemData = new MenuItemData( i_object_id, i_val_type,
776 connect( action, SIGNAL(triggered()), THEDP->menusMapper, SLOT(map()) );
777 THEDP->menusMapper->setMapping( action, itemData );
778 menu->addAction( action );
781 void QVLCMenu::DoAction( intf_thread_t *p_intf, QObject *data )
783 MenuItemData *itemData = qobject_cast<MenuItemData *>(data);
784 vlc_object_t *p_object = (vlc_object_t *)vlc_object_get( p_intf,
785 itemData->i_object_id );
786 if( p_object == NULL ) return;
788 var_Set( p_object, itemData->psz_var, itemData->val );
789 vlc_object_release( p_object );