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