Commit da6056b3 authored by Stephan Assmus's avatar Stephan Assmus

improved title and chapter navigation in BeOS GUI, added LCD type info view...

improved title and chapter navigation in BeOS GUI, added LCD type info view displaying current file, title, chapter and elapsed time
parent 2822504c
......@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.16.2.4 2002/09/29 12:04:27 titer Exp $
* $Id: InterfaceWindow.cpp,v 1.16.2.5 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -76,7 +76,8 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
fFilePanel( NULL ),
fPlaylistWindow( new PlayListWindow( BRect( 20.0, 20.0, 170.0, 320.0 ),
"Playlist", (playlist_t*)p_main->p_playlist, this ) ),
fLastUpdateTime( system_time() ),
fLastInterfaceUpdate( system_time() ),
fLastSoundUpdate( fLastInterfaceUpdate ),
fSettings( new BMessage( 'sett' ) )
{
// set the title bar
......@@ -494,6 +495,8 @@ bool InterfaceWindow::QuitRequested()
*****************************************************************************/
void InterfaceWindow::updateInterface()
{
fLastInterfaceUpdate = system_time();
input_thread_s* input = p_input_bank->pp_input[0];
if ( input )
{
......@@ -511,6 +514,9 @@ void InterfaceWindow::updateInterface()
input->stream.control.i_rate );
p_mediaControl->SetProgress( input->stream.p_selected_area->i_tell,
input->stream.p_selected_area->i_size );
//printf( "current time: '%s'\n", Intf_VLCWrapper::getTimeAsString() );
_SetMenusEnabled( true, hasChapters, hasTitles );
_UpdateSpeedMenu( input->stream.control.i_rate );
......@@ -524,11 +530,23 @@ void InterfaceWindow::updateInterface()
if ( Intf_VLCWrapper::has_audio() )
{
p_mediaControl->SetAudioEnabled( true );
p_mediaControl->SetMuted( Intf_VLCWrapper::is_muted() );
if ( Intf_VLCWrapper::is_muted() )
p_mediaControl->SetMuted( true );
else
{
p_mediaControl->SetMuted( false );
// take care to update vlc's volume
// (it might have changed without us knowing)
if ( fLastInterfaceUpdate - fLastSoundUpdate > 1000000 )
{
Intf_VLCWrapper::set_volume( p_mediaControl->GetVolume() );
fLastSoundUpdate = fLastInterfaceUpdate;
}
}
} else
p_mediaControl->SetAudioEnabled( false );
if ( input != fInputThread )
if ( input != fInputThread ) // unreliable!!!
{
fInputThread = input;
_InputStreamChanged();
......@@ -557,8 +575,6 @@ void InterfaceWindow::updateInterface()
}
if ( input != fInputThread )
fInputThread = input;
fLastUpdateTime = system_time();
}
/*****************************************************************************
......@@ -567,7 +583,7 @@ void InterfaceWindow::updateInterface()
bool
InterfaceWindow::IsStopped() const
{
return (system_time() - fLastUpdateTime > INTERFACE_UPDATE_TIMEOUT);
return (system_time() - fLastInterfaceUpdate > INTERFACE_UPDATE_TIMEOUT);
}
/*****************************************************************************
......@@ -1117,17 +1133,17 @@ void ChapterMenu::AttachedToWindow()
// lock stream access
vlc_mutex_lock( &input->stream.stream_lock );
// populate menu according to current stream
int32 numChapters = input->stream.p_selected_area->i_part_nb;
int32 numChapters = input->stream.p_selected_area->i_part_nb - 1;
if ( numChapters > 1 )
{
for ( int32 i = 0; i < numChapters; i++ )
{
BMessage* message = new BMessage( TOGGLE_CHAPTER );
message->AddInt32( "index", i );
message->AddInt32( "index", i + 1 );
BString helper( "" );
helper << i + 1;
BMenuItem* item = new BMenuItem( helper.String(), message );
item->SetMarked( input->stream.p_selected_area->i_part == i );
item->SetMarked( input->stream.p_selected_area->i_part - 1 == i );
AddItem( item );
}
}
......
......@@ -2,7 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.12.2.4 2002/09/29 12:04:27 titer Exp $
* $Id: InterfaceWindow.h,v 1.12.2.5 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......@@ -142,7 +142,8 @@ class InterfaceWindow : public BWindow
BMenu* fLanguageMenu;
BMenu* fSubtitlesMenu;
BMenu* fSpeedMenu;
bigtime_t fLastUpdateTime;
bigtime_t fLastInterfaceUpdate;
bigtime_t fLastSoundUpdate;
BMessage* fSettings; // we keep the message arround
// for forward compatibility
};
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* MediaControlView.h: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.h,v 1.2.4.2 2002/09/29 12:04:27 titer Exp $
* $Id: MediaControlView.h,v 1.2.4.3 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com>
......@@ -30,6 +30,7 @@
class BBitmap;
class PlayPauseButton;
class PositionInfoView;
class SeekSlider;
class TransportButton;
class VolumeSlider;
......@@ -66,7 +67,8 @@ class MediaControlView : public BBox
BRect _MinFrame() const;
void _LayoutControl(BView* view,
BRect frame,
bool resize = false) const;
bool resizeWidth = false,
bool resizeHeight = false) const;
VolumeSlider* fVolumeSlider;
......@@ -78,6 +80,7 @@ class MediaControlView : public BBox
PlayPauseButton* fPlayPause;
TransportButton* fStop;
TransportButton* fMute;
PositionInfoView* fPositionInfo;
int fCurrentRate;
int fCurrentStatus;
......@@ -165,4 +168,58 @@ class VolumeSlider : public BControl
int32 fMaxValue;
};
class PositionInfoView : public BView
{
public:
PositionInfoView( BRect frame,
const char* name );
virtual ~PositionInfoView();
// BView
virtual void Draw( BRect updateRect );
virtual void ResizeToPreferred();
virtual void GetPreferredSize( float* width,
float* height );
virtual void Pulse();
// PositionInfoView
enum
{
MODE_SMALL,
MODE_BIG,
};
void SetMode( uint32 mode );
void GetBigPreferredSize( float* width,
float* height );
void SetFile( int32 index, int32 size );
void SetTitle( int32 index, int32 size );
void SetChapter( int32 index, int32 size );
void SetTime( int32 seconds );
void SetTime( const char* string );
private:
void _InvalidateContents( uint32 which = 0 );
void _MakeString( BString& into,
int32 index,
int32 maxIndex ) const;
// void _DrawAlignedString( const char* string,
// BRect frame,
// alignment mode = B_ALIGN_LEFT );
uint32 fMode;
int32 fCurrentFileIndex;
int32 fCurrentFileSize;
int32 fCurrentTitleIndex;
int32 fCurrentTitleSize;
int32 fCurrentChapterIndex;
int32 fCurrentChapterSize;
int32 fSeconds;
BString fTimeString;
bigtime_t fLastPulseUpdate;
float fStackedWidthCache;
float fStackedHeightCache;
};
#endif // BEOS_MEDIA_CONTROL_VIEW_H
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.cpp,v 1.1.2.3 2002/09/29 12:04:27 titer Exp $
* $Id: intf_vlc_wrapper.cpp,v 1.1.2.4 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -232,7 +232,7 @@ void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
// first, look for chapters
if ( hasChapters )
{
*canSkipPrev = input->stream.p_selected_area->i_part > 0;
*canSkipPrev = input->stream.p_selected_area->i_part > 1;
*canSkipNext = input->stream.p_selected_area->i_part <
input->stream.p_selected_area->i_part_nb - 1;
}
......@@ -279,7 +279,7 @@ void Intf_VLCWrapper::navigatePrev()
// skip to the previous chapter
currentChapter--;
if ( currentChapter >= 0 )
if ( currentChapter >= 1 )
{
toggleChapter( currentChapter );
hasSkiped = true;
......@@ -579,20 +579,19 @@ void Intf_VLCWrapper::eject(){}
/* playback info */
BString* Intf_VLCWrapper::getTimeAsString()
const char*
Intf_VLCWrapper::getTimeAsString()
{
static char psz_currenttime[ OFFSETTOTIME_MAX_SIZE ];
static char psz_currenttime[ OFFSETTOTIME_MAX_SIZE ];
if( p_input_bank->pp_input[0] == NULL )
{
return (new BString("00:00:00"));
}
input_OffsetToTime( p_input_bank->pp_input[0],
psz_currenttime,
p_input_bank->pp_input[0]->stream.p_selected_area->i_tell );
if( p_input_bank->pp_input[0] == NULL )
return ("-:--:--");
return(new BString(psz_currenttime));
input_OffsetToTime( p_input_bank->pp_input[0],
psz_currenttime,
p_input_bank->pp_input[0]->stream.p_selected_area->i_tell );
return(psz_currenttime);
}
float Intf_VLCWrapper::getTimeAsFloat()
......@@ -639,6 +638,67 @@ BList *Intf_VLCWrapper::playlistAsArray()
return( p_list );
}
// getPlaylistInfo
void
Intf_VLCWrapper::getPlaylistInfo( int32& currentIndex, int32& maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( playlist_t* list = (playlist_t*)p_main->p_playlist )
{
vlc_mutex_lock( &list->change_lock );
maxIndex = list->i_size;
if ( maxIndex > 0 )
currentIndex = list->i_index + 1;
else
maxIndex = -1;
vlc_mutex_unlock( &list->change_lock );
}
}
// getTitleInfo
void
Intf_VLCWrapper::getTitleInfo( int32& currentIndex, int32& maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( input_thread_s* input = p_input_bank->pp_input[0] )
{
vlc_mutex_lock( &input->stream.stream_lock );
maxIndex = input->stream.i_area_nb - 1;
if ( maxIndex > 0)
currentIndex = input->stream.p_selected_area->i_id;
else
maxIndex = -1;
vlc_mutex_unlock( &input->stream.stream_lock );
}
}
// getChapterInfo
void
Intf_VLCWrapper::getChapterInfo( int32& currentIndex, int32& maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( input_thread_s* input = p_input_bank->pp_input[0] )
{
vlc_mutex_lock( &input->stream.stream_lock );
maxIndex = input->stream.p_selected_area->i_part_nb - 1;
if ( maxIndex > 0)
currentIndex = input->stream.p_selected_area->i_part;
else
maxIndex = -1;
vlc_mutex_unlock( &input->stream.stream_lock );
}
}
/* open file/disc/network */
void Intf_VLCWrapper::openFiles( BList* o_files, bool replace )
{
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.h,v 1.1.2.3 2002/09/29 12:04:27 titer Exp $
* $Id: intf_vlc_wrapper.h,v 1.1.2.4 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -83,11 +83,17 @@ public:
static void eject();
/* playback info */
static BString* getTimeAsString();
static const char* getTimeAsString();
static float getTimeAsFloat();
static void setTimeAsFloat( float i_offset );
static bool playlistPlaying();
static BList* playlistAsArray();
static void getPlaylistInfo( int32& currentIndex,
int32& maxIndex );
static void getTitleInfo( int32& currentIndex,
int32& maxIndex );
static void getChapterInfo( int32& currentIndex,
int32& maxIndex );
/* open file/disc/network */
static void openFiles( BList *o_files, bool replace = true );
......
......@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spu_decoder.c,v 1.24.2.5 2002/09/29 12:04:28 titer Exp $
* $Id: spu_decoder.c,v 1.24.2.6 2002/10/09 15:29:51 stippi Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
......@@ -1145,11 +1145,9 @@ static void RenderSPU( const vout_thread_t *p_vout, picture_t *p_pic,
/* NVidia overlay, no scaling */
case FOURCC_YUY2:
p_dest = p_pic->p->p_pixels +
+ ( p_spu->i_y + p_spu->i_height ) * p_pic->p->i_pitch
// * bytes per line
+ ( p_spu->i_x + p_spu->i_width ) * 2; // * bytes per pixel
p_dest = p_pic->p->p_pixels
+ ( p_spu->i_y + p_spu->i_height ) * p_pic->p->i_pitch // * bytes per line
+ ( p_spu->i_x + p_spu->i_width ) * 2; // * bytes per pixel
/* Draw until we reach the bottom of the subtitle */
for( i_y = p_spu->i_height * p_pic->p->i_pitch / 2;
i_y ;
......
No preview for this file type
......@@ -2,7 +2,7 @@
* beos_init.cpp: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: beos_specific.cpp,v 1.18.2.2 2002/09/29 12:04:28 titer Exp $
* $Id: beos_specific.cpp,v 1.18.2.3 2002/10/09 15:29:52 stippi Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
*
......@@ -109,11 +109,11 @@ void system_Configure( void )
*****************************************************************************/
void system_End( void )
{
free( psz_program_path );
free( psz_program_path );
/* Tell the BApplication to die */
be_app->PostMessage( B_QUIT_REQUESTED );
vlc_thread_join( app_thread );
/* Tell the BApplication to die */
be_app->PostMessage( B_QUIT_REQUESTED );
vlc_thread_join( app_thread );
}
/*****************************************************************************
......@@ -131,9 +131,9 @@ char * system_GetProgramPath( void )
*****************************************************************************/
static void system_AppThread( void * args )
{
new VlcApplication("application/x-vnd.Ink-vlc");
be_app->Run();
delete be_app;
new VlcApplication( "application/x-vnd.Ink-vlc" );
be_app->Run();
delete be_app;
}
} /* extern "C" */
......
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