Commit 87d223aa authored by Tony Castley's avatar Tony Castley

Stopped more than one playlist being opened.

Fixed segfault on exit with playlist open.
Corrected size of output window.
parent 108467bf
......@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.16 2002/05/16 11:38:42 tcastley Exp $
* $Id: InterfaceWindow.cpp,v 1.16.2.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -53,8 +53,9 @@ extern "C"
/* BeOS interface headers */
#include "MsgVals.h"
#include "MediaControlView.h"
#include "InterfaceWindow.h"
#include "PlayListWindow.h"
#include "InterfaceWindow.h"
/*****************************************************************************
* InterfaceWindow
......@@ -67,6 +68,7 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
| B_ASYNCHRONOUS_CONTROLS )
{
file_panel = NULL;
playlist_window = NULL;
p_intf = p_interface;
BRect controlRect(0,0,0,0);
b_empty_playlist = (p_main->p_playlist->i_size < 0);
......@@ -149,6 +151,7 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
InterfaceWindow::~InterfaceWindow()
{
if (playlist_window) playlist_window->ReallyQuit();
}
/*****************************************************************************
......@@ -208,9 +211,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case OPEN_PLAYLIST:
{
BRect rect(20,20,320,420);
PlayListWindow* playlist_window = new PlayListWindow(rect,
"Playlist", (playlist_t *)p_main->p_playlist);
playlist_window->Show();
playlist_window = PlayListWindow::getPlayList(rect,
"Playlist", (playlist_t *)p_main->p_playlist);
playlist_window->Show();
}
break;
case OPEN_DVD:
......
......@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.12 2002/03/22 13:16:35 tcastley Exp $
* $Id: InterfaceWindow.h,v 1.12.2.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -23,6 +23,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
class MediaControlView;
class PlayListWindow;
class CDMenu : public BMenu
{
......@@ -65,6 +66,7 @@ private:
intf_thread_t *p_intf;
bool b_empty_playlist;
BFilePanel *file_panel;
PlayListWindow* playlist_window;
BMenuItem *miOnTop;
es_descriptor_t * p_audio_es;
es_descriptor_t * p_spu_es;
......
......@@ -2,7 +2,7 @@
* PlayListWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.cpp,v 1.5 2001/12/30 07:09:54 sam Exp $
* $Id: PlayListWindow.cpp,v 1.5.2.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -43,12 +43,22 @@ extern "C"
/* BeOS interface headers */
#include "InterfaceWindow.h"
#include "PlayListWindow.h"
#include "MsgVals.h"
#include "PlayListWindow.h"
/*****************************************************************************
* PlayListWindow
*****************************************************************************/
PlayListWindow *PlayListWindow::getPlayList( BRect frame, const char *name,
playlist_t *p_pl)
{
static PlayListWindow *one_playlist;
if (one_playlist == NULL)
{
one_playlist = new PlayListWindow(frame, name, p_pl);
}
return one_playlist;
}
PlayListWindow::PlayListWindow( BRect frame, const char *name,
playlist_t *p_pl)
......@@ -144,3 +154,16 @@ void PlayListWindow::MessageReceived( BMessage * p_message )
break;
}
}
bool PlayListWindow::QuitRequested()
{
Hide();
return false;
}
void PlayListWindow::ReallyQuit()
{
Hide();
Lock();
Quit();
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
* PlayListWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.h,v 1.1 2001/06/15 09:07:10 tcastley Exp $
* $Id: PlayListWindow.h,v 1.1.4.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -26,13 +26,17 @@ class CDMenu;
class PlayListWindow : public BWindow
{
public:
PlayListWindow( BRect frame, const char *name, playlist_t *p_pl);
static PlayListWindow *getPlayList(BRect frame, const char *name,
playlist_t *p_pl);
~PlayListWindow();
bool QuitRequested();
void ReallyQuit();
// standard window member
virtual void MessageReceived(BMessage *message);
private:
PlayListWindow( BRect frame, const char *name, playlist_t *p_pl);
playlist_t *p_playlist;
BListView *p_listview;
BFilePanel *file_panel;
......
......@@ -2,7 +2,7 @@
* VideoWindow.h: BeOS video window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: VideoWindow.h,v 1.19 2002/05/20 11:21:01 tcastley Exp $
* $Id: VideoWindow.h,v 1.19.2.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -74,6 +74,7 @@ public:
void drawBuffer(int bufferIndex);
void WindowActivated(bool active);
int SelectDrawingMode(int width, int height);
bool QuitRequested();
// this is the hook controling direct screen connection
int32 i_width; // incomming bitmap size
......
......@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.58 2002/05/30 08:17:04 gbazin Exp $
* $Id: vout_beos.cpp,v 1.58.2.1 2002/06/01 10:12:10 tcastley Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -153,6 +153,11 @@ VideoWindow::~VideoWindow()
delete bitmap[2];
}
bool VideoWindow::QuitRequested()
{
return true;
}
void VideoWindow::drawBuffer(int bufferIndex)
{
status_t status;
......@@ -178,7 +183,7 @@ void VideoWindow::drawBuffer(int bufferIndex)
&key, B_FOLLOW_ALL,
B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL|
B_OVERLAY_TRANSFER_CHANNEL);
view->SetViewColor(key);
//view->SetViewColor(key);
}
else
{
......@@ -284,7 +289,7 @@ int VideoWindow::SelectDrawingMode(int width, int height)
{
if (noOverlay) break;
bitmap[0] = new BBitmap ( BRect( 0, 0, width, height ),
B_BITMAP_WILL_OVERLAY|B_BITMAP_RESERVE_OVERLAY_CHANNEL,
B_BITMAP_WILL_OVERLAY,
colspace[i].colspace);
if(bitmap[0] && bitmap[0]->InitCheck() == B_OK)
......@@ -573,8 +578,8 @@ static int BeosOpenDisplay( vout_thread_t *p_vout )
p_vout->p_sys->p_window = new VideoWindow( p_vout->p_sys->i_width - 1,
p_vout->p_sys->i_height - 1,
BRect( 20, 50,
20 + p_vout->i_window_width -1,
50 + p_vout->i_window_height ));
20 + p_vout->i_window_width - 1,
50 + p_vout->i_window_height - 1 ));
if( p_vout->p_sys->p_window == NULL )
{
......@@ -602,6 +607,7 @@ static void BeosCloseDisplay( vout_thread_t *p_vout )
p_win->Hide();
p_win->Quit();
}
p_win = NULL;
}
......
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