* Added a file panel for subtitles file selection.
[vlc.git] / modules / gui / beos / InterfaceWindow.h
1 /*****************************************************************************
2  * InterfaceWindow.h: BeOS interface window class prototype
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001 VideoLAN
5  * $Id: InterfaceWindow.h,v 1.8 2003/01/14 14:48:55 titer Exp $
6  *
7  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
8  *          Tony Castley <tcastley@mail.powerup.com.au>
9  *          Richard Shepherd <richard@rshepherd.demon.co.uk>
10  *          Stephan Aßmus <stippi@yellowbites.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
25  *****************************************************************************/
26
27 #ifndef BEOS_INTERFACE_WINDOW_H
28 #define BEOS_INTERFACE_WINDOW_H
29
30 #include <Menu.h>
31 #include <Window.h>
32
33 class BMenuBar;
34 class MediaControlView;
35 class PlayListWindow;
36 class BFilePanel;
37 class PreferencesWindow;
38
39 class CDMenu : public BMenu
40 {
41  public:
42                                                         CDMenu( const char* name );
43         virtual                                 ~CDMenu();
44
45         virtual void                    AttachedToWindow();
46
47  private:
48         int                                             GetCD( const char* directory );
49 };
50
51 class LanguageMenu : public BMenu
52 {
53  public:
54                                                         LanguageMenu( const char* name,
55                                                                                   int menu_kind,
56                                                                                   VlcWrapper *p_wrapper );
57         virtual                                 ~LanguageMenu();
58
59         virtual void                    AttachedToWindow();
60
61  private:
62                         void                    _GetChannels();
63
64         VlcWrapper *            p_wrapper;
65         int                                             kind;
66 };
67
68 class TitleMenu : public BMenu
69 {
70  public:
71                                                         TitleMenu( const char* name, intf_thread_t  *p_interface );
72         virtual                                 ~TitleMenu();
73
74         virtual void                    AttachedToWindow();
75         
76         intf_thread_t  *p_intf;
77 };
78
79 class ChapterMenu : public BMenu
80 {
81  public:
82                                                         ChapterMenu( const char* name, intf_thread_t  *p_interface );
83         virtual                                 ~ChapterMenu();
84
85         virtual void                    AttachedToWindow();
86
87         intf_thread_t  *p_intf;
88 };
89
90
91 class InterfaceWindow : public BWindow
92 {
93  public:
94                                                         InterfaceWindow( BRect frame,
95                                                                                          const char* name,
96                                                                                          intf_thread_t* p_interface );
97         virtual                                 ~InterfaceWindow();
98
99                                                         // BWindow
100         virtual void                    FrameResized( float width, float height );
101         virtual void                    MessageReceived( BMessage* message );
102         virtual bool                    QuitRequested();
103
104                                                         // InterfaceWindow
105                         void                    updateInterface();
106                         bool                    IsStopped() const;
107             
108         MediaControlView*               p_mediaControl;
109
110  private:       
111                         void                    _UpdatePlaylist();
112                         void                    _SetMenusEnabled( bool hasFile,
113                                                                                           bool hasChapters = false,
114                                                                                           bool hasTitles = false );
115                         void                    _UpdateSpeedMenu( int rate );
116                         void                    _InputStreamChanged();
117                         status_t                _LoadSettings( BMessage* message,
118                                                                                    const char* fileName,
119                                                                                    const char* subFolder = NULL );
120                         status_t                _SaveSettings( BMessage* message,
121                                                                                    const char* fileName,
122                                                                                    const char* subFolder = NULL );
123                         void                    _RestoreSettings();
124                         void                    _StoreSettings();
125
126         intf_thread_t*                  p_intf;
127         es_descriptor_t*                p_spu_es;
128
129         bool                                    fPlaylistIsEmpty;
130         BFilePanel*                             fFilePanel;
131         BFilePanel*                             fSubtitlesPanel;
132         PlayListWindow*                 fPlaylistWindow;
133         PreferencesWindow*              fPreferencesWindow;
134         BMenuBar*                               fMenuBar;
135         BMenuItem*                              fNextTitleMI;
136         BMenuItem*                              fPrevTitleMI;
137         BMenuItem*                              fNextChapterMI;
138         BMenuItem*                              fPrevChapterMI;
139         BMenuItem*                              fOnTopMI;
140         BMenuItem*                              fSlowerMI;
141         BMenuItem*                              fNormalMI;
142         BMenuItem*                              fFasterMI;
143         BMenuItem*                              fPreferencesMI;
144         BMenu*                                  fAudioMenu;
145         BMenu*                                  fNavigationMenu;
146         BMenu*                                  fTitleMenu;
147         BMenu*                                  fChapterMenu;
148         BMenu*                                  fLanguageMenu;
149         BMenu*                                  fSubtitlesMenu;
150         BMenu*                                  fSpeedMenu;
151         BMenu*                                  fSettingsMenu;
152         bigtime_t                               fLastUpdateTime;
153         BMessage*                               fSettings;      // we keep the message arround
154                                                                                 // for forward compatibility
155         
156         VlcWrapper * p_wrapper;
157 };
158
159 #endif  // BEOS_INTERFACE_WINDOW_H