summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
authorzecke <zecke>2004-09-24 15:09:56 (UTC)
committer zecke <zecke>2004-09-24 15:09:56 (UTC)
commit8e903cd3ea735adf066e156462602987691a4c69 (patch) (side-by-side diff)
treeb05fe7cc6d46cbacdc47fe3f0411100076bc8a52 /noncore/multimedia/opieplayer2/lib.cpp
parent478b2ead47a09956cadfacb8f469fb2fdee5531c (diff)
downloadopie-8e903cd3ea735adf066e156462602987691a4c69.zip
opie-8e903cd3ea735adf066e156462602987691a4c69.tar.gz
opie-8e903cd3ea735adf066e156462602987691a4c69.tar.bz2
-Emit Progress from the xine Engine to Global::statusMessage
-Change ThreadUtil to pass data and const char* among threads
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp18
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
@@ -37,7 +37,7 @@
/* OPIE */
#include <opie2/odebug.h>
-using namespace Opie::Core;
+#include <qpe/global.h>
/* QT */
#include <qtextstream.h>
@@ -326,19 +326,29 @@ void Lib::setWidget( XineVideoWidget *widget )
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 ) );;
}
}