From ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c Mon Sep 17 00:00:00 2001 From: harlekin Date: Sun, 10 Nov 2002 13:40:33 +0000 Subject: fixed seeking and further adaption to the new api --- diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 1ebbbd8..19b64e8 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -201,7 +201,8 @@ bool Lib::isSeekable() { void Lib::seekTo( int time ) { //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( - xine_play( m_stream, 0, time ); + // since its now milliseconds we need *1000 + xine_play( m_stream, 0, time*1000 ); } diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index 191dbbd..38938a1 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h @@ -90,6 +90,7 @@ namespace XINE { int currentPosition()/*const*/; //in seconds int currentTime()/*const*/; + int length() /*const*/; bool isSeekable()/*const*/; @@ -172,7 +173,9 @@ namespace XINE { int error() /*const*/; signals: + void stopped(); + private: int m_bytes_per_pixel; int m_length, m_pos, m_time; diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index dcdfae6..b1f4811 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c @@ -439,7 +439,7 @@ static int null_gui_data_exchange( xine_vo_driver_t* self, return 0; } -static void null_exit( xine_vo_driver_t* self ){ +static void null_dispose ( xine_vo_driver_t* self ){ null_driver_t* this = (null_driver_t*)self; free ( this ); } @@ -478,7 +478,7 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, vo->vo_driver.set_property = null_set_property; vo->vo_driver.get_property_min_max = null_get_property_min_max; vo->vo_driver.gui_data_exchange = null_gui_data_exchange; - vo->vo_driver.exit = null_exit; + vo->vo_driver.dispose = null_dispose; vo->vo_driver.redraw_needed = null_redraw_needed; @@ -490,9 +490,9 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, return ( xine_vo_driver_t*) vo; } +#if 0 static vo_info_t vo_info_null = { 5, - "null plugin", XINE_VISUAL_TYPE_FB }; @@ -501,6 +501,8 @@ vo_info_t *get_video_out_plugin_info(){ return &vo_info_null; } +#endif + /* this is special for this device */ /** * We know that we will be controled by the XINE LIB++ diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 31ac9dc..03176b3 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -79,6 +79,8 @@ void XineControl::play( const QString& fileName ) { if ( !libXine->play( fileName ) ) { QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); + // toggle stop so the the play button is reset + mediaPlayerState->setPlaying( false ); return; } mediaPlayerState->setPlaying( true ); @@ -225,10 +227,19 @@ QString XineControl::getMetaInfo() { } QString XineControl::getErrorCode() { + int errorCode = libXine->error(); + qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); + if ( errorCode == 1 ) { return tr( "No input plugin found for this media type" ); + } else if ( errorCode == 2 ) { + return tr( "No demux plugin found for this media type" ); + } else if ( errorCode == 3 ) { + return tr( "Demuxing failed for this media type" ); + } else if ( errorCode == 4 ) { + return tr( "Malformed MRL" ); } else { return tr( "Some other error" ); } -- cgit v0.9.0.2