InterfaceWindow.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * InterfaceWindow.h: BeOS interface window class prototype
00003  *****************************************************************************
00004  * Copyright (C) 1999, 2000, 2001 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
00008  *          Tony Castley <tcastley@mail.powerup.com.au>
00009  *          Richard Shepherd <richard@rshepherd.demon.co.uk>
00010  *          Stephan Aßmus <stippi@yellowbites.com>
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00025  *****************************************************************************/
00026 
00027 #ifndef BEOS_INTERFACE_WINDOW_H
00028 #define BEOS_INTERFACE_WINDOW_H
00029 
00030 #include <Menu.h>
00031 #include <Window.h>
00032 
00033 class BMenuBar;
00034 class MediaControlView;
00035 #if 0
00036 class PlayListWindow;
00037 #endif
00038 class BFilePanel;
00039 class PreferencesWindow;
00040 class MessagesWindow;
00041 
00042 class CDMenu : public BMenu
00043 {
00044  public:
00045                             CDMenu( const char* name );
00046     virtual                 ~CDMenu();
00047 
00048     virtual void            AttachedToWindow();
00049 
00050  private:
00051     int                     GetCD( const char* directory );
00052 };
00053 
00054 class LanguageMenu : public BMenu
00055 {
00056  public:
00057                             LanguageMenu( intf_thread_t * p_intf,
00058                                           const char * psz_name,
00059                                           char * psz_variable );
00060     virtual                 ~LanguageMenu();
00061 
00062     virtual void            AttachedToWindow();
00063 
00064  private:
00065     intf_thread_t         * p_intf;
00066     char                  * psz_variable;
00067 };
00068 
00069 class TitleMenu : public BMenu
00070 {
00071  public:
00072                             TitleMenu( const char* name, intf_thread_t  *p_interface );
00073     virtual                 ~TitleMenu();
00074 
00075     virtual void            AttachedToWindow();
00076 
00077     intf_thread_t  *p_intf;
00078 };
00079 
00080 class ChapterMenu : public BMenu
00081 {
00082  public:
00083                             ChapterMenu( const char* name, intf_thread_t  *p_interface );
00084     virtual                 ~ChapterMenu();
00085 
00086     virtual void            AttachedToWindow();
00087 
00088     intf_thread_t  *p_intf;
00089 };
00090 
00091 
00092 class InterfaceWindow : public BWindow
00093 {
00094  public:
00095                             InterfaceWindow( intf_thread_t * p_intf,
00096                                              BRect frame,
00097                                              const char * name );
00098     virtual                 ~InterfaceWindow();
00099 
00100                             // BWindow
00101     virtual void            FrameResized( float width, float height );
00102     virtual void            MessageReceived( BMessage* message );
00103     virtual bool            QuitRequested();
00104 
00105                             // InterfaceWindow
00106             void            UpdateInterface();
00107             void            UpdatePlaylist();
00108 
00109             bool            IsStopped() const;
00110  
00111     MediaControlView*        p_mediaControl;
00112     MessagesWindow*         fMessagesWindow;
00113 
00114  private:
00115             void            _SetMenusEnabled( bool hasFile,
00116                                               bool hasChapters = false,
00117                                               bool hasTitles = false );
00118             void            _UpdateSpeedMenu( int rate );
00119             void            _ShowFilePanel( uint32 command,
00120                                             const char* windowTitle );
00121             void            _RestoreSettings();
00122             void            _StoreSettings();
00123 
00124     intf_thread_t         * p_intf;
00125     input_thread_t        * p_input;
00126     playlist_t            * p_playlist;
00127     es_descriptor_t       * p_spu_es;
00128     bool                    b_playlist_update;
00129 
00130     BFilePanel*             fFilePanel;
00131 #if 0
00132     PlayListWindow*         fPlaylistWindow;
00133 #endif
00134     PreferencesWindow*      fPreferencesWindow;
00135     BMenuBar*               fMenuBar;
00136     BMenuItem*              fGotoMenuMI;
00137     BMenuItem*              fNextTitleMI;
00138     BMenuItem*              fPrevTitleMI;
00139     BMenuItem*              fNextChapterMI;
00140     BMenuItem*              fPrevChapterMI;
00141     BMenuItem*              fOnTopMI;
00142     BMenuItem*              fHeighthMI;
00143     BMenuItem*              fQuarterMI;
00144     BMenuItem*              fHalfMI;
00145     BMenuItem*              fNormalMI;
00146     BMenuItem*              fTwiceMI;
00147     BMenuItem*              fFourMI;
00148     BMenuItem*              fHeightMI;
00149     BMenu*                  fAudioMenu;
00150     BMenu*                  fNavigationMenu;
00151     BMenu*                  fTitleMenu;
00152     BMenu*                  fChapterMenu;
00153     BMenu*                  fLanguageMenu;
00154     BMenu*                  fSubtitlesMenu;
00155     BMenu*                  fSpeedMenu;
00156     BMenu*                  fShowMenu;
00157     bigtime_t               fLastUpdateTime;
00158     BMessage*               fSettings;  // we keep the message arround
00159                                         // for forward compatibility
00160 };
00161 
00162 
00163 // some global support functions
00164 status_t load_settings( BMessage* message,
00165                         const char* fileName,
00166                         const char* folder = NULL );
00167 
00168 status_t save_settings( BMessage* message,
00169                         const char* fileName,
00170                         const char* folder = NULL );
00171 
00172 
00173 #endif    // BEOS_INTERFACE_WINDOW_H

Generated on Wed Mar 31 08:05:22 2010 for VLC by  doxygen 1.5.6