]> git.sesse.net Git - vlc/blob - modules/gui/beos/InterfaceWindow.h
Support for UDP-Lite (with full checksum coverage only atm)
[vlc] / modules / gui / beos / InterfaceWindow.h
1 /*****************************************************************************
2  * InterfaceWindow.h: BeOS interface window class prototype
3  *****************************************************************************
4  * Copyright (C) 1999, 2000, 2001 the VideoLAN team
5  * $Id$
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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 #if 0
36 class PlayListWindow;
37 #endif
38 class BFilePanel;
39 class PreferencesWindow;
40 class MessagesWindow;
41
42 class CDMenu : public BMenu
43 {
44  public:
45                             CDMenu( const char* name );
46     virtual                 ~CDMenu();
47
48     virtual void            AttachedToWindow();
49
50  private:
51     int                     GetCD( const char* directory );
52 };
53
54 class LanguageMenu : public BMenu
55 {
56  public:
57                             LanguageMenu( intf_thread_t * p_intf,
58                                           const char * psz_name,
59                                           char * psz_variable );
60     virtual                 ~LanguageMenu();
61
62     virtual void            AttachedToWindow();
63
64  private:
65     intf_thread_t         * p_intf;
66     char                  * psz_variable;
67 };
68
69 class TitleMenu : public BMenu
70 {
71  public:
72                             TitleMenu( const char* name, intf_thread_t  *p_interface );
73     virtual                 ~TitleMenu();
74
75     virtual void            AttachedToWindow();
76
77     intf_thread_t  *p_intf;
78 };
79
80 class ChapterMenu : public BMenu
81 {
82  public:
83                             ChapterMenu( const char* name, intf_thread_t  *p_interface );
84     virtual                 ~ChapterMenu();
85
86     virtual void            AttachedToWindow();
87
88     intf_thread_t  *p_intf;
89 };
90
91
92 class InterfaceWindow : public BWindow
93 {
94  public:
95                             InterfaceWindow( intf_thread_t * p_intf,
96                                              BRect frame,
97                                              const char * name );
98     virtual                 ~InterfaceWindow();
99
100                             // BWindow
101     virtual void            FrameResized( float width, float height );
102     virtual void            MessageReceived( BMessage* message );
103     virtual bool            QuitRequested();
104
105                             // InterfaceWindow
106             void            UpdateInterface();
107             void            UpdatePlaylist();
108
109             bool            IsStopped() const;
110         
111     MediaControlView*        p_mediaControl;
112     MessagesWindow*         fMessagesWindow;
113
114  private:    
115             void            _SetMenusEnabled( bool hasFile,
116                                               bool hasChapters = false,
117                                               bool hasTitles = false );
118             void            _UpdateSpeedMenu( int rate );
119             void            _ShowFilePanel( uint32 command,
120                                             const char* windowTitle );
121             void            _RestoreSettings();
122             void            _StoreSettings();
123
124     intf_thread_t         * p_intf;
125     input_thread_t        * p_input;
126     playlist_t            * p_playlist;
127     es_descriptor_t       * p_spu_es;
128     bool                    b_playlist_update;
129
130     BFilePanel*             fFilePanel;
131 #if 0
132         PlayListWindow*         fPlaylistWindow;
133 #endif
134     PreferencesWindow*      fPreferencesWindow;
135     BMenuBar*               fMenuBar;
136     BMenuItem*              fGotoMenuMI;
137     BMenuItem*              fNextTitleMI;
138     BMenuItem*              fPrevTitleMI;
139     BMenuItem*              fNextChapterMI;
140     BMenuItem*              fPrevChapterMI;
141     BMenuItem*              fOnTopMI;
142     BMenuItem*              fHeighthMI;
143     BMenuItem*              fQuarterMI;
144     BMenuItem*              fHalfMI;
145     BMenuItem*              fNormalMI;
146     BMenuItem*              fTwiceMI;
147     BMenuItem*              fFourMI;
148     BMenuItem*              fHeightMI;
149     BMenu*                  fAudioMenu;
150     BMenu*                  fNavigationMenu;
151     BMenu*                  fTitleMenu;
152     BMenu*                  fChapterMenu;
153     BMenu*                  fLanguageMenu;
154     BMenu*                  fSubtitlesMenu;
155     BMenu*                  fSpeedMenu;
156     BMenu*                  fShowMenu;
157     bigtime_t               fLastUpdateTime;
158     BMessage*               fSettings;  // we keep the message arround
159                                         // for forward compatibility
160 };
161
162
163 // some global support functions
164 status_t load_settings( BMessage* message,
165                         const char* fileName,
166                         const char* folder = NULL );
167
168 status_t save_settings( BMessage* message,
169                         const char* fileName,
170                         const char* folder = NULL );
171
172
173 #endif    // BEOS_INTERFACE_WINDOW_H