]> git.sesse.net Git - vlc/blob - plugins/beos/InterfaceWindow.h
video output has better handling of settings. it remembers flags like fullscreen...
[vlc] / plugins / 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.12.2.6 2002/10/11 14:18:17 stippi 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
38 class CDMenu : public BMenu
39 {
40  public:
41                                                         CDMenu( const char* name );
42         virtual                                 ~CDMenu();
43
44         virtual void                    AttachedToWindow();
45
46  private:
47         int                                             GetCD( const char* directory );
48 };
49
50 class LanguageMenu : public BMenu
51 {
52  public:
53                                                         LanguageMenu( const char* name,
54                                                                                   int menu_kind,
55                                                                                   intf_thread_t* p_interface );
56         virtual                                 ~LanguageMenu();
57
58         virtual void                    AttachedToWindow();
59
60  private:
61                         void                    _GetChannels();
62
63         intf_thread_t*                  p_intf;
64         int                                             kind;
65 };
66
67 class TitleMenu : public BMenu
68 {
69  public:
70                                                         TitleMenu( const char* name );
71         virtual                                 ~TitleMenu();
72
73         virtual void                    AttachedToWindow();
74 };
75
76 class ChapterMenu : public BMenu
77 {
78  public:
79                                                         ChapterMenu( const char* name );
80         virtual                                 ~ChapterMenu();
81
82         virtual void                    AttachedToWindow();
83 };
84
85
86 class InterfaceWindow : public BWindow
87 {
88  public:
89                                                         InterfaceWindow( BRect frame,
90                                                                                          const char* name,
91                                                                                          intf_thread_t* p_interface );
92         virtual                                 ~InterfaceWindow();
93
94                                                         // BWindow
95         virtual void                    FrameResized( float width, float height );
96         virtual void                    MessageReceived( BMessage* message );
97         virtual bool                    QuitRequested();
98
99                                                         // InterfaceWindow
100                         void                    updateInterface();
101                         bool                    IsStopped() const;
102             
103         MediaControlView*               p_mediaControl;
104
105  private:       
106                         void                    _UpdatePlaylist();
107                         void                    _SetMenusEnabled( bool hasFile,
108                                                                                           bool hasChapters = false,
109                                                                                           bool hasTitles = false );
110                         void                    _UpdateSpeedMenu( int rate );
111                         void                    _InputStreamChanged();
112                         void                    _RestoreSettings();
113                         void                    _StoreSettings();
114
115         intf_thread_t*                  p_intf;
116         es_descriptor_t*                p_audio_es;
117         es_descriptor_t*                p_spu_es;
118         input_thread_s*                 fInputThread;
119
120         bool                                    fPlaylistIsEmpty;
121         BFilePanel*                             fFilePanel;
122         PlayListWindow*                 fPlaylistWindow;
123         BMenuBar*                               fMenuBar;
124         BMenuItem*                              fNextTitleMI;
125         BMenuItem*                              fPrevTitleMI;
126         BMenuItem*                              fNextChapterMI;
127         BMenuItem*                              fPrevChapterMI;
128         BMenuItem*                              fOnTopMI;
129         BMenuItem*                              fSlowerMI;
130         BMenuItem*                              fNormalMI;
131         BMenuItem*                              fFasterMI;
132         BMenu*                                  fAudioMenu;
133         BMenu*                                  fNavigationMenu;
134         BMenu*                                  fTitleMenu;
135         BMenu*                                  fChapterMenu;
136         BMenu*                                  fLanguageMenu;
137         BMenu*                                  fSubtitlesMenu;
138         BMenu*                                  fSpeedMenu;
139         bigtime_t                               fLastInterfaceUpdate;
140         bigtime_t                               fLastSoundUpdate;
141         BMessage*                               fSettings;      // we keep the message arround
142                                                                                 // for forward compatibility
143 };
144
145 // some global support functions
146 status_t load_settings( BMessage* message,
147                                                 const char* fileName,
148                                                 const char* folder = NULL );
149
150 status_t save_settings( BMessage* message,
151                                                 const char* fileName,
152                                                 const char* folder = NULL );
153
154
155 #endif  // BEOS_INTERFACE_WINDOW_H