Commit c5bd872c authored by Eric Petit's avatar Eric Petit

Some clean-up. Playlist works again.

parent ae6f2253
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface * intf_beos.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: Interface.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: Interface.cpp,v 1.3 2002/10/10 23:11:52 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>
...@@ -71,6 +71,10 @@ int E_(OpenIntf) ( vlc_object_t *p_this ) ...@@ -71,6 +71,10 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
} }
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_input = NULL;
p_intf->p_sys->p_vlc_wrapper = new Intf_VLCWrapper( p_intf );
p_intf->p_sys->p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_intf->pf_run = Run; p_intf->pf_run = Run;
...@@ -124,6 +128,13 @@ static void Run( intf_thread_t *p_intf ) ...@@ -124,6 +128,13 @@ static void Run( intf_thread_t *p_intf )
{ {
while( !p_intf->b_die ) while( !p_intf->b_die )
{ {
if( p_intf->p_sys->p_input == NULL )
{
p_intf->p_sys->p_input =
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
}
/* Update the input */ /* Update the input */
if( p_intf->p_sys->p_input != NULL ) if( p_intf->p_sys->p_input != NULL )
{ {
...@@ -135,13 +146,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -135,13 +146,6 @@ static void Run( intf_thread_t *p_intf )
/* Manage the slider */ /* Manage the slider */
p_intf->p_sys->p_window->updateInterface(); p_intf->p_sys->p_window->updateInterface();
} }
if( p_intf->p_sys->p_input == NULL )
{
p_intf->p_sys->p_input =
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
}
/* Wait a bit */ /* Wait a bit */
msleep( INTF_IDLE_SLEEP ); msleep( INTF_IDLE_SLEEP );
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PlayListWindow.cpp: beos interface * PlayListWindow.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: PlayListWindow.cpp,v 1.3 2002/10/10 23:11:52 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>
...@@ -58,12 +58,14 @@ enum ...@@ -58,12 +58,14 @@ enum
*****************************************************************************/ *****************************************************************************/
PlayListWindow::PlayListWindow( BRect frame, const char* name, PlayListWindow::PlayListWindow( BRect frame, const char* name,
playlist_t *playlist, playlist_t *playlist,
InterfaceWindow* mainWindow ) InterfaceWindow* mainWindow,
intf_thread_t *p_interface )
: BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, : BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_WILL_ACCEPT_FIRST_CLICK | B_ASYNCHRONOUS_CONTROLS ), B_WILL_ACCEPT_FIRST_CLICK | B_ASYNCHRONOUS_CONTROLS ),
fPlaylist( playlist ), fPlaylist( playlist ),
fMainWindow( mainWindow ) fMainWindow( mainWindow )
{ {
this->p_intf = p_interface;
SetName( "playlist" ); SetName( "playlist" );
// set up the main menu bar // set up the main menu bar
...@@ -222,7 +224,7 @@ void ...@@ -222,7 +224,7 @@ void
PlayListWindow::ReallyQuit() PlayListWindow::ReallyQuit()
{ {
Lock(); Lock();
Hide(); Hide();
Quit(); Quit();
} }
...@@ -232,7 +234,7 @@ PlayListWindow::ReallyQuit() ...@@ -232,7 +234,7 @@ PlayListWindow::ReallyQuit()
void void
PlayListWindow::UpdatePlaylist( bool rebuild ) PlayListWindow::UpdatePlaylist( bool rebuild )
{ {
/* if ( rebuild ) if ( rebuild )
{ {
// remove all items // remove all items
int32 count = fListView->CountItems(); int32 count = fListView->CountItems();
...@@ -241,8 +243,8 @@ PlayListWindow::UpdatePlaylist( bool rebuild ) ...@@ -241,8 +243,8 @@ PlayListWindow::UpdatePlaylist( bool rebuild )
// rebuild listview from VLC's playlist // rebuild listview from VLC's playlist
for ( int i = 0; i < fPlaylist->i_size; i++ ) for ( int i = 0; i < fPlaylist->i_size; i++ )
fListView->AddItem( new PlaylistItem( fPlaylist->p_item[i].psz_name ) ); fListView->AddItem( new PlaylistItem( fPlaylist->pp_items[i]->psz_name ) );
} }
fListView->SetCurrent( fPlaylist->i_index ); fListView->SetCurrent( fPlaylist->i_index );
fListView->SetPlaying( Intf_VLCWrapper::is_playing() ); */ fListView->SetPlaying( p_intf->p_sys->p_vlc_wrapper->is_playing() );
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PlayListWindow.h: BeOS interface window class prototype * PlayListWindow.h: BeOS interface window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PlayListWindow.h,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: PlayListWindow.h,v 1.3 2002/10/10 23:11:52 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>
...@@ -40,7 +40,8 @@ class PlayListWindow : public BWindow ...@@ -40,7 +40,8 @@ class PlayListWindow : public BWindow
PlayListWindow(BRect frame, PlayListWindow(BRect frame,
const char* name, const char* name,
playlist_t* playlist, playlist_t* playlist,
InterfaceWindow* mainWindow ); InterfaceWindow* mainWindow,
intf_thread_t *p_interface );
virtual ~PlayListWindow(); virtual ~PlayListWindow();
// BWindow // BWindow
...@@ -54,11 +55,13 @@ class PlayListWindow : public BWindow ...@@ -54,11 +55,13 @@ class PlayListWindow : public BWindow
private: private:
playlist_t* fPlaylist; playlist_t * fPlaylist;
PlaylistView* fListView; PlaylistView * fListView;
BView* fBackgroundView; BView * fBackgroundView;
BMenuBar* fMenuBar; BMenuBar * fMenuBar;
InterfaceWindow* fMainWindow; InterfaceWindow * fMainWindow;
intf_thread_t * p_intf;
}; };
#endif // BEOS_PLAY_LIST_WINDOW_H #endif // BEOS_PLAY_LIST_WINDOW_H
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port ) * intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: VlcWrapper.h,v 1.2 2002/09/30 18:30:27 titer Exp $ * $Id: VlcWrapper.h,v 1.3 2002/10/10 23:11:52 titer Exp $
* *
* Authors: Florian G. Pflug <fgp@phlo.org> * Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
class InterfaceWindow; class InterfaceWindow;
class Intf_VLCWrapper;
/***************************************************************************** /*****************************************************************************
* intf_sys_t: description and status of FB interface * intf_sys_t: description and status of FB interface
...@@ -33,8 +34,9 @@ struct intf_sys_t ...@@ -33,8 +34,9 @@ struct intf_sys_t
InterfaceWindow * p_window; InterfaceWindow * p_window;
char i_key; char i_key;
/* The input thread */ input_thread_t * p_input;
input_thread_t * p_input; playlist_t * p_playlist;
aout_instance_t * p_aout;
/* DVD mode */ /* DVD mode */
vlc_bool_t b_disabled_menus; vlc_bool_t b_disabled_menus;
...@@ -43,6 +45,8 @@ struct intf_sys_t ...@@ -43,6 +45,8 @@ struct intf_sys_t
int i_part; int i_part;
int i_saved_volume; int i_saved_volume;
int i_channel; int i_channel;
Intf_VLCWrapper * p_vlc_wrapper;
}; };
/* Intf_VLCWrapper is a singleton class /* Intf_VLCWrapper is a singleton class
...@@ -143,8 +147,8 @@ public: ...@@ -143,8 +147,8 @@ public:
void loop(); void loop();
//private: //private:
Intf_VLCWrapper( intf_thread_t *p_if ); Intf_VLCWrapper( intf_thread_t *p_intf );
es_descriptor_t * p_audio_es; es_descriptor_t * p_audio_es;
intf_thread_t *p_intf; intf_thread_t *p_intf;
}; };
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