InterfaceWindow.h
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:6k
源码类别:

midi

开发平台:

Unix_Linux

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