Commit 3436a50b authored by Eric Petit's avatar Eric Petit

* ALL: more intensive use of the VLCWrapper class

 * PreferencesWindow.*: renamed a few variables (using some of the
   OpenTracker conventions)
 * clean up
parent d6b20103
...@@ -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.4 2002/10/30 06:12:27 titer Exp $ * $Id: Interface.cpp,v 1.5 2002/11/26 01:06:08 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>
...@@ -72,12 +72,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this ) ...@@ -72,12 +72,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
return( 1 ); return( 1 );
} }
p_intf->p_sys->p_input = NULL; p_intf->p_sys->p_wrapper = new Intf_VLCWrapper( p_intf );
p_intf->p_sys->p_aout = NULL;
p_intf->p_sys->p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_intf->p_sys->p_vlc_wrapper = new Intf_VLCWrapper( p_intf );
p_intf->pf_run = Run; p_intf->pf_run = Run;
...@@ -110,26 +105,12 @@ void E_(CloseIntf) ( vlc_object_t *p_this ) ...@@ -110,26 +105,12 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
{ {
intf_thread_t *p_intf = (intf_thread_t*) p_this; intf_thread_t *p_intf = (intf_thread_t*) p_this;
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
if( p_intf->p_sys->p_playlist )
{
vlc_object_release( p_intf->p_sys->p_playlist );
}
if( p_intf->p_sys->p_aout )
{
vlc_object_release( p_intf->p_sys->p_aout );
}
/* Destroy the interface window */ /* Destroy the interface window */
p_intf->p_sys->p_window->Lock(); p_intf->p_sys->p_window->Lock();
p_intf->p_sys->p_window->Quit(); p_intf->p_sys->p_window->Quit();
/* Destroy structure */ /* Destroy structure */
delete p_intf->p_sys->p_wrapper;
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
...@@ -141,33 +122,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -141,33 +122,8 @@ 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 ) if( p_intf->p_sys->p_wrapper->UpdateInputAndAOut() )
{ {
p_intf->p_sys->p_input =
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
}
if( p_intf->p_sys->p_aout == NULL )
{
p_intf->p_sys->p_aout =
(aout_instance_t*)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
}
/* Update the input */
if( p_intf->p_sys->p_input != NULL )
{
if( p_intf->p_sys->p_input->b_dead )
{
vlc_object_release( p_intf->p_sys->p_input );
p_intf->p_sys->p_input = NULL;
if( p_intf->p_sys->p_aout )
{
vlc_object_release( p_intf->p_sys->p_aout );
p_intf->p_sys->p_aout = NULL;
}
}
/* Manage the slider */ /* Manage the slider */
p_intf->p_sys->p_window->updateInterface(); p_intf->p_sys->p_window->updateInterface();
} }
......
This diff is collapsed.
...@@ -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.4 2002/10/30 00:59:21 titer Exp $ * $Id: InterfaceWindow.h,v 1.5 2002/11/26 01:06:08 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>
...@@ -125,7 +125,6 @@ class InterfaceWindow : public BWindow ...@@ -125,7 +125,6 @@ class InterfaceWindow : public BWindow
intf_thread_t* p_intf; intf_thread_t* p_intf;
es_descriptor_t* p_spu_es; es_descriptor_t* p_spu_es;
input_thread_t* fInputThread;
bool fPlaylistIsEmpty; bool fPlaylistIsEmpty;
BFilePanel* fFilePanel; BFilePanel* fFilePanel;
...@@ -153,7 +152,7 @@ class InterfaceWindow : public BWindow ...@@ -153,7 +152,7 @@ class InterfaceWindow : public BWindow
BMessage* fSettings; // we keep the message arround BMessage* fSettings; // we keep the message arround
// for forward compatibility // for forward compatibility
Intf_VLCWrapper * p_vlc_wrapper; Intf_VLCWrapper * p_wrapper;
}; };
#endif // BEOS_INTERFACE_WINDOW_H #endif // BEOS_INTERFACE_WINDOW_H
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface * MediaControlView.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.cpp,v 1.6 2002/10/29 17:33:11 titer Exp $ * $Id: MediaControlView.cpp,v 1.7 2002/11/26 01:06:08 titer Exp $
* *
* Authors: Tony Castley <tony@castley.net> * Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com> * Stephan Aßmus <stippi@yellowbites.com>
...@@ -1307,13 +1307,13 @@ PositionInfoView::Pulse() ...@@ -1307,13 +1307,13 @@ PositionInfoView::Pulse()
if ( now - fLastPulseUpdate > 900000 ) if ( now - fLastPulseUpdate > 900000 )
{ {
int32 index, size; int32 index, size;
p_intf->p_sys->p_vlc_wrapper->getPlaylistInfo( index, size ); p_intf->p_sys->p_wrapper->getPlaylistInfo( index, size );
SetFile( index, size ); SetFile( index, size );
p_intf->p_sys->p_vlc_wrapper->getTitleInfo( index, size ); p_intf->p_sys->p_wrapper->getTitleInfo( index, size );
SetTitle( index, size ); SetTitle( index, size );
p_intf->p_sys->p_vlc_wrapper->getChapterInfo( index, size ); p_intf->p_sys->p_wrapper->getChapterInfo( index, size );
SetChapter( index, size ); SetChapter( index, size );
SetTime( p_intf->p_sys->p_vlc_wrapper->getTimeAsString() ); SetTime( p_intf->p_sys->p_wrapper->getTimeAsString() );
fLastPulseUpdate = now; fLastPulseUpdate = now;
} }
} }
......
...@@ -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.3 2002/10/10 23:11:52 titer Exp $ * $Id: PlayListWindow.cpp,v 1.4 2002/11/26 01:06:08 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>
...@@ -57,15 +57,15 @@ enum ...@@ -57,15 +57,15 @@ enum
* PlayListWindow::PlayListWindow * PlayListWindow::PlayListWindow
*****************************************************************************/ *****************************************************************************/
PlayListWindow::PlayListWindow( BRect frame, const char* name, PlayListWindow::PlayListWindow( BRect frame, const char* name,
playlist_t *playlist,
InterfaceWindow* mainWindow, InterfaceWindow* mainWindow,
intf_thread_t *p_interface ) 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 ),
fMainWindow( mainWindow ) fMainWindow( mainWindow )
{ {
this->p_intf = p_interface; p_intf = p_interface;
p_wrapper = p_intf->p_sys->p_wrapper;
SetName( "playlist" ); SetName( "playlist" );
// set up the main menu bar // set up the main menu bar
...@@ -242,9 +242,9 @@ PlayListWindow::UpdatePlaylist( bool rebuild ) ...@@ -242,9 +242,9 @@ PlayListWindow::UpdatePlaylist( bool rebuild )
delete item; delete item;
// 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 < p_wrapper->PlaylistSize(); i++ )
fListView->AddItem( new PlaylistItem( fPlaylist->pp_items[i]->psz_name ) ); fListView->AddItem( new PlaylistItem( p_wrapper->PlaylistItemName( i ) ) );
} }
fListView->SetCurrent( fPlaylist->i_index ); fListView->SetCurrent( p_wrapper->PlaylistCurrent() );
fListView->SetPlaying( p_intf->p_sys->p_vlc_wrapper->is_playing() ); fListView->SetPlaying( p_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.3 2002/10/10 23:11:52 titer Exp $ * $Id: PlayListWindow.h,v 1.4 2002/11/26 01:06:08 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>
...@@ -39,7 +39,6 @@ class PlayListWindow : public BWindow ...@@ -39,7 +39,6 @@ class PlayListWindow : public BWindow
public: public:
PlayListWindow(BRect frame, PlayListWindow(BRect frame,
const char* name, const char* name,
playlist_t* playlist,
InterfaceWindow* mainWindow, InterfaceWindow* mainWindow,
intf_thread_t *p_interface ); intf_thread_t *p_interface );
virtual ~PlayListWindow(); virtual ~PlayListWindow();
...@@ -54,14 +53,13 @@ class PlayListWindow : public BWindow ...@@ -54,14 +53,13 @@ class PlayListWindow : public BWindow
void UpdatePlaylist( bool rebuild = false ); void UpdatePlaylist( bool rebuild = false );
private: private:
playlist_t * fPlaylist;
PlaylistView * fListView; PlaylistView * fListView;
BView * fBackgroundView; BView * fBackgroundView;
BMenuBar * fMenuBar; BMenuBar * fMenuBar;
InterfaceWindow * fMainWindow; InterfaceWindow * fMainWindow;
intf_thread_t * p_intf; intf_thread_t * p_intf;
Intf_VLCWrapper * p_wrapper;
}; };
#endif // BEOS_PLAY_LIST_WINDOW_H #endif // BEOS_PLAY_LIST_WINDOW_H
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PreferencesWindow.h * PreferencesWindow.h
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: PreferencesWindow.h,v 1.2 2002/11/23 15:00:54 titer Exp $ * $Id: PreferencesWindow.h,v 1.3 2002/11/26 01:06:08 titer Exp $
* *
* Authors: Eric Petit <titer@videolan.org> * Authors: Eric Petit <titer@videolan.org>
* *
...@@ -47,18 +47,18 @@ class PreferencesWindow : public BWindow ...@@ -47,18 +47,18 @@ class PreferencesWindow : public BWindow
private: private:
void SetDefaults(); void SetDefaults();
void ApplyChanges(); void ApplyChanges();
BView * p_prefs_view; BView * fPrefsView;
BTabView * p_tabview; BTabView * fTabView;
BView * p_ffmpeg_view; BView * fFfmpegView;
BView * p_adjust_view; BView * fAdjustView;
BTab * p_ffmpeg_tab; BTab * fFfmpegTab;
BTab * p_adjust_tab; BTab * fAdjustTab;
BSlider * p_pp_slider; BSlider * fPpSlider;
BSlider * p_contrast_slider; BSlider * fContrastSlider;
BSlider * p_brightness_slider; BSlider * fBrightnessSlider;
BSlider * p_hue_slider; BSlider * fHueSlider;
BSlider * p_saturation_slider; BSlider * fSaturationSlider;
BStringView * p_restart_string; BStringView * fRestartString;
intf_thread_t * p_intf; intf_thread_t * p_intf;
}; };
......
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.6 2002/10/30 00:59:22 titer Exp $ * $Id: VlcWrapper.h,v 1.7 2002/11/26 01:06:08 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>
...@@ -37,10 +37,6 @@ struct intf_sys_t ...@@ -37,10 +37,6 @@ struct intf_sys_t
{ {
InterfaceWindow * p_window; InterfaceWindow * p_window;
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;
vlc_bool_t b_loop; vlc_bool_t b_loop;
...@@ -49,7 +45,7 @@ struct intf_sys_t ...@@ -49,7 +45,7 @@ struct intf_sys_t
int i_saved_volume; int i_saved_volume;
int i_channel; int i_channel;
Intf_VLCWrapper * p_vlc_wrapper; Intf_VLCWrapper * p_wrapper;
}; };
/***************************************************************************** /*****************************************************************************
...@@ -57,7 +53,7 @@ struct intf_sys_t ...@@ -57,7 +53,7 @@ struct intf_sys_t
***************************************************************************** *****************************************************************************
* This class makes the link between the BeOS interface and the vlc core. * This class makes the link between the BeOS interface and the vlc core.
* There is only one Intf_VLCWrapper instance at any time, which is stored * There is only one Intf_VLCWrapper instance at any time, which is stored
* in p_intf->p_sys->p_vlc_wrapper * in p_intf->p_sys->p_wrapper
*****************************************************************************/ *****************************************************************************/
class Intf_VLCWrapper class Intf_VLCWrapper
{ {
...@@ -65,10 +61,20 @@ public: ...@@ -65,10 +61,20 @@ public:
Intf_VLCWrapper( intf_thread_t *p_intf ); Intf_VLCWrapper( intf_thread_t *p_intf );
~Intf_VLCWrapper(); ~Intf_VLCWrapper();
bool UpdateInputAndAOut();
int inputGetStatus(); int inputGetStatus();
int InputStatus();
int InputRate();
int InputTell();
int InputSize();
void inputSeek(); void inputSeek();
/* playlist control */ /* playlist control */
int PlaylistSize();
char *PlaylistItemName( int );
int PlaylistCurrent();
bool playlistPlay(); bool playlistPlay();
void playlistPause(); void playlistPause();
void playlistStop(); void playlistStop();
...@@ -96,6 +102,14 @@ public: ...@@ -96,6 +102,14 @@ public:
void navigatePrev(); void navigatePrev();
void navigateNext(); void navigateNext();
/* DVD */
bool HasTitles();
void PrevTitle();
void NextTitle();
bool HasChapters();
void PrevChapter();
void NextChapter();
/* Stream Control */ /* Stream Control */
void playSlower(); void playSlower();
void playFaster(); void playFaster();
...@@ -133,6 +147,9 @@ public: ...@@ -133,6 +147,9 @@ public:
void channelPrev(); void channelPrev();
private: private:
intf_thread_t *p_intf; intf_thread_t * p_intf;
input_thread_t * p_input;
playlist_t * p_playlist;
aout_instance_t * p_aout;
}; };
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