- fPreferencesWindow = new PreferencesWindow( window_rect,
- "Preferences",
- p_intf );
-
- // set the title bar
- SetName( "interface" );
- SetTitle( VOUT_TITLE );
-
- // the media control view
- p_mediaControl = new MediaControlView( BRect( 0.0, 0.0, 250.0, 50.0 ),
- p_intf );
- p_mediaControl->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
- p_mediaControl->SetEnabled( !fPlaylistIsEmpty );
-
- float width, height;
- p_mediaControl->GetPreferredSize( &width, &height );
-
- // set up the main menu
- fMenuBar = new BMenuBar( BRect(0.0, 0.0, width, 15.0), "main menu",
- B_FOLLOW_NONE, B_ITEMS_IN_ROW, false );
-
- // make menu bar resize to correct height
- float menuWidth, menuHeight;
- fMenuBar->GetPreferredSize( &menuWidth, &menuHeight );
- fMenuBar->ResizeTo( width, menuHeight ); // don't change! it's a workarround!
- // take care of proper size for ourself
- height += fMenuBar->Bounds().Height();
- ResizeTo( width, height );
-
- p_mediaControl->MoveTo( fMenuBar->Bounds().LeftBottom() + BPoint(0.0, 1.0) );
- AddChild( fMenuBar );
- AddChild( p_mediaControl );
-
- // Add the file Menu
- BMenu* fileMenu = new BMenu( "File" );
- fMenuBar->AddItem( fileMenu );
- fileMenu->AddItem( new BMenuItem( "Open File" B_UTF8_ELLIPSIS,
- new BMessage( OPEN_FILE ), 'O') );
-
- fileMenu->AddItem( new CDMenu( "Open Disc" ) );
-
- fileMenu->AddSeparatorItem();
- fileMenu->AddItem( new BMenuItem( "Play List" B_UTF8_ELLIPSIS,
- new BMessage( OPEN_PLAYLIST ), 'P') );
-
- fileMenu->AddSeparatorItem();
- BMenuItem* item = new BMenuItem( "About" B_UTF8_ELLIPSIS,
- new BMessage( B_ABOUT_REQUESTED ), 'A');
- item->SetTarget( be_app );
- fileMenu->AddItem( item );
- fileMenu->AddItem( new BMenuItem( "Quit", new BMessage( B_QUIT_REQUESTED ), 'Q') );
-
- fLanguageMenu = new LanguageMenu("Language", AUDIO_ES, p_intf);
- fSubtitlesMenu = new LanguageMenu("Subtitles", SPU_ES, p_intf);
-
- /* Add the Audio menu */
- fAudioMenu = new BMenu( "Audio" );
- fMenuBar->AddItem ( fAudioMenu );
- fAudioMenu->AddItem( fLanguageMenu );
- fAudioMenu->AddItem( fSubtitlesMenu );
-
- fPrevTitleMI = new BMenuItem( "Prev Title", new BMessage( PREV_TITLE ) );
- fNextTitleMI = new BMenuItem( "Next Title", new BMessage( NEXT_TITLE ) );
- fPrevChapterMI = new BMenuItem( "Prev Chapter", new BMessage( PREV_CHAPTER ) );
- fNextChapterMI = new BMenuItem( "Next Chapter", new BMessage( NEXT_CHAPTER ) );
-
- /* Add the Navigation menu */
- fNavigationMenu = new BMenu( "Navigation" );
- fMenuBar->AddItem( fNavigationMenu );
- fNavigationMenu->AddItem( fPrevTitleMI );
- fNavigationMenu->AddItem( fNextTitleMI );
- fNavigationMenu->AddItem( fTitleMenu = new TitleMenu( "Go to Title", p_intf ) );
- fNavigationMenu->AddSeparatorItem();
- fNavigationMenu->AddItem( fPrevChapterMI );
- fNavigationMenu->AddItem( fNextChapterMI );
- fNavigationMenu->AddItem( fChapterMenu = new ChapterMenu( "Go to Chapter", p_intf ) );
-
- /* Add the Speed menu */
- fSpeedMenu = new BMenu( "Speed" );
- fSpeedMenu->SetRadioMode( true );
- fSpeedMenu->AddItem( fSlowerMI = new BMenuItem( "Slower", new BMessage( SLOWER_PLAY ) ) );
- fNormalMI = new BMenuItem( "Normal", new BMessage( NORMAL_PLAY ) );
- fNormalMI->SetMarked(true); // default to normal speed
- fSpeedMenu->AddItem( fNormalMI );
- fSpeedMenu->AddItem( fFasterMI = new BMenuItem( "Faster", new BMessage( FASTER_PLAY) ) );
- fSpeedMenu->SetTargetForItems( this );
- fMenuBar->AddItem( fSpeedMenu );
-
- /* Add the Settings menu */
- fSettingsMenu = new BMenu( "Settings" );
- fSettingsMenu->AddItem( fPreferencesMI =
- new BMenuItem( "Preferences", new BMessage( OPEN_PREFERENCES ) ) );
- fMenuBar->AddItem( fSettingsMenu );
-
- // prepare fow showing
- _SetMenusEnabled(false);
-
- _RestoreSettings();
-
- Show();
+ fPreferencesWindow = new PreferencesWindow( p_intf, window_rect, _("Preferences") );
+ window_rect.Set( screen_rect.right - 500,
+ screen_rect.top + 50,
+ screen_rect.right - 150,
+ screen_rect.top + 250 );
+#if 0
+ fPlaylistWindow = new PlayListWindow( window_rect, _("Playlist"), this, p_intf );
+ window_rect.Set( screen_rect.right - 550,
+ screen_rect.top + 300,
+ screen_rect.right - 150,
+ screen_rect.top + 500 );
+#endif
+ fMessagesWindow = new MessagesWindow( p_intf, window_rect, _("Messages") );
+
+ // the media control view
+ p_mediaControl = new MediaControlView( p_intf, BRect( 0.0, 0.0, 250.0, 50.0 ) );
+ p_mediaControl->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
+
+ float width, height;
+ p_mediaControl->GetPreferredSize( &width, &height );
+
+ // set up the main menu
+ fMenuBar = new BMenuBar( BRect(0.0, 0.0, width, 15.0), "main menu",
+ B_FOLLOW_NONE, B_ITEMS_IN_ROW, false );
+
+ // make menu bar resize to correct height
+ float menuWidth, menuHeight;
+ fMenuBar->GetPreferredSize( &menuWidth, &menuHeight );
+ fMenuBar->ResizeTo( width, menuHeight ); // don't change! it's a workarround!
+ // take care of proper size for ourself
+ height += fMenuBar->Bounds().Height();
+ ResizeTo( width, height );
+
+ p_mediaControl->MoveTo( fMenuBar->Bounds().LeftBottom() + BPoint(0.0, 1.0) );
+ AddChild( fMenuBar );
+
+
+ // Add the file Menu
+ BMenu* fileMenu = new BMenu( _("File") );
+ fMenuBar->AddItem( fileMenu );
+ ADD_ELLIPSIS( _("Open File") );
+ fileMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_FILE ), 'O') );
+ fileMenu->AddItem( new CDMenu( _("Open Disc") ) );
+ ADD_ELLIPSIS( _("Open Subtitles") );
+ fileMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( LOAD_SUBFILE ) ) );
+
+ fileMenu->AddSeparatorItem();
+ ADD_ELLIPSIS( _("About") );
+ BMenuItem* item = new BMenuItem( psz_tmp, new BMessage( B_ABOUT_REQUESTED ), 'A');
+ item->SetTarget( be_app );
+ fileMenu->AddItem( item );
+ fileMenu->AddItem( new BMenuItem( _("Quit"), new BMessage( B_QUIT_REQUESTED ), 'Q') );
+
+ fLanguageMenu = new LanguageMenu( p_intf, _("Language"), "audio-es" );
+ fSubtitlesMenu = new LanguageMenu( p_intf, _("Subtitles"), "spu-es" );
+
+ /* Add the Audio menu */
+ fAudioMenu = new BMenu( _("Audio") );
+ fMenuBar->AddItem ( fAudioMenu );
+ fAudioMenu->AddItem( fLanguageMenu );
+ fAudioMenu->AddItem( fSubtitlesMenu );
+
+ fPrevTitleMI = new BMenuItem( _("Prev Title"), new BMessage( PREV_TITLE ) );
+ fNextTitleMI = new BMenuItem( _("Next Title"), new BMessage( NEXT_TITLE ) );
+ fPrevChapterMI = new BMenuItem( _("Previous chapter"), new BMessage( PREV_CHAPTER ) );
+ fNextChapterMI = new BMenuItem( _("Next chapter"), new BMessage( NEXT_CHAPTER ) );
+
+ /* Add the Navigation menu */
+ fNavigationMenu = new BMenu( _("Navigation") );
+ fMenuBar->AddItem( fNavigationMenu );
+ fNavigationMenu->AddItem( fPrevTitleMI );
+ fNavigationMenu->AddItem( fNextTitleMI );
+ fNavigationMenu->AddItem( fTitleMenu = new TitleMenu( _("Go to Title"), p_intf ) );
+ fNavigationMenu->AddSeparatorItem();
+ fNavigationMenu->AddItem( fPrevChapterMI );
+ fNavigationMenu->AddItem( fNextChapterMI );
+ fNavigationMenu->AddItem( fChapterMenu = new ChapterMenu( _("Go to Chapter"), p_intf ) );
+
+ /* Add the Speed menu */
+ fSpeedMenu = new BMenu( _("Speed") );
+ fSpeedMenu->SetRadioMode( true );
+ fSpeedMenu->AddItem(
+ fHeighthMI = new BMenuItem( "1/8x", new BMessage( HEIGHTH_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fQuarterMI = new BMenuItem( "1/4x", new BMessage( QUARTER_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fHalfMI = new BMenuItem( "1/2x", new BMessage( HALF_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fNormalMI = new BMenuItem( "1x", new BMessage( NORMAL_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fTwiceMI = new BMenuItem( "2x", new BMessage( TWICE_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fFourMI = new BMenuItem( "4x", new BMessage( FOUR_PLAY ) ) );
+ fSpeedMenu->AddItem(
+ fHeightMI = new BMenuItem( "8x", new BMessage( HEIGHT_PLAY ) ) );
+ fMenuBar->AddItem( fSpeedMenu );
+
+ /* Add the Show menu */
+ fShowMenu = new BMenu( _("Window") );
+#if 0
+ ADD_ELLIPSIS( _("Playlist") );
+ fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_PLAYLIST ), 'P') );
+#endif
+ ADD_ELLIPSIS( _("Messages") );
+ fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_MESSAGES ), 'M' ) );
+ ADD_ELLIPSIS( _("Preferences") );
+ fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_PREFERENCES ), 'S' ) );
+ fMenuBar->AddItem( fShowMenu );
+
+ // add the media control view after the menubar is complete
+ // because it will set the window size limits in AttachedToWindow()
+ // and the menubar needs to report the correct PreferredSize()
+ AddChild( p_mediaControl );
+
+ /* Prepare fow showing */
+ _SetMenusEnabled( false );
+ p_mediaControl->SetEnabled( false );
+
+ _RestoreSettings();
+
+ Show();