Diffstat (limited to 'noncore/multimedia/opieplayer2/xinecontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index d08ff04..cf7dcb2 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -46,13 +46,12 @@ XineControl::XineControl( QObject *parent, const char *name ) connect ( videoUI, SIGNAL( videoResized ( const QSize & )), this, SLOT( videoResized ( const QSize & ))); connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pause(bool) ) ); connect( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( updatePosition( long ) ) ); connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), this, SLOT( stop( bool ) ) ); connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), this, SLOT( setFullscreen( bool ) ) ); connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( seekTo( long ) ) ); - } XineControl::~XineControl() { delete libXine; } @@ -90,48 +89,69 @@ void XineControl::stop( bool isSet ) { //mediaPlayerState->setPlaying( false ); } else { // play again } } +/** + * Pause playback + * @isSet + */ void XineControl::pause( bool isSet) { libXine->pause(); } + +/** + * get current time in playback + */ long XineControl::currentTime() { // todo: jede sekunde überprüfen m_currentTime = libXine->currentTime(); return m_currentTime; QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); } +/** + * Set the length of the media file + */ void XineControl::length() { m_length = libXine->length(); mediaPlayerState->setLength( m_length ); } + +/** + * Reports the position the xine backend is at right now + * @return long the postion in seconds + */ long XineControl::position() { m_position = ( currentTime() ); mediaPlayerState->updatePosition( m_position ); long emitPos = (long)m_position; emit positionChanged( emitPos ); if(mediaPlayerState->isPlaying) // needs to be stopped the media is stopped QTimer::singleShot( 1000, this, SLOT( position() ) ); // qDebug("POSITION : %d", m_position); return m_position; } +/** + * Set videoplayback to fullscreen + * @param isSet + */ void XineControl::setFullscreen( bool isSet ) { libXine->showVideoFullScreen( isSet); } +/** + * Seek to a position in the track + * @param second the second to jump to + */ void XineControl::seekTo( long second ) { - qDebug("seek triggered!!"); libXine->play( m_fileName , 0, (int)second ); } - -void XineControl::videoResized ( const QSize &s ) -{ +void XineControl::videoResized ( const QSize &s ) { libXine-> resize ( s ); } |