Diffstat (limited to 'noncore/multimedia/opieplayer2/lib.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 9f7a9c5..4ae8490 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -291,18 +291,46 @@ int Lib::length() const { | |||
291 | valid stream, then return -1 (this value could be used to make the stream | 291 | valid stream, then return -1 (this value could be used to make the stream |
292 | unseekable, but it should never occur!! Mr. Murphy ? :) ) */ | 292 | unseekable, but it should never occur!! Mr. Murphy ? :) ) */ |
293 | 293 | ||
294 | return -1; | 294 | return -1; |
295 | } | 295 | } |
296 | 296 | ||
297 | /* info about current stream */ | ||
298 | QSize Lib::videoSize()const | ||
299 | { | ||
300 | if (!m_initialized||!hasVideo()) return QSize(0,0); | ||
301 | int width = xine_get_stream_info(m_stream,XINE_STREAM_INFO_VIDEO_WIDTH); | ||
302 | int height = xine_get_stream_info(m_stream,XINE_STREAM_INFO_VIDEO_HEIGHT); | ||
303 | return QSize(width,height); | ||
304 | } | ||
305 | |||
306 | |||
297 | bool Lib::isSeekable() const { | 307 | bool Lib::isSeekable() const { |
298 | assert( m_initialized ); | 308 | assert( m_initialized ); |
299 | 309 | ||
300 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); | 310 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_SEEKABLE ); |
301 | } | 311 | } |
302 | 312 | ||
313 | bool Lib::hasVideo() const { | ||
314 | assert( m_initialized ); | ||
315 | |||
316 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_HAS_VIDEO); | ||
317 | } | ||
318 | |||
319 | int Lib::audioBitrate()const | ||
320 | { | ||
321 | if (!m_initialized) return 0; | ||
322 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_AUDIO_BITRATE); | ||
323 | } | ||
324 | int Lib::videoBitrate()const | ||
325 | { | ||
326 | if (!m_initialized||!hasVideo()) return 0; | ||
327 | return xine_get_stream_info( m_stream, XINE_STREAM_INFO_VIDEO_BITRATE); | ||
328 | } | ||
329 | /* end info block */ | ||
330 | |||
303 | void Lib::seekTo( int time ) { | 331 | void Lib::seekTo( int time ) { |
304 | assert( m_initialized ); | 332 | assert( m_initialized ); |
305 | 333 | ||
306 | odebug << "Seeking to second " << time << oendl; | 334 | odebug << "Seeking to second " << time << oendl; |
307 | //Keep it paused if it was in that state | 335 | //Keep it paused if it was in that state |
308 | if ( xine_get_param( m_stream, XINE_PARAM_SPEED ) ) { | 336 | if ( xine_get_param( m_stream, XINE_PARAM_SPEED ) ) { |
@@ -388,18 +416,12 @@ void Lib::setShowVideo( bool video ) { | |||
388 | bool Lib::isShowingVideo() const { | 416 | bool Lib::isShowingVideo() const { |
389 | assert( m_initialized ); | 417 | assert( m_initialized ); |
390 | 418 | ||
391 | return ::null_is_showing_video( m_videoOutput ); | 419 | return ::null_is_showing_video( m_videoOutput ); |
392 | } | 420 | } |
393 | 421 | ||
394 | bool Lib::hasVideo() const { | ||
395 | assert( m_initialized ); | ||
396 | |||
397 | return xine_get_stream_info( m_stream, 18 ); | ||
398 | } | ||
399 | |||
400 | void Lib::showVideoFullScreen( bool fullScreen ) { | 422 | void Lib::showVideoFullScreen( bool fullScreen ) { |
401 | assert( m_initialized ); | 423 | assert( m_initialized ); |
402 | 424 | ||
403 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | 425 | ::null_set_fullscreen( m_videoOutput, fullScreen ); |
404 | } | 426 | } |
405 | 427 | ||