InterfaceWindow.h
上传用户:riyaled888
上传日期:2009-03-27
资源大小:7338k
文件大小:5k
源码类别:

多媒体

开发平台:

MultiPlatform

  1. /*****************************************************************************
  2.  * InterfaceWindow.h: BeOS interface window class prototype
  3.  *****************************************************************************
  4.  * Copyright (C) 1999, 2000, 2001 VideoLAN
  5.  * $Id: InterfaceWindow.h 8448 2004-08-17 17:24:02Z titer $
  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. #ifndef BEOS_INTERFACE_WINDOW_H
  27. #define BEOS_INTERFACE_WINDOW_H
  28. #include <Menu.h>
  29. #include <Window.h>
  30. class BMenuBar;
  31. class MediaControlView;
  32. class PlayListWindow;
  33. class BFilePanel;
  34. class PreferencesWindow;
  35. class MessagesWindow;
  36. class CDMenu : public BMenu
  37. {
  38.  public:
  39.                             CDMenu( const char* name );
  40.     virtual                 ~CDMenu();
  41.     virtual void            AttachedToWindow();
  42.  private:
  43.     int                     GetCD( const char* directory );
  44. };
  45. class LanguageMenu : public BMenu
  46. {
  47.  public:
  48.                             LanguageMenu( intf_thread_t * p_intf,
  49.                                           const char * psz_name,
  50.                                           char * psz_variable );
  51.     virtual                 ~LanguageMenu();
  52.     virtual void            AttachedToWindow();
  53.  private:
  54.     intf_thread_t         * p_intf;
  55.     char                  * psz_variable;
  56. };
  57. class TitleMenu : public BMenu
  58. {
  59.  public:
  60.                             TitleMenu( const char* name, intf_thread_t  *p_interface );
  61.     virtual                 ~TitleMenu();
  62.     virtual void            AttachedToWindow();
  63.     intf_thread_t  *p_intf;
  64. };
  65. class ChapterMenu : public BMenu
  66. {
  67.  public:
  68.                             ChapterMenu( const char* name, intf_thread_t  *p_interface );
  69.     virtual                 ~ChapterMenu();
  70.     virtual void            AttachedToWindow();
  71.     intf_thread_t  *p_intf;
  72. };
  73. class InterfaceWindow : public BWindow
  74. {
  75.  public:
  76.                             InterfaceWindow( intf_thread_t * p_intf,
  77.                                              BRect frame,
  78.                                              const char * name );
  79.     virtual                 ~InterfaceWindow();
  80.                             // BWindow
  81.     virtual void            FrameResized( float width, float height );
  82.     virtual void            MessageReceived( BMessage* message );
  83.     virtual bool            QuitRequested();
  84.                             // InterfaceWindow
  85.             void            UpdateInterface();
  86.             bool            IsStopped() const;
  87.         
  88.     MediaControlView*        p_mediaControl;
  89.     MessagesWindow*         fMessagesWindow;
  90.  private:    
  91.             void            _UpdatePlaylist();
  92.             void            _SetMenusEnabled( bool hasFile,
  93.                                               bool hasChapters = false,
  94.                                               bool hasTitles = false );
  95.             void            _UpdateSpeedMenu( int rate );
  96.             void _ShowFilePanel( uint32 command,
  97.              const char* windowTitle );
  98. void _RestoreSettings();
  99. void _StoreSettings();
  100.     intf_thread_t         * p_intf;
  101.     input_thread_t        * p_input;
  102.     playlist_t            * p_playlist;
  103.     es_descriptor_t       * p_spu_es;
  104.     BFilePanel*             fFilePanel;
  105.     PlayListWindow*         fPlaylistWindow;
  106.     PreferencesWindow*      fPreferencesWindow;
  107.     BMenuBar*               fMenuBar;
  108.     BMenuItem*              fGotoMenuMI;
  109.     BMenuItem*              fNextTitleMI;
  110.     BMenuItem*              fPrevTitleMI;
  111.     BMenuItem*              fNextChapterMI;
  112.     BMenuItem*              fPrevChapterMI;
  113.     BMenuItem*              fOnTopMI;
  114.     BMenuItem*              fHeighthMI;
  115.     BMenuItem*              fQuarterMI;
  116.     BMenuItem*              fHalfMI;
  117.     BMenuItem*              fNormalMI;
  118.     BMenuItem*              fTwiceMI;
  119.     BMenuItem*              fFourMI;
  120.     BMenuItem*              fHeightMI;
  121.     BMenu*                  fAudioMenu;
  122.     BMenu*                  fNavigationMenu;
  123.     BMenu*                  fTitleMenu;
  124.     BMenu*                  fChapterMenu;
  125.     BMenu*                  fLanguageMenu;
  126.     BMenu*                  fSubtitlesMenu;
  127.     BMenu*                  fSpeedMenu;
  128.     BMenu*                  fShowMenu;
  129.     bigtime_t               fLastUpdateTime;
  130. BMessage* fSettings; // we keep the message arround
  131. // for forward compatibility
  132. };
  133. // some global support functions
  134. status_t load_settings( BMessage* message,
  135. const char* fileName,
  136. const char* folder = NULL );
  137. status_t save_settings( BMessage* message,
  138. const char* fileName,
  139. const char* folder = NULL );
  140. #endif    // BEOS_INTERFACE_WINDOW_H