Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 8afb318..f1b9773 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp @@ -32,17 +32,17 @@ */ #include "xinevideowidget.h" #include "frame.h" #include "lib.h" /* OPIE */ #include <opie2/odebug.h> -using namespace Opie::Core; +#include <qpe/global.h> /* QT */ #include <qtextstream.h> #include <qdir.h> #include <qgfx_qws.h> /* STD */ #include <assert.h> @@ -321,29 +321,39 @@ void Lib::setWidget( XineVideoWidget *widget ) resize ( m_wid-> size ( ) ); ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); m_wid->repaint(); } void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) { assert( sendType == ThreadUtil::Channel::OneWay ); - handleXineEvent( msg->type() ); + handleXineEvent( msg->type(), msg->data(), msg->msg() ); delete msg; } void Lib::handleXineEvent( const xine_event_t* t ) { - send( new ThreadUtil::ChannelMessage( t->type ), OneWay ); + int prog = -1; const char* name = 0; + if ( t->type == XINE_EVENT_PROGRESS ) { + xine_progress_data_t *pt = static_cast<xine_progress_data_t*>( t->data ); + prog = pt->percent; + name = pt->description; + } + + send( new ThreadUtil::ChannelMessage( t->type, prog, name ), OneWay ); } -void Lib::handleXineEvent( int type ) { +void Lib::handleXineEvent( int type, int data, const char* name ) { assert( m_initialized ); if ( type == XINE_EVENT_UI_PLAYBACK_FINISHED ) { emit stopped(); + }else if ( type == XINE_EVENT_PROGRESS ) { + QString str = name == 0 ? QString::null : QString::fromUtf8( name ); + Global::statusMessage( tr( "Progress: %1 %2" ).arg( name, data ) );; } } void Lib::setShowVideo( bool video ) { assert( m_initialized ); m_video = video; |