-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 11 |
4 files changed, 21 insertions, 4 deletions
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 @@ -192,25 +192,26 @@ int Lib::currentTime() { int Lib::length() { xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); return m_length/1000; } bool Lib::isSeekable() { return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); } 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 ); } Frame Lib::currentFrame() { Frame frame; return frame; }; QString Lib::metaInfo( int number) { return xine_get_meta_info( m_stream, number ); } 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 @@ -81,24 +81,25 @@ namespace XINE { * XINE_SPEED_SLOW_2 2 * XINE_SPEED_NORMAL 4 * XINE_SPEED_FAST_2 8 *XINE_SPEED_FAST_4 16 */ void setSpeed( int speed = XINE_SPEED_PAUSE ); int status() /*const*/; int currentPosition()/*const*/; //in seconds int currentTime()/*const*/; + int length() /*const*/; bool isSeekable()/*const*/; /** * Whether or not to show video output */ void setShowVideo(bool video); /** * is we show video */ @@ -163,25 +164,27 @@ namespace XINE { Frame currentFrame()/*const*/; /** * Returns the error code * XINE_ERROR_NONE 0 * XINE_ERROR_NO_INPUT_PLUGIN 1 * XINE_ERROR_NO_DEMUXER_PLUGIN 2 * XINE_ERROR_DEMUXER_FAILED 3 */ int error() /*const*/; signals: + void stopped(); + private: int m_bytes_per_pixel; int m_length, m_pos, m_time; int m_major_version, m_minor_version, m_sub_version; bool m_video:1; XineVideoWidget *m_wid; xine_t *m_xine; xine_stream_t *m_stream; xine_cfg_entry_t *m_config; xine_vo_driver_t *m_videoOutput; xine_ao_driver_t* m_audioOutput; xine_event_queue_t *m_queue; 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 @@ -430,25 +430,25 @@ static int null_set_property( xine_vo_driver_t* self, static void null_get_property_min_max( xine_vo_driver_t* self, int property, int *min, int *max ){ *max = 0; *min = 0; } static int null_gui_data_exchange( xine_vo_driver_t* self, int data_type, void *data ){ 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 ); } static int null_redraw_needed( xine_vo_driver_t* self ){ return 0; } xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video ){ null_driver_t *vo; vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); @@ -469,47 +469,49 @@ xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, vo->frameDis = NULL; /* install callback handlers*/ vo->vo_driver.get_capabilities = null_get_capabilities; vo->vo_driver.alloc_frame = null_alloc_frame; vo->vo_driver.update_frame_format = null_update_frame_format; vo->vo_driver.display_frame = null_display_frame; vo->vo_driver.overlay_blend = null_overlay_blend; vo->vo_driver.get_property = null_get_property; 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; /* capabilities */ vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, vo->yuv2rgb_cmap); return ( xine_vo_driver_t*) vo; } +#if 0 static vo_info_t vo_info_null = { 5, - "null plugin", XINE_VISUAL_TYPE_FB }; vo_info_t *get_video_out_plugin_info(){ vo_info_null.description = _("xine video output plugin using null device"); return &vo_info_null; } +#endif + /* this is special for this device */ /** * We know that we will be controled by the XINE LIB++ */ /** * */ int null_is_showing_video( xine_vo_driver_t* self ){ null_driver_t* this = (null_driver_t*)self; return this->m_show_video; } 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 @@ -70,24 +70,26 @@ XineControl::~XineControl() { delete libXine; } void XineControl::play( const QString& fileName ) { hasVideoChannel = FALSE; hasAudioChannel = FALSE; m_fileName = fileName; //qDebug("<<FILENAME: " + 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 ); char whichGui; // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); if ( !libXine->hasVideo() ) { whichGui = 'a'; qDebug("HAS AUDIO"); libXine->setShowVideo( false ); hasAudioChannel = TRUE; } else { @@ -216,28 +218,37 @@ QString XineControl::getMetaInfo() { if ( !libXine->metaInfo( 4 ).isEmpty() ) { returnString += tr( " Album: " + libXine->metaInfo( 4 ) ); } if ( !libXine->metaInfo( 5 ).isEmpty() ) { returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); } return returnString; } 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" ); } } /** * Seek to a position in the track * @param second the second to jump to */ void XineControl::seekTo( long second ) { libXine->seekTo( (int)second ); } |