1 /*****************************************************************************
2 * menu.h: prototypes for menu functions
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: menu.h,v 1.2 2002/12/13 03:52:58 videolan Exp $
7 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
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 *****************************************************************************/
26 //----------------------------------------------------------------------------
27 class TMenusGen : public TObject
30 intf_thread_t *p_intf;
32 /* local pointers to main window menu items */
34 TMenuItem *PopupAudio;
35 TMenuItem *MenuSubtitles;
36 TMenuItem *PopupSubtitles;
37 TMenuItem *MenuProgram;
38 TMenuItem *PopupProgram;
40 TMenuItem *MenuChapter;
41 TMenuItem *PopupNavigation;
43 /* Language information */
44 es_descriptor_t * p_audio_es_old;
45 es_descriptor_t * p_spu_es_old;
47 /* Helpful functions */
48 int Item2Index( TMenuItem *Root, TMenuItem *Item );
49 TMenuItem *Index2Item( TMenuItem *Root, int i_index, bool SingleColumn );
50 int __fastcall Data2Title( int data );
51 int __fastcall Data2Chapter( int data );
52 int __fastcall Pos2Data( int title, int chapter );
54 void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int );
55 void __fastcall ProgramChange( TMenuItem *, TMenuItem * );
56 void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
58 void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int,
60 void __fastcall LanguageMenu( TMenuItem *, es_descriptor_t *, int,
62 void __fastcall NavigationMenu( TMenuItem *, TNotifyEvent );
64 __fastcall TMenusGen( intf_thread_t *_p_intf );
67 void __fastcall SetupMenus();
69 /* callbacks for menuitems */
70 void __fastcall MenuAudioClick( TObject *Sender );
71 void __fastcall PopupAudioClick( TObject *Sender );
72 void __fastcall MenuSubtitleClick( TObject *Sender );
73 void __fastcall PopupSubtitleClick( TObject *Sender );
74 void __fastcall MenuProgramClick( TObject *Sender );
75 void __fastcall PopupProgramClick( TObject *Sender );
76 void __fastcall MenuTitleClick( TObject *Sender );
77 void __fastcall MenuChapterClick( TObject *Sender );
78 void __fastcall PopupNavigationClick( TObject *Sender );
80 //----------------------------------------------------------------------------