author | harlekin <harlekin> | 2002-11-10 13:40:33 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-10 13:40:33 (UTC) |
commit | ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c (patch) (unidiff) | |
tree | 5bef89c4dc116d09c1864778127ca9106e1f29ae | |
parent | ea3334042e9625c0f67c9a7293a482849f60e4e2 (diff) | |
download | opie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.zip opie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.tar.gz opie-ddfc3c3073216d6a9ef15b26e3836b9c3eb2085c.tar.bz2 |
fixed seeking and further adaption to the new api
-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 | |||
@@ -180,49 +180,50 @@ int Lib::status() { | |||
180 | return xine_get_status( m_stream ); | 180 | return xine_get_status( m_stream ); |
181 | } | 181 | } |
182 | 182 | ||
183 | int Lib::currentPosition() { | 183 | int Lib::currentPosition() { |
184 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); | 184 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); |
185 | return m_pos; | 185 | return m_pos; |
186 | } | 186 | } |
187 | 187 | ||
188 | int Lib::currentTime() { | 188 | int Lib::currentTime() { |
189 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); | 189 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); |
190 | return m_time/1000; | 190 | return m_time/1000; |
191 | } | 191 | } |
192 | 192 | ||
193 | int Lib::length() { | 193 | int Lib::length() { |
194 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); | 194 | xine_get_pos_length( m_stream, &m_pos, &m_time, &m_length ); |
195 | return m_length/1000; | 195 | return m_length/1000; |
196 | } | 196 | } |
197 | 197 | ||
198 | bool Lib::isSeekable() { | 198 | bool Lib::isSeekable() { |
199 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); | 199 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); |
200 | } | 200 | } |
201 | 201 | ||
202 | void Lib::seekTo( int time ) { | 202 | void Lib::seekTo( int time ) { |
203 | //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( | 203 | //xine_trick_mode ( m_stream, XINE_TRICK_MODE_SEEK_TO_TIME, time ); NOT IMPLEMENTED YET IN XINE :_( |
204 | xine_play( m_stream, 0, time ); | 204 | // since its now milliseconds we need *1000 |
205 | xine_play( m_stream, 0, time*1000 ); | ||
205 | } | 206 | } |
206 | 207 | ||
207 | 208 | ||
208 | Frame Lib::currentFrame() { | 209 | Frame Lib::currentFrame() { |
209 | Frame frame; | 210 | Frame frame; |
210 | return frame; | 211 | return frame; |
211 | }; | 212 | }; |
212 | 213 | ||
213 | QString Lib::metaInfo( int number) { | 214 | QString Lib::metaInfo( int number) { |
214 | return xine_get_meta_info( m_stream, number ); | 215 | return xine_get_meta_info( m_stream, number ); |
215 | } | 216 | } |
216 | 217 | ||
217 | int Lib::error() { | 218 | int Lib::error() { |
218 | return xine_get_error( m_stream ); | 219 | return xine_get_error( m_stream ); |
219 | }; | 220 | }; |
220 | 221 | ||
221 | void Lib::handleXineEvent( const xine_event_t* t ) { | 222 | void Lib::handleXineEvent( const xine_event_t* t ) { |
222 | if ( t->type == XINE_EVENT_UI_PLAYBACK_FINISHED ) { | 223 | if ( t->type == XINE_EVENT_UI_PLAYBACK_FINISHED ) { |
223 | emit stopped(); | 224 | emit stopped(); |
224 | } | 225 | } |
225 | } | 226 | } |
226 | 227 | ||
227 | 228 | ||
228 | void Lib::setShowVideo( bool video ) { | 229 | void Lib::setShowVideo( bool video ) { |
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 | |||
@@ -69,48 +69,49 @@ namespace XINE { | |||
69 | int play( const QString& fileName, | 69 | int play( const QString& fileName, |
70 | int startPos = 0, | 70 | int startPos = 0, |
71 | int start_time = 0 ); | 71 | int start_time = 0 ); |
72 | void stop() /*const*/; | 72 | void stop() /*const*/; |
73 | void pause()/*const*/; | 73 | void pause()/*const*/; |
74 | 74 | ||
75 | int speed() /*const*/; | 75 | int speed() /*const*/; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * Set the speed of the stream, if codec supports it | 78 | * Set the speed of the stream, if codec supports it |
79 | * XINE_SPEED_PAUSE 0 | 79 | * XINE_SPEED_PAUSE 0 |
80 | * XINE_SPEED_SLOW_4 1 | 80 | * XINE_SPEED_SLOW_4 1 |
81 | * XINE_SPEED_SLOW_2 2 | 81 | * XINE_SPEED_SLOW_2 2 |
82 | * XINE_SPEED_NORMAL 4 | 82 | * XINE_SPEED_NORMAL 4 |
83 | * XINE_SPEED_FAST_2 8 | 83 | * XINE_SPEED_FAST_2 8 |
84 | *XINE_SPEED_FAST_4 16 | 84 | *XINE_SPEED_FAST_4 16 |
85 | */ | 85 | */ |
86 | void setSpeed( int speed = XINE_SPEED_PAUSE ); | 86 | void setSpeed( int speed = XINE_SPEED_PAUSE ); |
87 | 87 | ||
88 | int status() /*const*/; | 88 | int status() /*const*/; |
89 | 89 | ||
90 | int currentPosition()/*const*/; | 90 | int currentPosition()/*const*/; |
91 | //in seconds | 91 | //in seconds |
92 | int currentTime()/*const*/; | 92 | int currentTime()/*const*/; |
93 | |||
93 | int length() /*const*/; | 94 | int length() /*const*/; |
94 | 95 | ||
95 | bool isSeekable()/*const*/; | 96 | bool isSeekable()/*const*/; |
96 | 97 | ||
97 | /** | 98 | /** |
98 | * Whether or not to show video output | 99 | * Whether or not to show video output |
99 | */ | 100 | */ |
100 | void setShowVideo(bool video); | 101 | void setShowVideo(bool video); |
101 | 102 | ||
102 | /** | 103 | /** |
103 | * is we show video | 104 | * is we show video |
104 | */ | 105 | */ |
105 | bool isShowingVideo() /*const*/; | 106 | bool isShowingVideo() /*const*/; |
106 | 107 | ||
107 | /** | 108 | /** |
108 | * | 109 | * |
109 | */ | 110 | */ |
110 | void showVideoFullScreen( bool fullScreen ); | 111 | void showVideoFullScreen( bool fullScreen ); |
111 | 112 | ||
112 | /** | 113 | /** |
113 | * | 114 | * |
114 | */ | 115 | */ |
115 | bool isVideoFullScreen()/*const*/ ; | 116 | bool isVideoFullScreen()/*const*/ ; |
116 | 117 | ||
@@ -151,49 +152,51 @@ namespace XINE { | |||
151 | */ | 152 | */ |
152 | void setScaling( bool ); | 153 | void setScaling( bool ); |
153 | 154 | ||
154 | /** | 155 | /** |
155 | * Set the Gamma value for video output | 156 | * Set the Gamma value for video output |
156 | * @param int the value between -100 and 100, 0 is original | 157 | * @param int the value between -100 and 100, 0 is original |
157 | */ | 158 | */ |
158 | void setGamma( int ); | 159 | void setGamma( int ); |
159 | 160 | ||
160 | /** | 161 | /** |
161 | * test | 162 | * test |
162 | */ | 163 | */ |
163 | Frame currentFrame()/*const*/; | 164 | Frame currentFrame()/*const*/; |
164 | 165 | ||
165 | /** | 166 | /** |
166 | * Returns the error code | 167 | * Returns the error code |
167 | * XINE_ERROR_NONE 0 | 168 | * XINE_ERROR_NONE 0 |
168 | * XINE_ERROR_NO_INPUT_PLUGIN 1 | 169 | * XINE_ERROR_NO_INPUT_PLUGIN 1 |
169 | * XINE_ERROR_NO_DEMUXER_PLUGIN 2 | 170 | * XINE_ERROR_NO_DEMUXER_PLUGIN 2 |
170 | * XINE_ERROR_DEMUXER_FAILED 3 | 171 | * XINE_ERROR_DEMUXER_FAILED 3 |
171 | */ | 172 | */ |
172 | int error() /*const*/; | 173 | int error() /*const*/; |
173 | 174 | ||
174 | signals: | 175 | signals: |
176 | |||
175 | void stopped(); | 177 | void stopped(); |
178 | |||
176 | private: | 179 | private: |
177 | int m_bytes_per_pixel; | 180 | int m_bytes_per_pixel; |
178 | int m_length, m_pos, m_time; | 181 | int m_length, m_pos, m_time; |
179 | int m_major_version, m_minor_version, m_sub_version; | 182 | int m_major_version, m_minor_version, m_sub_version; |
180 | bool m_video:1; | 183 | bool m_video:1; |
181 | XineVideoWidget *m_wid; | 184 | XineVideoWidget *m_wid; |
182 | xine_t *m_xine; | 185 | xine_t *m_xine; |
183 | xine_stream_t *m_stream; | 186 | xine_stream_t *m_stream; |
184 | xine_cfg_entry_t *m_config; | 187 | xine_cfg_entry_t *m_config; |
185 | xine_vo_driver_t *m_videoOutput; | 188 | xine_vo_driver_t *m_videoOutput; |
186 | xine_ao_driver_t* m_audioOutput; | 189 | xine_ao_driver_t* m_audioOutput; |
187 | xine_event_queue_t *m_queue; | 190 | xine_event_queue_t *m_queue; |
188 | 191 | ||
189 | void handleXineEvent( const xine_event_t* t ); | 192 | void handleXineEvent( const xine_event_t* t ); |
190 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); | 193 | void drawFrame( uint8_t* frame, int width, int height, int bytes ); |
191 | // C -> C++ bridge for the event system | 194 | // C -> C++ bridge for the event system |
192 | static void xine_event_handler( void* user_data, const xine_event_t* t); | 195 | static void xine_event_handler( void* user_data, const xine_event_t* t); |
193 | static void xine_display_frame( void* user_data, uint8_t* frame , | 196 | static void xine_display_frame( void* user_data, uint8_t* frame , |
194 | int width, int height, int bytes ); | 197 | int width, int height, int bytes ); |
195 | }; | 198 | }; |
196 | }; | 199 | }; |
197 | 200 | ||
198 | 201 | ||
199 | #endif | 202 | #endif |
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 | |||
@@ -418,110 +418,112 @@ static void null_overlay_blend ( xine_vo_driver_t *this_gen, vo_frame_t *frame_g | |||
418 | } | 418 | } |
419 | 419 | ||
420 | 420 | ||
421 | static int null_get_property( xine_vo_driver_t* self, | 421 | static int null_get_property( xine_vo_driver_t* self, |
422 | int property ){ | 422 | int property ){ |
423 | return 0; | 423 | return 0; |
424 | } | 424 | } |
425 | static int null_set_property( xine_vo_driver_t* self, | 425 | static int null_set_property( xine_vo_driver_t* self, |
426 | int property, | 426 | int property, |
427 | int value ){ | 427 | int value ){ |
428 | return value; | 428 | return value; |
429 | } | 429 | } |
430 | static void null_get_property_min_max( xine_vo_driver_t* self, | 430 | static void null_get_property_min_max( xine_vo_driver_t* self, |
431 | int property, int *min, | 431 | int property, int *min, |
432 | int *max ){ | 432 | int *max ){ |
433 | *max = 0; | 433 | *max = 0; |
434 | *min = 0; | 434 | *min = 0; |
435 | } | 435 | } |
436 | static int null_gui_data_exchange( xine_vo_driver_t* self, | 436 | static int null_gui_data_exchange( xine_vo_driver_t* self, |
437 | int data_type, | 437 | int data_type, |
438 | void *data ){ | 438 | void *data ){ |
439 | return 0; | 439 | return 0; |
440 | } | 440 | } |
441 | 441 | ||
442 | static void null_exit( xine_vo_driver_t* self ){ | 442 | static void null_dispose ( xine_vo_driver_t* self ){ |
443 | null_driver_t* this = (null_driver_t*)self; | 443 | null_driver_t* this = (null_driver_t*)self; |
444 | free ( this ); | 444 | free ( this ); |
445 | } | 445 | } |
446 | static int null_redraw_needed( xine_vo_driver_t* self ){ | 446 | static int null_redraw_needed( xine_vo_driver_t* self ){ |
447 | return 0; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | 450 | ||
451 | xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, | 451 | xine_vo_driver_t* init_video_out_plugin( config_values_t* conf, |
452 | void* video ){ | 452 | void* video ){ |
453 | null_driver_t *vo; | 453 | null_driver_t *vo; |
454 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 454 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
455 | 455 | ||
456 | /* memset? */ | 456 | /* memset? */ |
457 | memset(vo,0, sizeof(null_driver_t ) ); | 457 | memset(vo,0, sizeof(null_driver_t ) ); |
458 | 458 | ||
459 | vo_scale_init (&vo->sc, 0, 0); | 459 | vo_scale_init (&vo->sc, 0, 0); |
460 | 460 | ||
461 | vo->sc.gui_pixel_aspect = 1.0; | 461 | vo->sc.gui_pixel_aspect = 1.0; |
462 | 462 | ||
463 | vo->m_show_video = 0; // false | 463 | vo->m_show_video = 0; // false |
464 | vo->m_video_fullscreen = 0; | 464 | vo->m_video_fullscreen = 0; |
465 | vo->m_is_scaling = 0; | 465 | vo->m_is_scaling = 0; |
466 | vo->display_ratio = 1.0; | 466 | vo->display_ratio = 1.0; |
467 | vo->gui_width = 16; | 467 | vo->gui_width = 16; |
468 | vo->gui_height = 8; | 468 | vo->gui_height = 8; |
469 | vo->frameDis = NULL; | 469 | vo->frameDis = NULL; |
470 | 470 | ||
471 | /* install callback handlers*/ | 471 | /* install callback handlers*/ |
472 | vo->vo_driver.get_capabilities = null_get_capabilities; | 472 | vo->vo_driver.get_capabilities = null_get_capabilities; |
473 | vo->vo_driver.alloc_frame = null_alloc_frame; | 473 | vo->vo_driver.alloc_frame = null_alloc_frame; |
474 | vo->vo_driver.update_frame_format = null_update_frame_format; | 474 | vo->vo_driver.update_frame_format = null_update_frame_format; |
475 | vo->vo_driver.display_frame = null_display_frame; | 475 | vo->vo_driver.display_frame = null_display_frame; |
476 | vo->vo_driver.overlay_blend = null_overlay_blend; | 476 | vo->vo_driver.overlay_blend = null_overlay_blend; |
477 | vo->vo_driver.get_property = null_get_property; | 477 | vo->vo_driver.get_property = null_get_property; |
478 | vo->vo_driver.set_property = null_set_property; | 478 | vo->vo_driver.set_property = null_set_property; |
479 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 479 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
480 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 480 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
481 | vo->vo_driver.exit = null_exit; | 481 | vo->vo_driver.dispose = null_dispose; |
482 | vo->vo_driver.redraw_needed = null_redraw_needed; | 482 | vo->vo_driver.redraw_needed = null_redraw_needed; |
483 | 483 | ||
484 | 484 | ||
485 | /* capabilities */ | 485 | /* capabilities */ |
486 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; | 486 | vo->m_capabilities = VO_CAP_COPIES_IMAGE | VO_CAP_YUY2 | VO_CAP_YV12; |
487 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, | 487 | vo->yuv2rgb_factory = yuv2rgb_factory_init (MODE_16_RGB, vo->yuv2rgb_swap, |
488 | vo->yuv2rgb_cmap); | 488 | vo->yuv2rgb_cmap); |
489 | 489 | ||
490 | return ( xine_vo_driver_t*) vo; | 490 | return ( xine_vo_driver_t*) vo; |
491 | } | 491 | } |
492 | 492 | ||
493 | #if 0 | ||
493 | static vo_info_t vo_info_null = { | 494 | static vo_info_t vo_info_null = { |
494 | 5, | 495 | 5, |
495 | "null plugin", | ||
496 | XINE_VISUAL_TYPE_FB | 496 | XINE_VISUAL_TYPE_FB |
497 | }; | 497 | }; |
498 | 498 | ||
499 | vo_info_t *get_video_out_plugin_info(){ | 499 | vo_info_t *get_video_out_plugin_info(){ |
500 | vo_info_null.description = _("xine video output plugin using null device"); | 500 | vo_info_null.description = _("xine video output plugin using null device"); |
501 | return &vo_info_null; | 501 | return &vo_info_null; |
502 | } | 502 | } |
503 | 503 | ||
504 | #endif | ||
505 | |||
504 | /* this is special for this device */ | 506 | /* this is special for this device */ |
505 | /** | 507 | /** |
506 | * We know that we will be controled by the XINE LIB++ | 508 | * We know that we will be controled by the XINE LIB++ |
507 | */ | 509 | */ |
508 | 510 | ||
509 | /** | 511 | /** |
510 | * | 512 | * |
511 | */ | 513 | */ |
512 | int null_is_showing_video( xine_vo_driver_t* self ){ | 514 | int null_is_showing_video( xine_vo_driver_t* self ){ |
513 | null_driver_t* this = (null_driver_t*)self; | 515 | null_driver_t* this = (null_driver_t*)self; |
514 | return this->m_show_video; | 516 | return this->m_show_video; |
515 | } | 517 | } |
516 | void null_set_show_video( xine_vo_driver_t* self, int show ) { | 518 | void null_set_show_video( xine_vo_driver_t* self, int show ) { |
517 | ((null_driver_t*)self)->m_show_video = show; | 519 | ((null_driver_t*)self)->m_show_video = show; |
518 | } | 520 | } |
519 | 521 | ||
520 | int null_is_fullscreen( xine_vo_driver_t* self ){ | 522 | int null_is_fullscreen( xine_vo_driver_t* self ){ |
521 | return ((null_driver_t*)self)->m_video_fullscreen; | 523 | return ((null_driver_t*)self)->m_video_fullscreen; |
522 | } | 524 | } |
523 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ | 525 | void null_set_fullscreen( xine_vo_driver_t* self, int screen ){ |
524 | ((null_driver_t*)self)->m_video_fullscreen = screen; | 526 | ((null_driver_t*)self)->m_video_fullscreen = screen; |
525 | } | 527 | } |
526 | int null_is_scaling( xine_vo_driver_t* self ){ | 528 | int null_is_scaling( xine_vo_driver_t* self ){ |
527 | return ((null_driver_t*)self)->m_is_scaling; | 529 | return ((null_driver_t*)self)->m_is_scaling; |
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 | |||
@@ -58,48 +58,50 @@ XineControl::XineControl( QObject *parent, const char *name ) | |||
58 | 58 | ||
59 | disabledSuspendScreenSaver = FALSE; | 59 | disabledSuspendScreenSaver = FALSE; |
60 | } | 60 | } |
61 | 61 | ||
62 | XineControl::~XineControl() { | 62 | XineControl::~XineControl() { |
63 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 63 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
64 | if ( disabledSuspendScreenSaver ) { | 64 | if ( disabledSuspendScreenSaver ) { |
65 | disabledSuspendScreenSaver = FALSE; | 65 | disabledSuspendScreenSaver = FALSE; |
66 | // Re-enable the suspend mode | 66 | // Re-enable the suspend mode |
67 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 67 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
68 | } | 68 | } |
69 | #endif | 69 | #endif |
70 | delete libXine; | 70 | delete libXine; |
71 | } | 71 | } |
72 | 72 | ||
73 | void XineControl::play( const QString& fileName ) { | 73 | void XineControl::play( const QString& fileName ) { |
74 | hasVideoChannel = FALSE; | 74 | hasVideoChannel = FALSE; |
75 | hasAudioChannel = FALSE; | 75 | hasAudioChannel = FALSE; |
76 | m_fileName = fileName; | 76 | m_fileName = fileName; |
77 | 77 | ||
78 | //qDebug("<<FILENAME: " + fileName + ">>>>"); | 78 | //qDebug("<<FILENAME: " + fileName + ">>>>"); |
79 | 79 | ||
80 | if ( !libXine->play( fileName ) ) { | 80 | if ( !libXine->play( fileName ) ) { |
81 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); | 81 | QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); |
82 | // toggle stop so the the play button is reset | ||
83 | mediaPlayerState->setPlaying( false ); | ||
82 | return; | 84 | return; |
83 | } | 85 | } |
84 | mediaPlayerState->setPlaying( true ); | 86 | mediaPlayerState->setPlaying( true ); |
85 | 87 | ||
86 | char whichGui; | 88 | char whichGui; |
87 | // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); | 89 | // qDebug( QString( "libXine->hasVideo() return : %1 ").arg( libXine->hasVideo() ) ); |
88 | if ( !libXine->hasVideo() ) { | 90 | if ( !libXine->hasVideo() ) { |
89 | whichGui = 'a'; | 91 | whichGui = 'a'; |
90 | qDebug("HAS AUDIO"); | 92 | qDebug("HAS AUDIO"); |
91 | libXine->setShowVideo( false ); | 93 | libXine->setShowVideo( false ); |
92 | hasAudioChannel = TRUE; | 94 | hasAudioChannel = TRUE; |
93 | } else { | 95 | } else { |
94 | whichGui = 'v'; | 96 | whichGui = 'v'; |
95 | qDebug("HAS VIDEO"); | 97 | qDebug("HAS VIDEO"); |
96 | libXine->setShowVideo( true ); | 98 | libXine->setShowVideo( true ); |
97 | hasVideoChannel = TRUE; | 99 | hasVideoChannel = TRUE; |
98 | } | 100 | } |
99 | // determine if slider is shown | 101 | // determine if slider is shown |
100 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); | 102 | mediaPlayerState->setIsStreaming( !libXine->isSeekable() ); |
101 | // which gui (video / audio) | 103 | // which gui (video / audio) |
102 | mediaPlayerState->setView( whichGui ); | 104 | mediaPlayerState->setView( whichGui ); |
103 | 105 | ||
104 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 106 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
105 | if ( !disabledSuspendScreenSaver ) { | 107 | if ( !disabledSuspendScreenSaver ) { |
@@ -204,44 +206,53 @@ QString XineControl::getMetaInfo() { | |||
204 | 206 | ||
205 | if ( !libXine->metaInfo( 1 ).isEmpty() ) { | 207 | if ( !libXine->metaInfo( 1 ).isEmpty() ) { |
206 | returnString += tr( " Comment: " + libXine->metaInfo( 1 ) ); | 208 | returnString += tr( " Comment: " + libXine->metaInfo( 1 ) ); |
207 | } | 209 | } |
208 | 210 | ||
209 | if ( !libXine->metaInfo( 2 ).isEmpty() ) { | 211 | if ( !libXine->metaInfo( 2 ).isEmpty() ) { |
210 | returnString += tr( " Artist: " + libXine->metaInfo( 2 ) ); | 212 | returnString += tr( " Artist: " + libXine->metaInfo( 2 ) ); |
211 | } | 213 | } |
212 | 214 | ||
213 | if ( !libXine->metaInfo( 3 ).isEmpty() ) { | 215 | if ( !libXine->metaInfo( 3 ).isEmpty() ) { |
214 | returnString += tr( " Genre: " + libXine->metaInfo( 3 ) ); | 216 | returnString += tr( " Genre: " + libXine->metaInfo( 3 ) ); |
215 | } | 217 | } |
216 | 218 | ||
217 | if ( !libXine->metaInfo( 4 ).isEmpty() ) { | 219 | if ( !libXine->metaInfo( 4 ).isEmpty() ) { |
218 | returnString += tr( " Album: " + libXine->metaInfo( 4 ) ); | 220 | returnString += tr( " Album: " + libXine->metaInfo( 4 ) ); |
219 | } | 221 | } |
220 | 222 | ||
221 | if ( !libXine->metaInfo( 5 ).isEmpty() ) { | 223 | if ( !libXine->metaInfo( 5 ).isEmpty() ) { |
222 | returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); | 224 | returnString += tr( " Year: " + libXine->metaInfo( 5 ) ); |
223 | } | 225 | } |
224 | return returnString; | 226 | return returnString; |
225 | } | 227 | } |
226 | 228 | ||
227 | QString XineControl::getErrorCode() { | 229 | QString XineControl::getErrorCode() { |
230 | |||
228 | int errorCode = libXine->error(); | 231 | int errorCode = libXine->error(); |
229 | 232 | ||
233 | qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); | ||
234 | |||
230 | if ( errorCode == 1 ) { | 235 | if ( errorCode == 1 ) { |
231 | return tr( "No input plugin found for this media type" ); | 236 | return tr( "No input plugin found for this media type" ); |
237 | } else if ( errorCode == 2 ) { | ||
238 | return tr( "No demux plugin found for this media type" ); | ||
239 | } else if ( errorCode == 3 ) { | ||
240 | return tr( "Demuxing failed for this media type" ); | ||
241 | } else if ( errorCode == 4 ) { | ||
242 | return tr( "Malformed MRL" ); | ||
232 | } else { | 243 | } else { |
233 | return tr( "Some other error" ); | 244 | return tr( "Some other error" ); |
234 | } | 245 | } |
235 | } | 246 | } |
236 | 247 | ||
237 | /** | 248 | /** |
238 | * Seek to a position in the track | 249 | * Seek to a position in the track |
239 | * @param second the second to jump to | 250 | * @param second the second to jump to |
240 | */ | 251 | */ |
241 | void XineControl::seekTo( long second ) { | 252 | void XineControl::seekTo( long second ) { |
242 | libXine->seekTo( (int)second ); | 253 | libXine->seekTo( (int)second ); |
243 | } | 254 | } |
244 | 255 | ||
245 | void XineControl::videoResized ( const QSize &s ) { | 256 | void XineControl::videoResized ( const QSize &s ) { |
246 | libXine->resize( s ); | 257 | libXine->resize( s ); |
247 | } | 258 | } |