]> git.sesse.net Git - vlc/blob - modules/gui/win32/menu.h
- vlc_playlist.h, playlist.c: added the ability to save a playlist to
[vlc] / modules / gui / win32 / menu.h
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 $
6  *
7  * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef menuH
25 #define menuH
26 //----------------------------------------------------------------------------
27 class TMenusGen : public TObject
28 {
29 private:
30     intf_thread_t *p_intf;
31
32     /* local pointers to main window menu items */
33     TMenuItem *MenuAudio;
34     TMenuItem *PopupAudio;
35     TMenuItem *MenuSubtitles;
36     TMenuItem *PopupSubtitles;
37     TMenuItem *MenuProgram;
38     TMenuItem *PopupProgram;
39     TMenuItem *MenuTitle;
40     TMenuItem *MenuChapter;
41     TMenuItem *PopupNavigation;
42
43     /* Language information */
44     es_descriptor_t   * p_audio_es_old;
45     es_descriptor_t   * p_spu_es_old;
46
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 );
53
54     void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int );
55     void __fastcall ProgramChange( TMenuItem *, TMenuItem * );
56     void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
57                                  TNotifyEvent );
58     void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int,
59                                TNotifyEvent );
60     void __fastcall LanguageMenu( TMenuItem *, es_descriptor_t *, int,
61                                   TNotifyEvent );
62     void __fastcall NavigationMenu( TMenuItem *, TNotifyEvent );
63 public:
64     __fastcall TMenusGen( intf_thread_t *_p_intf );
65
66     /* menu generation */
67     void __fastcall SetupMenus();
68
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 );
79 };
80 //----------------------------------------------------------------------------
81 #endif