Commit 588c55d5 authored by Eric Petit's avatar Eric Petit

- Added a small preferences window

- Fixes
parent b316e6e8
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface * InterfaceWindow.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.3 2002/10/10 23:11:52 titer Exp $ * $Id: InterfaceWindow.cpp,v 1.4 2002/10/28 16:55:05 titer Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include "MsgVals.h" #include "MsgVals.h"
#include "MediaControlView.h" #include "MediaControlView.h"
#include "PlayListWindow.h" #include "PlayListWindow.h"
#include "PreferencesWindow.h"
#include "VlcWrapper.h" #include "VlcWrapper.h"
#include "InterfaceWindow.h" #include "InterfaceWindow.h"
...@@ -71,11 +72,14 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name, ...@@ -71,11 +72,14 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
FIND_ANYWHERE ); FIND_ANYWHERE );
fPlaylistIsEmpty = (p_playlist->i_size < 0); fPlaylistIsEmpty = (p_playlist->i_size < 0);
fPlaylistWindow = new PlayListWindow( BRect( 20.0, 20.0, 170.0, 320.0 ), fPlaylistWindow = new PlayListWindow( BRect( 100.0, 100.0, 400.0, 350.0 ),
"Playlist", "Playlist",
p_playlist, p_playlist,
this, this,
p_intf ); p_intf );
fPreferencesWindow = new PreferencesWindow( BRect( 100, 400, 500, 595 ),
"Preferences",
p_intf );
// set the title bar // set the title bar
SetName( "interface" ); SetName( "interface" );
...@@ -160,7 +164,12 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name, ...@@ -160,7 +164,12 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
fSpeedMenu->SetTargetForItems( this ); fSpeedMenu->SetTargetForItems( this );
fMenuBar->AddItem( fSpeedMenu ); fMenuBar->AddItem( fSpeedMenu );
/* Add the Settings menu */
fSettingsMenu = new BMenu( "Settings" );
fSettingsMenu->AddItem( fPreferencesMI =
new BMenuItem( "Preferences", new BMessage( OPEN_PREFERENCES ) ) );
fMenuBar->AddItem( fSettingsMenu );
/* Add the Config menu */ /* Add the Config menu */
// BMenu* configMenu = new BMenu( "Config" ); // BMenu* configMenu = new BMenu( "Config" );
// menu_bar->AddItem( configMenu ); // menu_bar->AddItem( configMenu );
...@@ -467,7 +476,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -467,7 +476,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
_UpdatePlaylist(); _UpdatePlaylist();
} }
break; break;
case OPEN_PREFERENCES:
if (fPreferencesWindow->IsHidden())
fPreferencesWindow->Show();
else
fPreferencesWindow->Activate();
break;
default: default:
BWindow::MessageReceived( p_message ); BWindow::MessageReceived( p_message );
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype * InterfaceWindow.h: BeOS interface window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: InterfaceWindow.h,v 1.3 2002/10/28 16:55:05 titer Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -34,6 +34,7 @@ class BMenuBar; ...@@ -34,6 +34,7 @@ class BMenuBar;
class MediaControlView; class MediaControlView;
class PlayListWindow; class PlayListWindow;
class BFilePanel; class BFilePanel;
class PreferencesWindow;
class CDMenu : public BMenu class CDMenu : public BMenu
{ {
...@@ -130,6 +131,7 @@ class InterfaceWindow : public BWindow ...@@ -130,6 +131,7 @@ class InterfaceWindow : public BWindow
bool fPlaylistIsEmpty; bool fPlaylistIsEmpty;
BFilePanel* fFilePanel; BFilePanel* fFilePanel;
PlayListWindow* fPlaylistWindow; PlayListWindow* fPlaylistWindow;
PreferencesWindow* fPreferencesWindow;
BMenuBar* fMenuBar; BMenuBar* fMenuBar;
BMenuItem* fNextTitleMI; BMenuItem* fNextTitleMI;
BMenuItem* fPrevTitleMI; BMenuItem* fPrevTitleMI;
...@@ -139,6 +141,7 @@ class InterfaceWindow : public BWindow ...@@ -139,6 +141,7 @@ class InterfaceWindow : public BWindow
BMenuItem* fSlowerMI; BMenuItem* fSlowerMI;
BMenuItem* fNormalMI; BMenuItem* fNormalMI;
BMenuItem* fFasterMI; BMenuItem* fFasterMI;
BMenuItem* fPreferencesMI;
BMenu* fAudioMenu; BMenu* fAudioMenu;
BMenu* fNavigationMenu; BMenu* fNavigationMenu;
BMenu* fTitleMenu; BMenu* fTitleMenu;
...@@ -146,6 +149,7 @@ class InterfaceWindow : public BWindow ...@@ -146,6 +149,7 @@ class InterfaceWindow : public BWindow
BMenu* fLanguageMenu; BMenu* fLanguageMenu;
BMenu* fSubtitlesMenu; BMenu* fSubtitlesMenu;
BMenu* fSpeedMenu; BMenu* fSpeedMenu;
BMenu* fSettingsMenu;
bigtime_t fLastUpdateTime; bigtime_t fLastUpdateTime;
BMessage* fSettings; // we keep the message arround BMessage* fSettings; // we keep the message arround
// for forward compatibility // for forward compatibility
......
...@@ -8,6 +8,7 @@ SOURCES_beos = \ ...@@ -8,6 +8,7 @@ SOURCES_beos = \
modules/gui/beos/DrawingTidbits.cpp \ modules/gui/beos/DrawingTidbits.cpp \
modules/gui/beos/TransportButton.cpp \ modules/gui/beos/TransportButton.cpp \
modules/gui/beos/PlayListWindow.cpp \ modules/gui/beos/PlayListWindow.cpp \
modules/gui/beos/PreferencesWindow.cpp \
modules/gui/beos/MediaControlView.cpp \ modules/gui/beos/MediaControlView.cpp \
modules/gui/beos/VlcWrapper.cpp modules/gui/beos/VlcWrapper.cpp
...@@ -19,6 +20,7 @@ noinst_HEADERS += \ ...@@ -19,6 +20,7 @@ noinst_HEADERS += \
modules/gui/beos/MediaControlView.h \ modules/gui/beos/MediaControlView.h \
modules/gui/beos/MsgVals.h \ modules/gui/beos/MsgVals.h \
modules/gui/beos/PlayListWindow.h \ modules/gui/beos/PlayListWindow.h \
modules/gui/beos/PreferencesWindow.h \
modules/gui/beos/TransportButton.h \ modules/gui/beos/TransportButton.h \
modules/gui/beos/VideoWindow.h \ modules/gui/beos/VideoWindow.h \
modules/gui/beos/VlcWrapper.h modules/gui/beos/VlcWrapper.h
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* MsgVals.h * MsgVals.h
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: MsgVals.h,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: MsgVals.h,v 1.3 2002/10/28 16:55:05 titer Exp $
* *
* Authors: Tony Castley <tcastley@mail.powerup.com.au> * Authors: Tony Castley <tcastley@mail.powerup.com.au>
* Stephan Aßmus <stippi@yellowbites.com> * Stephan Aßmus <stippi@yellowbites.com>
...@@ -52,6 +52,7 @@ const uint32 PREV_FILE = 'prfl'; ...@@ -52,6 +52,7 @@ const uint32 PREV_FILE = 'prfl';
const uint32 NEXT_FILE = 'nxfl'; const uint32 NEXT_FILE = 'nxfl';
const uint32 NAVIGATE_PREV = 'navp'; // could be chapter, title or file const uint32 NAVIGATE_PREV = 'navp'; // could be chapter, title or file
const uint32 NAVIGATE_NEXT = 'navn'; // could be chapter, title or file const uint32 NAVIGATE_NEXT = 'navn'; // could be chapter, title or file
const uint32 OPEN_PREFERENCES = 'pref';
const uint32 TOGGLE_ON_TOP = 'ontp'; const uint32 TOGGLE_ON_TOP = 'ontp';
const uint32 TOGGLE_FULL_SCREEN = 'tgfs'; const uint32 TOGGLE_FULL_SCREEN = 'tgfs';
const uint32 RESIZE_50 = 'rshl'; const uint32 RESIZE_50 = 'rshl';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: VideoOutput.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: VideoOutput.cpp,v 1.3 2002/10/28 16:55:05 titer Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -150,7 +150,8 @@ class BackgroundView : public BView ...@@ -150,7 +150,8 @@ class BackgroundView : public BView
/***************************************************************************** /*****************************************************************************
* VideoWindow constructor and destructor * VideoWindow constructor and destructor
*****************************************************************************/ *****************************************************************************/
VideoWindow::VideoWindow(int v_width, int v_height, BRect frame) VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
vout_thread_t *p_videoout)
: BWindow(frame, NULL, B_TITLED_WINDOW, B_NOT_CLOSABLE | B_NOT_MINIMIZABLE), : BWindow(frame, NULL, B_TITLED_WINDOW, B_NOT_CLOSABLE | B_NOT_MINIMIZABLE),
i_width(frame.IntegerWidth()), i_width(frame.IntegerWidth()),
i_height(frame.IntegerHeight()), i_height(frame.IntegerHeight()),
...@@ -165,6 +166,8 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame) ...@@ -165,6 +166,8 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame)
fInterfaceShowing(false), fInterfaceShowing(false),
fInitStatus(B_ERROR) fInitStatus(B_ERROR)
{ {
p_vout = p_videoout;
// create the view to do the display // create the view to do the display
view = new VLCView( Bounds() ); view = new VLCView( Bounds() );
...@@ -477,8 +480,7 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode) ...@@ -477,8 +480,7 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
BRect bitmapFrame( 0, 0, width, height ); BRect bitmapFrame( 0, 0, width, height );
// read from config, if we are supposed to use overlay at all // read from config, if we are supposed to use overlay at all
int noOverlay = 0; int noOverlay = !config_GetInt( p_vout, "overlay" );
/* noOverlay = !config_GetInt( , "overlay" ); */
// test for overlay capability // test for overlay capability
for (int i = 0; i < COLOR_COUNT; i++) for (int i = 0; i < COLOR_COUNT; i++)
{ {
...@@ -1262,7 +1264,8 @@ static int BeosOpenDisplay( vout_thread_t *p_vout ) ...@@ -1262,7 +1264,8 @@ static int BeosOpenDisplay( vout_thread_t *p_vout )
p_vout->p_sys->i_height - 1, p_vout->p_sys->i_height - 1,
BRect( 20, 50, BRect( 20, 50,
20 + p_vout->i_window_width - 1, 20 + p_vout->i_window_width - 1,
50 + p_vout->i_window_height - 1 )); 50 + p_vout->i_window_height - 1 ),
p_vout );
if( p_vout->p_sys->p_window == NULL ) if( p_vout->p_sys->p_window == NULL )
{ {
msg_Err( p_vout, "cannot allocate VideoWindow" ); msg_Err( p_vout, "cannot allocate VideoWindow" );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* VideoWindow.h: BeOS video window class prototype * VideoWindow.h: BeOS video window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: VideoWindow.h,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: VideoWindow.h,v 1.3 2002/10/28 16:55:05 titer Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -83,7 +83,8 @@ class VideoWindow : public BWindow ...@@ -83,7 +83,8 @@ class VideoWindow : public BWindow
public: public:
VideoWindow(int v_width, VideoWindow(int v_width,
int v_height, int v_height,
BRect frame); BRect frame,
vout_thread_t *p_vout);
virtual ~VideoWindow(); virtual ~VideoWindow();
// BWindow // BWindow
...@@ -145,14 +146,14 @@ private: ...@@ -145,14 +146,14 @@ private:
int32 height; int32 height;
}; };
struct vout_thread_s *p_vout; vout_thread_t *p_vout;
int32 fTrueWidth; // incomming bitmap size int32 fTrueWidth; // incomming bitmap size
int32 fTrueHeight; int32 fTrueHeight;
bool fCorrectAspect; bool fCorrectAspect;
window_feel fCachedFeel; window_feel fCachedFeel;
bool fInterfaceShowing; bool fInterfaceShowing;
status_t fInitStatus; status_t fInitStatus;
}; };
#endif // BEOS_VIDEO_WINDOW_H #endif // BEOS_VIDEO_WINDOW_H
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment