summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/lib.cpp
authorsimon <simon>2002-12-13 23:07:43 (UTC)
committer simon <simon>2002-12-13 23:07:43 (UTC)
commit2e922ec81282a735a04ca1e822329c615b979ebf (patch) (unidiff)
tree742b662eb9d441aec1a12f2d3b531245b934cdb1 /noncore/multimedia/opieplayer2/lib.cpp
parent2e91febca20a3b550d06ba33a4d41b40555a8bbf (diff)
downloadopie-2e922ec81282a735a04ca1e822329c615b979ebf.zip
opie-2e922ec81282a735a04ca1e822329c615b979ebf.tar.gz
opie-2e922ec81282a735a04ca1e822329c615b979ebf.tar.bz2
- fill in some code on the threading side. not activated, yet
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index cef46a1..84194b7 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -96,13 +96,14 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
96 else 96 else
97 assert( false ); 97 assert( false );
98} 98}
99 99
100void Lib::run() 100void Lib::run()
101{ 101{
102 assert( false ); 102 initialize();
103 m_initialized = true;
103} 104}
104 105
105void Lib::initialize() 106void Lib::initialize()
106{ 107{
107 m_duringInitialization = true; 108 m_duringInitialization = true;
108 m_xine = xine_new( ); 109 m_xine = xine_new( );
@@ -280,12 +281,22 @@ QString Lib::metaInfo( int number) const {
280int Lib::error() const { 281int Lib::error() const {
281 assert( m_initialized ); 282 assert( m_initialized );
282 283
283 return xine_get_error( m_stream ); 284 return xine_get_error( m_stream );
284}; 285};
285 286
287void Lib::ensureInitialized()
288{
289 if ( m_initialized )
290 return;
291
292 qDebug( "waiting for initialization thread to finish" );
293 wait();
294 qDebug( "initialization thread finished!" );
295}
296
286void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) 297void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType )
287{ 298{
288 assert( sendType == ThreadUtil::Channel::OneWay ); 299 assert( sendType == ThreadUtil::Channel::OneWay );
289 handleXineEvent( msg->type() ); 300 handleXineEvent( msg->type() );
290 delete msg; 301 delete msg;
291} 302}