1 /*****************************************************************************
\r
2 * menu.cpp: functions to handle menu items
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002 VideoLAN
\r
6 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
26 #include <vlc/vlc.h>
\r
27 #include <vlc/intf.h>
\r
30 #include "win32_common.h"
\r
33 /****************************************************************************
\r
35 ****************************************************************************/
\r
36 extern intf_thread_t *p_intfGlobal;
\r
38 static TMenuItem *Index2Item( TMenuItem *, int, bool );
\r
39 static int Item2Index( TMenuItem *, TMenuItem * );
\r
40 static void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int );
\r
41 static void __fastcall ProgramChange( TMenuItem *, TMenuItem * );
\r
43 static void __fastcall RadioMenu( TMenuItem *, AnsiString,
\r
44 int, int, TNotifyEvent );
\r
45 static void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
\r
47 static void __fastcall LanguageMenu( TMenuItem *t, es_descriptor_t *,
\r
48 int, TNotifyEvent );
\r
49 static void __fastcall NavigationMenu( TMenuItem *, TNotifyEvent );
\r
52 static TMenuItem *Index2Item( TMenuItem *Root, int i_index, bool SingleColumn )
\r
54 if( SingleColumn || ( i_index < 20 ) )
\r
56 return Root->Items[i_index];
\r
60 return Root->Items[i_index / 10]->Items[i_index % 10];
\r
64 static int Item2Index( TMenuItem *Root, TMenuItem *Item )
\r
66 if( Item->Parent == Root )
\r
68 return Item->MenuIndex;
\r
72 return( 10 * Item->Parent->MenuIndex + Item->MenuIndex );
\r
77 /****************************************************************************
\r
78 * LangChange: change audio or subtitles languages
\r
79 ****************************************************************************
\r
80 * Toggle the language, and update the selected menuitems.
\r
81 ****************************************************************************/
\r
82 static void __fastcall LangChange( TMenuItem *RootCurrent, TMenuItem *Item,
\r
83 TMenuItem *RootOther, int i_cat )
\r
85 intf_thread_t * p_intf = p_intfGlobal;
\r
86 es_descriptor_t * p_es;
\r
87 es_descriptor_t * p_es_old;
\r
91 /* find the selected ES */
\r
94 /* find selected menu item */
\r
95 i_index = Item2Index( RootCurrent, Item ) - 1;
\r
98 /* 'None' was selected */
\r
103 vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
104 p_es = p_intfGlobal->p_sys->p_input->stream.pp_es[i_es];
\r
105 vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
108 /* find the current ES */
\r
109 if( i_cat == AUDIO_ES )
\r
111 p_es_old = p_intf->p_sys->p_audio_es_old;
\r
112 p_intf->p_sys->p_audio_es_old = p_es;
\r
116 p_es_old = p_intf->p_sys->p_spu_es_old;
\r
117 p_intf->p_sys->p_spu_es_old = p_es;
\r
120 /* exchange them */
\r
121 input_ToggleES( p_intfGlobal->p_sys->p_input, p_es_old, false );
\r
122 input_ToggleES( p_intfGlobal->p_sys->p_input, p_es, true );
\r
124 Item->Checked = true;
\r
125 Index2Item( RootOther, i_index + 1, true )->Checked = true;
\r
129 /****************************************************************************
\r
130 * ProgramChange: change the program
\r
131 ****************************************************************************
\r
132 * Toggle the program, and update the selected menuitems.
\r
133 ****************************************************************************/
\r
134 static void __fastcall ProgramChange( TMenuItem *Item, TMenuItem *RootOther )
\r
136 intf_thread_t * p_intf = p_intfGlobal;
\r
137 int i_program = Item->Tag;
\r
139 /* toggle the program */
\r
140 input_ChangeProgram( p_intfGlobal->p_sys->p_input, (u16)i_program );
\r
142 /* check selected menu items */
\r
143 Item->Checked = true;
\r
144 Index2Item( RootOther, i_program - 1, true )->Checked = true;
\r
146 /* update audio/subtitles menus */
\r
147 p_intf->p_sys->b_audio_update = 1;
\r
148 p_intf->p_sys->b_spu_update = 1;
\r
149 vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
150 SetupMenus( p_intf );
\r
151 vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
152 p_intf->p_sys->b_audio_update = 0;
\r
153 p_intf->p_sys->b_spu_update = 0;
\r
155 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
\r
159 /****************************************************************************
\r
160 * TMainFrameDlg::*Click: callbacks for the menuitems
\r
161 ****************************************************************************
\r
162 * These functions need to be in a class, or we won't be able to pass them
\r
163 * as arguments (since TNotifyEvent uses __closure)
\r
164 ****************************************************************************/
\r
170 void __fastcall TMainFrameDlg::MenuAudioClick( TObject *Sender )
\r
172 LangChange( MenuAudio, (TMenuItem *)Sender, PopupAudio, AUDIO_ES );
\r
175 void __fastcall TMainFrameDlg::PopupAudioClick( TObject *Sender )
\r
177 LangChange( PopupAudio, (TMenuItem *)Sender, MenuAudio, AUDIO_ES );
\r
184 void __fastcall TMainFrameDlg::MenuSubtitleClick( TObject *Sender )
\r
186 LangChange( MenuSubtitles, (TMenuItem *)Sender, PopupSubtitles, SPU_ES );
\r
189 void __fastcall TMainFrameDlg::PopupSubtitleClick( TObject *Sender )
\r
191 LangChange( PopupSubtitles, (TMenuItem *)Sender, MenuSubtitles, SPU_ES );
\r
198 void __fastcall TMainFrameDlg::MenuProgramClick( TObject *Sender )
\r
200 ProgramChange( (TMenuItem *)Sender, PopupProgram );
\r
203 void __fastcall TMainFrameDlg::PopupProgramClick( TObject *Sender )
\r
205 ProgramChange( (TMenuItem *)Sender, MenuProgram );
\r
212 void __fastcall TMainFrameDlg::PopupNavigationClick( TObject *Sender )
\r
214 TMenuItem * Item = (TMenuItem *)Sender;
\r
215 TMenuItem * ItemTitle;
\r
216 input_area_t * p_area;
\r
217 int i_title = DATA2TITLE( Item->Tag );
\r
218 int i_chapter = DATA2CHAPTER( Item->Tag );
\r
220 p_area = p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title];
\r
221 p_area->i_part = i_chapter;
\r
223 input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );
\r
225 Item->Checked = true;
\r
226 ItemTitle = Index2Item( MenuTitle, i_title - 1, false );
\r
227 if( ItemTitle->Checked )
\r
229 /* same title, new chapter */
\r
230 Index2Item( MenuChapter, i_chapter - 1, false )->Checked = true;
\r
234 /* new title => we must rebuild the chapter menu */
\r
235 vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
236 RadioMenu( MenuChapter, "Chapter",
\r
237 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,
\r
238 i_chapter, MenuChapterClick );
\r
239 vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
242 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
\r
249 void __fastcall TMainFrameDlg::MenuTitleClick( TObject *Sender )
\r
251 TMenuItem * Item = (TMenuItem *)Sender;
\r
252 TMenuItem * ItemTitle;
\r
253 int i_title = Item->Tag;
\r
255 input_ChangeArea( p_intfGlobal->p_sys->p_input,
\r
256 p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title] );
\r
257 Item->Checked = true;
\r
258 ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );
\r
259 Index2Item( ItemTitle, 0, false )->Checked = true;
\r
261 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
\r
268 void __fastcall TMainFrameDlg::MenuChapterClick( TObject *Sender )
\r
270 TMenuItem * Item = (TMenuItem *)Sender;
\r
271 TMenuItem * ItemTitle;
\r
272 input_area_t * p_area;
\r
274 int i_chapter = Item->Tag;
\r
276 p_area = p_intfGlobal->p_sys->p_input->stream.p_selected_area;
\r
277 p_area->i_part = i_chapter;
\r
279 input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );
\r
281 i_title = p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id;
\r
282 ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );
\r
283 Index2Item( ItemTitle, i_chapter - 1, false )->Checked = true;
\r
285 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
\r
289 /****************************************************************************
\r
290 * Functions to generate menus
\r
291 ****************************************************************************/
\r
293 /*****************************************************************************
\r
294 * RadioMenu: update interactive menus of the interface
\r
295 *****************************************************************************
\r
296 * Sets up menus with information from input
\r
297 * Warning: since this function is designed to be called by management
\r
298 * function, the interface lock has to be taken
\r
299 *****************************************************************************/
\r
300 static void __fastcall RadioMenu( TMenuItem * Root, AnsiString ItemName,
\r
301 int i_nb, int i_selected,
\r
302 TNotifyEvent MenuItemClick )
\r
304 TMenuItem * ItemGroup;
\r
306 TMenuItem * ItemActive;
\r
310 /* remove previous menu */
\r
311 Root->Enabled = false;
\r
316 for( i_item = 0; i_item < i_nb; i_item++ )
\r
318 /* we group titles/chapters in packets of ten for small screens */
\r
319 if( ( i_item % 10 == 0 ) && ( i_nb > 20 ) )
\r
323 Root->Add( ItemGroup );
\r
326 Name.sprintf( "%ss %d to %d", ItemName, i_item + 1, i_item + 10 );
\r
327 ItemGroup = new TMenuItem( Root );
\r
328 ItemGroup->Hint = Name;
\r
330 /* set the accelerator character */
\r
331 Name.Insert( "&", Name.Length() - 1 );
\r
332 ItemGroup->Caption = Name;
\r
335 Name.sprintf( "%s %d", ItemName, i_item + 1 );
\r
336 Item = new TMenuItem( Root );
\r
337 Item->RadioItem = true;
\r
340 /* set the accelerator character */
\r
341 Name.Insert( "&", Name.Length() );
\r
342 Item->Caption = Name;
\r
344 /* FIXME: temporary hack to save i_item with the Item
\r
345 * It will be used in the callback. */
\r
346 Item->Tag = i_item + 1;
\r
348 if( i_selected == i_item + 1 )
\r
353 /* setup signal handling */
\r
354 Item->OnClick = MenuItemClick;
\r
358 ItemGroup->Add( Item );
\r
366 // if( ( i_nb > 20 ) && ( i_item % 10 ) ) ?
\r
369 Root->Add( ItemGroup );
\r
372 /* check currently selected chapter */
\r
373 if( ItemActive != NULL )
\r
375 ItemActive->Checked = true;
\r
378 /* be sure that menu is enabled, if there are several items */
\r
381 Root->Enabled = true;
\r
386 /*****************************************************************************
\r
387 * ProgramMenu: update the programs menu of the interface
\r
388 *****************************************************************************
\r
389 * Builds the program menu according to what have been found in the PAT
\r
390 * by the input. Useful for multi-programs streams such as DVB ones.
\r
391 *****************************************************************************/
\r
392 static void __fastcall ProgramMenu( TMenuItem * Root,
\r
393 pgrm_descriptor_t * p_pgrm,
\r
394 TNotifyEvent MenuItemClick )
\r
397 TMenuItem * ItemActive;
\r
401 /* remove previous menu */
\r
403 Root->Enabled = false;
\r
407 /* create a set of program buttons and append them to the container */
\r
408 for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_pgrm_number; i++ )
\r
410 Name.sprintf( "id %d",
\r
411 p_intfGlobal->p_sys->p_input->stream.pp_programs[i]->i_number );
\r
413 Item = new TMenuItem( Root );
\r
414 Item->Caption = Name;
\r
416 Item->RadioItem = true;
\r
417 Item->OnClick = MenuItemClick;
\r
419 /* FIXME: temporary hack to save the program id with the Item
\r
420 * It will be used in the callback. */
\r
423 if( p_pgrm == p_intfGlobal->p_sys->p_input->stream.pp_programs[i] )
\r
425 /* don't lose Item when we append into menu */
\r
429 /* Add the item to the submenu */
\r
433 /* check currently selected program */
\r
434 if( ItemActive != NULL )
\r
436 ItemActive->Checked = true;
\r
439 /* be sure that menu is enabled if more than 1 program */
\r
440 if( p_intfGlobal->p_sys->p_input->stream.i_pgrm_number > 1 )
\r
442 Root->Enabled = true;
\r
447 /*****************************************************************************
\r
448 * LanguageMenus: update interactive menus of the interface
\r
449 *****************************************************************************
\r
450 * Sets up menus with information from input:
\r
453 * Warning: since this function is designed to be called by management
\r
454 * function, the interface lock has to be taken
\r
455 *****************************************************************************/
\r
456 static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
\r
457 int i_cat, TNotifyEvent MenuItemClick )
\r
459 TMenuItem * Separator;
\r
461 TMenuItem * ItemActive;
\r
466 /* remove previous menu */
\r
468 Root->Enabled = false;
\r
470 /* special case for "off" item */
\r
472 Item = new TMenuItem( Root );
\r
473 Item->RadioItem = true;
\r
475 Item->Caption = Name;
\r
476 Item->OnClick = MenuItemClick;
\r
480 /* separator item */
\r
481 Separator = new TMenuItem( Root );
\r
482 Separator->Caption = "-";
\r
483 Root->Add( Separator );
\r
488 vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
490 #define ES p_intfGlobal->p_sys->p_input->stream.pp_es[i]
\r
491 /* create a set of language buttons and append them to the Root */
\r
492 for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_es_number; i++ )
\r
494 if( ( ES->i_cat == i_cat ) &&
\r
497 p_intfGlobal->p_sys->p_input->stream.p_selected_program ) )
\r
500 Name = p_intfGlobal->p_sys->p_input->stream.pp_es[i]->psz_desc;
\r
501 if( Name.IsEmpty() )
\r
503 Name.sprintf( "Language %d", i_item );
\r
506 Item = new TMenuItem( Root );
\r
507 Item->RadioItem = true;
\r
509 Item->Caption = Name;
\r
512 if( p_es == p_intfGlobal->p_sys->p_input->stream.pp_es[i] )
\r
514 /* don't lose Item when we append into menu */
\r
518 /* setup signal hanling */
\r
519 Item->OnClick = MenuItemClick;
\r
525 vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
527 /* check currently selected item */
\r
528 if( ItemActive != NULL )
\r
530 ItemActive->Checked = true;
\r
533 /* be sure that menu is enabled if non empty */
\r
536 Root->Enabled = true;
\r
541 /*****************************************************************************
\r
542 * NavigationMenu: sets menus for titles and chapters selection
\r
543 *****************************************************************************
\r
544 * Generates two types of menus:
\r
545 * -simple list of titles
\r
546 * -cascaded lists of chapters for each title
\r
547 *****************************************************************************/
\r
548 static void __fastcall NavigationMenu( TMenuItem * Root,
\r
549 TNotifyEvent MenuItemClick )
\r
551 TMenuItem * TitleGroup;
\r
552 TMenuItem * TitleItem;
\r
553 TMenuItem * ItemActive;
\r
554 TMenuItem * ChapterGroup;
\r
555 TMenuItem * ChapterItem;
\r
563 /* remove previous menu */
\r
564 Root->Enabled = false;
\r
568 i_title_nb = p_intfGlobal->p_sys->p_input->stream.i_area_nb;
\r
570 /* loop on titles */
\r
571 for( i_title = 1; i_title < i_title_nb; i_title++ )
\r
573 /* we group titles in packets of ten for small screens */
\r
574 if( ( i_title % 10 == 1 ) && ( i_title_nb > 20 ) )
\r
578 Root->Add( TitleGroup );
\r
581 Name.sprintf( "%d - %d", i_title, i_title + 9 );
\r
582 TitleGroup = new TMenuItem( Root );
\r
583 TitleGroup->RadioItem = true;
\r
584 TitleGroup->Hint = Name;
\r
585 TitleGroup->Caption = Name;
\r
588 Name.sprintf( "Title %d (%d)", i_title,
\r
589 p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb );
\r
592 TitleItem = new TMenuItem( Root );
\r
593 TitleItem->RadioItem = true;
\r
594 TitleItem->Hint = Name;
\r
595 TitleItem->Caption = Name;
\r
598 p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb;
\r
600 /* loop on chapters */
\r
601 for( i_chapter = 0; i_chapter < i_chapter_nb; i_chapter++ )
\r
603 /* we group chapters in packets of ten for small screens */
\r
604 if( ( i_chapter % 10 == 0 ) && ( i_chapter_nb > 20 ) )
\r
606 if( i_chapter != 0 )
\r
608 TitleItem->Add( ChapterGroup );
\r
611 Name.sprintf( "%d - %d", i_chapter + 1, i_chapter + 10 );
\r
612 ChapterGroup = new TMenuItem( TitleItem );
\r
613 ChapterGroup->RadioItem = true;
\r
614 ChapterGroup->Hint = Name;
\r
615 ChapterGroup->Caption = Name;
\r
618 Name.sprintf( "Chapter %d", i_chapter + 1 );
\r
620 ChapterItem = new TMenuItem( TitleItem );
\r
621 ChapterItem->RadioItem = true;
\r
622 ChapterItem->Hint = Name;
\r
623 ChapterItem->Caption = Name;
\r
625 /* FIXME: temporary hack to save i_title and i_chapter with
\r
626 * ChapterItem, since we will need them in the callback */
\r
627 ChapterItem->Tag = (int)POS2DATA( i_title, i_chapter + 1 );
\r
629 #define p_area p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]
\r
631 p_intfGlobal->p_sys->p_input->stream.p_selected_area ) &&
\r
632 ( p_area->i_part == i_chapter + 1 ) )
\r
634 ItemActive = ChapterItem;
\r
638 /* setup signal hanling */
\r
639 ChapterItem->OnClick = MenuItemClick;
\r
641 if( i_chapter_nb > 20 )
\r
643 ChapterGroup->Add( ChapterItem );
\r
647 TitleItem->Add( ChapterItem );
\r
651 if( i_chapter_nb > 20 )
\r
653 TitleItem->Add( ChapterGroup );
\r
656 if( p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb
\r
659 /* be sure that menu is sensitive */
\r
660 Root->Enabled = true;
\r
664 if( i_title_nb > 20 )
\r
666 TitleGroup->Add( TitleItem );
\r
670 Root->Add( TitleItem );
\r
674 if( i_title_nb > 20 )
\r
676 Root->Add( TitleGroup );
\r
679 /* Default selected chapter */
\r
680 if( ItemActive != NULL )
\r
682 ItemActive->Checked = true;
\r
685 /* be sure that menu is sensitive */
\r
686 Root->Enabled = true;
\r
690 /*****************************************************************************
\r
691 * SetupMenus: function that generates title/chapter/audio/subpic
\r
692 * menus with help from preceding functions
\r
693 *****************************************************************************/
\r
694 int __fastcall SetupMenus( intf_thread_t * p_intf )
\r
696 TMainFrameDlg * p_window = p_intf->p_sys->p_window;
\r
697 es_descriptor_t * p_audio_es;
\r
698 es_descriptor_t * p_spu_es;
\r
701 p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
\r
702 p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update |
\r
703 p_intf->p_sys->b_program_update;
\r
704 p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update |
\r
705 p_intf->p_sys->b_program_update;
\r
707 if( p_intf->p_sys->b_program_update )
\r
709 pgrm_descriptor_t * p_pgrm;
\r
711 if( p_intfGlobal->p_sys->p_input->stream.p_new_program )
\r
713 p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_new_program;
\r
717 p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_selected_program;
\r
720 ProgramMenu( p_window->MenuProgram, p_pgrm,
\r
721 p_window->MenuProgramClick );
\r
722 ProgramMenu( p_window->PopupProgram, p_pgrm,
\r
723 p_window->PopupProgramClick );
\r
725 p_intf->p_sys->b_program_update = 0;
\r
728 if( p_intf->p_sys->b_title_update )
\r
730 RadioMenu( p_window->MenuTitle, "Title",
\r
732 p_intfGlobal->p_sys->p_input->stream.i_area_nb - 1,
\r
733 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id,
\r
734 p_window->MenuTitleClick );
\r
736 AnsiString CurrentTitle;
\r
737 CurrentTitle.sprintf( "%d",
\r
738 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id );
\r
739 p_window->LabelTitleCurrent->Caption = CurrentTitle;
\r
741 p_intf->p_sys->b_title_update = 0;
\r
744 if( p_intf->p_sys->b_chapter_update )
\r
746 RadioMenu( p_window->MenuChapter, "Chapter",
\r
747 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,
\r
748 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part,
\r
749 p_window->MenuChapterClick );
\r
751 NavigationMenu( p_window->PopupNavigation,
\r
752 p_window->PopupNavigationClick );
\r
754 AnsiString CurrentChapter;
\r
755 CurrentChapter.sprintf( "%d",
\r
756 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part );
\r
757 p_window->LabelChapterCurrent->Caption = CurrentChapter;
\r
759 p_intf->p_sys->i_part =
\r
760 p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part;
\r
762 p_intf->p_sys->b_chapter_update = 0;
\r
765 /* look for selected ES */
\r
769 for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_selected_es_number; i++ )
\r
771 if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat
\r
774 p_audio_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];
\r
775 p_intfGlobal->p_sys->p_audio_es_old = p_audio_es;
\r
778 if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat
\r
781 p_spu_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];
\r
782 p_intfGlobal->p_sys->p_spu_es_old = p_spu_es;
\r
786 vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r
789 if( p_intf->p_sys->b_audio_update )
\r
791 LanguageMenu( p_window->MenuAudio, p_audio_es, AUDIO_ES,
\r
792 p_window->MenuAudioClick );
\r
793 LanguageMenu( p_window->PopupAudio, p_audio_es, AUDIO_ES,
\r
794 p_window->PopupAudioClick );
\r
796 p_intf->p_sys->b_audio_update = 0;
\r
799 /* sub picture menus */
\r
800 if( p_intf->p_sys->b_spu_update )
\r
802 LanguageMenu( p_window->PopupSubtitles, p_spu_es, SPU_ES,
\r
803 p_window->PopupSubtitleClick );
\r
804 LanguageMenu( p_window->MenuSubtitles, p_spu_es, SPU_ES,
\r
805 p_window->MenuSubtitleClick );
\r
807 p_intf->p_sys->b_spu_update = 0;
\r
810 vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
\r