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 @@
* intf_beos.cpp: beos interface
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
......@@ -72,12 +72,7 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
return( 1 );
}
p_intf->p_sys->p_input = NULL;
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->p_sys->p_wrapper = new Intf_VLCWrapper( p_intf );
p_intf->pf_run = Run;
......@@ -110,26 +105,12 @@ void E_(CloseIntf) ( vlc_object_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 */
p_intf->p_sys->p_window->Lock();
p_intf->p_sys->p_window->Quit();
/* Destroy structure */
delete p_intf->p_sys->p_wrapper;
free( p_intf->p_sys );
}
......@@ -141,33 +122,8 @@ static void Run( intf_thread_t *p_intf )
{
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 );
}
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_wrapper->UpdateInputAndAOut() )
{
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 */
p_intf->p_sys->p_window->updateInterface();
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
* 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>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -125,7 +125,6 @@ class InterfaceWindow : public BWindow
intf_thread_t* p_intf;
es_descriptor_t* p_spu_es;
input_thread_t* fInputThread;
bool fPlaylistIsEmpty;
BFilePanel* fFilePanel;
......@@ -153,7 +152,7 @@ class InterfaceWindow : public BWindow
BMessage* fSettings; // we keep the message arround
// for forward compatibility
Intf_VLCWrapper * p_vlc_wrapper;
Intf_VLCWrapper * p_wrapper;
};
#endif // BEOS_INTERFACE_WINDOW_H
......@@ -2,7 +2,7 @@
* MediaControlView.cpp: beos interface
*****************************************************************************
* 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>
* Stephan Aßmus <stippi@yellowbites.com>
......@@ -1307,13 +1307,13 @@ PositionInfoView::Pulse()
if ( now - fLastPulseUpdate > 900000 )
{
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 );
p_intf->p_sys->p_vlc_wrapper->getTitleInfo( index, size );
p_intf->p_sys->p_wrapper->getTitleInfo( 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 );
SetTime( p_intf->p_sys->p_vlc_wrapper->getTimeAsString() );
SetTime( p_intf->p_sys->p_wrapper->getTimeAsString() );
fLastPulseUpdate = now;
}
}
......
......@@ -2,7 +2,7 @@
* PlayListWindow.cpp: beos interface
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
......@@ -57,15 +57,15 @@ enum
* PlayListWindow::PlayListWindow
*****************************************************************************/
PlayListWindow::PlayListWindow( BRect frame, const char* name,
playlist_t *playlist,
InterfaceWindow* mainWindow,
intf_thread_t *p_interface )
: BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_WILL_ACCEPT_FIRST_CLICK | B_ASYNCHRONOUS_CONTROLS ),
fPlaylist( playlist ),
fMainWindow( mainWindow )
{
this->p_intf = p_interface;
p_intf = p_interface;
p_wrapper = p_intf->p_sys->p_wrapper;
SetName( "playlist" );
// set up the main menu bar
......@@ -242,9 +242,9 @@ PlayListWindow::UpdatePlaylist( bool rebuild )
delete item;
// rebuild listview from VLC's playlist
for ( int i = 0; i < fPlaylist->i_size; i++ )
fListView->AddItem( new PlaylistItem( fPlaylist->pp_items[i]->psz_name ) );
for ( int i = 0; i < p_wrapper->PlaylistSize(); i++ )
fListView->AddItem( new PlaylistItem( p_wrapper->PlaylistItemName( i ) ) );
}
fListView->SetCurrent( fPlaylist->i_index );
fListView->SetPlaying( p_intf->p_sys->p_vlc_wrapper->is_playing() );
fListView->SetCurrent( p_wrapper->PlaylistCurrent() );
fListView->SetPlaying( p_wrapper->is_playing() );
}
......@@ -2,7 +2,7 @@
* PlayListWindow.h: BeOS interface window class prototype
*****************************************************************************
* 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>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -39,7 +39,6 @@ class PlayListWindow : public BWindow
public:
PlayListWindow(BRect frame,
const char* name,
playlist_t* playlist,
InterfaceWindow* mainWindow,
intf_thread_t *p_interface );
virtual ~PlayListWindow();
......@@ -54,14 +53,13 @@ class PlayListWindow : public BWindow
void UpdatePlaylist( bool rebuild = false );
private:
playlist_t * fPlaylist;
PlaylistView * fListView;
BView * fBackgroundView;
BMenuBar * fMenuBar;
InterfaceWindow * fMainWindow;
intf_thread_t * p_intf;
Intf_VLCWrapper * p_wrapper;
};
#endif // BEOS_PLAY_LIST_WINDOW_H
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* PreferencesWindow.h
*****************************************************************************
* 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>
*
......@@ -47,18 +47,18 @@ class PreferencesWindow : public BWindow
private:
void SetDefaults();
void ApplyChanges();
BView * p_prefs_view;
BTabView * p_tabview;
BView * p_ffmpeg_view;
BView * p_adjust_view;
BTab * p_ffmpeg_tab;
BTab * p_adjust_tab;
BSlider * p_pp_slider;
BSlider * p_contrast_slider;
BSlider * p_brightness_slider;
BSlider * p_hue_slider;
BSlider * p_saturation_slider;
BStringView * p_restart_string;
BView * fPrefsView;
BTabView * fTabView;
BView * fFfmpegView;
BView * fAdjustView;
BTab * fFfmpegTab;
BTab * fAdjustTab;
BSlider * fPpSlider;
BSlider * fContrastSlider;
BSlider * fBrightnessSlider;
BSlider * fHueSlider;
BSlider * fSaturationSlider;
BStringView * fRestartString;
intf_thread_t * p_intf;
};
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* 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>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -37,10 +37,6 @@ struct intf_sys_t
{
InterfaceWindow * p_window;
input_thread_t * p_input;
playlist_t * p_playlist;
aout_instance_t * p_aout;
/* DVD mode */
vlc_bool_t b_disabled_menus;
vlc_bool_t b_loop;
......@@ -49,7 +45,7 @@ struct intf_sys_t
int i_saved_volume;
int i_channel;
Intf_VLCWrapper * p_vlc_wrapper;
Intf_VLCWrapper * p_wrapper;
};
/*****************************************************************************
......@@ -57,7 +53,7 @@ struct intf_sys_t
*****************************************************************************
* 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
* in p_intf->p_sys->p_vlc_wrapper
* in p_intf->p_sys->p_wrapper
*****************************************************************************/
class Intf_VLCWrapper
{
......@@ -65,10 +61,20 @@ public:
Intf_VLCWrapper( intf_thread_t *p_intf );
~Intf_VLCWrapper();
bool UpdateInputAndAOut();
int inputGetStatus();
int InputStatus();
int InputRate();
int InputTell();
int InputSize();
void inputSeek();
/* playlist control */
int PlaylistSize();
char *PlaylistItemName( int );
int PlaylistCurrent();
bool playlistPlay();
void playlistPause();
void playlistStop();
......@@ -96,6 +102,14 @@ public:
void navigatePrev();
void navigateNext();
/* DVD */
bool HasTitles();
void PrevTitle();
void NextTitle();
bool HasChapters();
void PrevChapter();
void NextChapter();
/* Stream Control */
void playSlower();
void playFaster();
......@@ -133,6 +147,9 @@ public:
void channelPrev();
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