author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/multimedia/opieplayer2/lib.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index a42b8e5..5c24dbe 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -97,28 +97,28 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | if ( initMode == InitializeImmediately ) { | 99 | if ( initMode == InitializeImmediately ) { |
100 | initialize(); | 100 | initialize(); |
101 | m_initialized = true; | 101 | m_initialized = true; |
102 | } | 102 | } |
103 | else | 103 | else |
104 | start(); | 104 | start(); |
105 | } | 105 | } |
106 | 106 | ||
107 | void Lib::run() | 107 | void Lib::run() |
108 | { | 108 | { |
109 | qDebug( "Lib::run() started" ); | 109 | odebug << "Lib::run() started" << oendl; |
110 | initialize(); | 110 | initialize(); |
111 | m_initialized = true; | 111 | m_initialized = true; |
112 | qDebug( "Lib::run() finished" ); | 112 | odebug << "Lib::run() finished" << oendl; |
113 | } | 113 | } |
114 | 114 | ||
115 | void Lib::initialize() | 115 | void Lib::initialize() |
116 | { | 116 | { |
117 | m_duringInitialization = true; | 117 | m_duringInitialization = true; |
118 | m_xine = xine_new( ); | 118 | m_xine = xine_new( ); |
119 | 119 | ||
120 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | 120 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; |
121 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); | 121 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); |
122 | 122 | ||
123 | xine_init( m_xine ); | 123 | xine_init( m_xine ); |
124 | 124 | ||
@@ -206,25 +206,25 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { | |||
206 | //m_queue = xine_event_new_queue (m_stream); | 206 | //m_queue = xine_event_new_queue (m_stream); |
207 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 207 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
208 | 208 | ||
209 | if ( !xine_open( m_stream, str.utf8().data() ) ) { | 209 | if ( !xine_open( m_stream, str.utf8().data() ) ) { |
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | return xine_play( m_stream, startPos, start_time); | 212 | return xine_play( m_stream, startPos, start_time); |
213 | } | 213 | } |
214 | 214 | ||
215 | void Lib::stop() { | 215 | void Lib::stop() { |
216 | assert( m_initialized ); | 216 | assert( m_initialized ); |
217 | 217 | ||
218 | qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); | 218 | odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl; |
219 | xine_stop( m_stream ); | 219 | xine_stop( m_stream ); |
220 | } | 220 | } |
221 | 221 | ||
222 | void Lib::pause( bool toggle ) { | 222 | void Lib::pause( bool toggle ) { |
223 | assert( m_initialized ); | 223 | assert( m_initialized ); |
224 | 224 | ||
225 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); | 225 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); |
226 | } | 226 | } |
227 | 227 | ||
228 | int Lib::speed() const { | 228 | int Lib::speed() const { |
229 | assert( m_initialized ); | 229 | assert( m_initialized ); |
230 | 230 | ||
@@ -318,27 +318,27 @@ QString Lib::metaInfo( int number) const { | |||
318 | 318 | ||
319 | int Lib::error() const { | 319 | int Lib::error() const { |
320 | assert( m_initialized ); | 320 | assert( m_initialized ); |
321 | 321 | ||
322 | return xine_get_error( m_stream ); | 322 | return xine_get_error( m_stream ); |
323 | }; | 323 | }; |
324 | 324 | ||
325 | void Lib::ensureInitialized() | 325 | void Lib::ensureInitialized() |
326 | { | 326 | { |
327 | if ( m_initialized ) | 327 | if ( m_initialized ) |
328 | return; | 328 | return; |
329 | 329 | ||
330 | qDebug( "waiting for initialization thread to finish" ); | 330 | odebug << "waiting for initialization thread to finish" << oendl; |
331 | wait(); | 331 | wait(); |
332 | qDebug( "initialization thread finished!" ); | 332 | odebug << "initialization thread finished!" << oendl; |
333 | } | 333 | } |
334 | 334 | ||
335 | void Lib::setWidget( XineVideoWidget *widget ) | 335 | void Lib::setWidget( XineVideoWidget *widget ) |
336 | { | 336 | { |
337 | m_wid = widget; | 337 | m_wid = widget; |
338 | resize ( m_wid-> size ( ) ); | 338 | resize ( m_wid-> size ( ) ); |
339 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); | 339 | ::null_set_mode( m_videoOutput, qt_screen->depth(), qt_screen->pixelType() ); |
340 | m_wid->repaint(); | 340 | m_wid->repaint(); |
341 | } | 341 | } |
342 | 342 | ||
343 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) | 343 | void Lib::receiveMessage( ThreadUtil::ChannelMessage *msg, SendType sendType ) |
344 | { | 344 | { |
@@ -413,20 +413,20 @@ void Lib::xine_event_handler( void* user_data, const xine_event_t* t ) { | |||
413 | ( (Lib*)user_data)->handleXineEvent( t ); | 413 | ( (Lib*)user_data)->handleXineEvent( t ); |
414 | } | 414 | } |
415 | 415 | ||
416 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, | 416 | void Lib::xine_display_frame( void* user_data, uint8_t *frame, |
417 | int width, int height, int bytes ) { | 417 | int width, int height, int bytes ) { |
418 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); | 418 | ( (Lib*)user_data)->drawFrame( frame, width, height, bytes ); |
419 | } | 419 | } |
420 | 420 | ||
421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { | 421 | void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { |
422 | assert( m_initialized ); | 422 | assert( m_initialized ); |
423 | 423 | ||
424 | if ( !m_video ) { | 424 | if ( !m_video ) { |
425 | qWarning("not showing video now"); | 425 | owarn << "not showing video now" << oendl; |
426 | return; | 426 | return; |
427 | } | 427 | } |
428 | 428 | ||
429 | assert( m_wid ); | 429 | assert( m_wid ); |
430 | 430 | ||
431 | m_wid-> setVideoFrame ( frame, width, height, bytes ); | 431 | m_wid-> setVideoFrame ( frame, width, height, bytes ); |
432 | } | 432 | } |