Commit cbf5b53e authored by Eric Petit's avatar Eric Petit

- Added LCD info view from 0.4.x

parent 4b7645e0
......@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.4 2002/10/28 16:55:05 titer Exp $
* $Id: InterfaceWindow.cpp,v 1.5 2002/10/28 19:42:24 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -86,7 +86,8 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
SetTitle( VOUT_TITLE );
// the media control view
p_mediaControl = new MediaControlView( BRect( 0.0, 0.0, 250.0, 50.0 ) );
p_mediaControl = new MediaControlView( BRect( 0.0, 0.0, 250.0, 50.0 ),
p_intf );
p_mediaControl->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
p_mediaControl->SetEnabled( !fPlaylistIsEmpty );
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* MediaControlView.h: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: MediaControlView.h,v 1.2 2002/09/30 18:30:27 titer Exp $
* $Id: MediaControlView.h,v 1.3 2002/10/28 19:42:24 titer 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;
......@@ -37,7 +38,7 @@ class VolumeSlider;
class MediaControlView : public BBox
{
public:
MediaControlView( BRect frame );
MediaControlView( BRect frame, intf_thread_t *p_intf );
virtual ~MediaControlView();
// BBox
......@@ -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,11 +80,14 @@ class MediaControlView : public BBox
PlayPauseButton* fPlayPause;
TransportButton* fStop;
TransportButton* fMute;
PositionInfoView* fPositionInfo;
int fCurrentRate;
int fCurrentStatus;
float fBottomControlHeight;
BRect fOldBounds;
intf_thread_t * p_intf;
};
class SeekSlider : public BControl
......@@ -165,4 +170,62 @@ class VolumeSlider : public BControl
int32 fMaxValue;
};
class PositionInfoView : public BView
{
public:
PositionInfoView( BRect frame,
const char* name,
intf_thread_t *p_intf );
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;
intf_thread_t * p_intf;
};
#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: VlcWrapper.cpp,v 1.6 2002/10/14 20:09:17 titer Exp $
* $Id: VlcWrapper.cpp,v 1.7 2002/10/28 19:42:24 titer Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -621,20 +621,20 @@ void Intf_VLCWrapper::eject(){}
/* playback info */
BString* Intf_VLCWrapper::getTimeAsString()
const char* Intf_VLCWrapper::getTimeAsString()
{
static char psz_currenttime[ OFFSETTOTIME_MAX_SIZE ];
if( p_intf->p_sys->p_input == NULL )
{
return (new BString("00:00:00"));
return ("-:--:--");
}
input_OffsetToTime( p_intf->p_sys->p_input,
psz_currenttime,
p_intf->p_sys->p_input->stream.p_selected_area->i_tell );
return(new BString(psz_currenttime));
return(psz_currenttime);
}
float Intf_VLCWrapper::getTimeAsFloat()
......@@ -690,6 +690,62 @@ 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_intf->p_sys->p_playlist )
{
maxIndex = list->i_size;
if ( maxIndex > 0 )
currentIndex = list->i_index + 1;
else
maxIndex = -1;
}
}
// getTitleInfo
void
Intf_VLCWrapper::getTitleInfo( int32& currentIndex, int32& maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( input_thread_t* input = p_intf->p_sys->p_input )
{
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_t* input = p_intf->p_sys->p_input )
{
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: VlcWrapper.h,v 1.4 2002/10/14 20:09:17 titer Exp $
* $Id: VlcWrapper.h,v 1.5 2002/10/28 19:42:24 titer Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -118,11 +118,18 @@ public:
void inputSeek();
/* playback info */
BString* getTimeAsString();
const char* getTimeAsString();
float getTimeAsFloat();
void setTimeAsFloat( float i_offset );
bool playlistPlaying();
BList* playlistAsArray();
void getPlaylistInfo( int32& currentIndex,
int32& maxIndex );
void getTitleInfo( int32& currentIndex,
int32& maxIndex );
void getChapterInfo( int32& currentIndex,
int32& maxIndex );
/* open file/disc/network */
void openFiles( BList *o_files, bool replace = true );
......
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