author | harlekin <harlekin> | 2002-08-05 16:43:59 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-05 16:43:59 (UTC) |
commit | af5168ac637f2f5b871cc73a69151dd3d829fec0 (patch) (side-by-side diff) | |
tree | 2cc8dad511ee01709a6c19699206b6ad20184a76 | |
parent | c4a390e38fe72eeafa0620fc1f8299f561958d21 (diff) | |
download | opie-af5168ac637f2f5b871cc73a69151dd3d829fec0.zip opie-af5168ac637f2f5b871cc73a69151dd3d829fec0.tar.gz opie-af5168ac637f2f5b871cc73a69151dd3d829fec0.tar.bz2 |
seeking is working now
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 22 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.h | 2 |
3 files changed, 16 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 23f4329..0e9e7ea 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -75,9 +75,9 @@ MediaButton audioButtons[] = { { FALSE, FALSE, FALSE }, // volume down { TRUE, FALSE, FALSE }, // repeat/loop { FALSE, FALSE, FALSE }, // playlist { FALSE, FALSE, FALSE }, // forward - { FALSE, FALSE, FALSE } // back + { FALSE, FALSE, FALSE } // back }; const char *skin_mask_file_names[11] = { "play", "stop", "pause", "next", "prev", "up", @@ -97,9 +97,9 @@ static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); - + Config cfg("OpiePlayer"); cfg.setGroup("AudioWidget"); skin = cfg.readEntry("Skin","default"); //skin = "scaleTest"; @@ -121,10 +121,10 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QImage imgMask = masks[i]->convertToImage(); uchar **dest = imgButtonMask->jumpTable(); for ( int y = 0; y < imgUp->height(); y++ ) { uchar *line = dest[y]; - for ( int x = 0; x < imgUp->width(); x++ ) - if ( !qRed( imgMask.pixel( x, y ) ) ) + for ( int x = 0; x < imgUp->width(); x++ ) + if ( !qRed( imgMask.pixel( x, y ) ) ) line[x] = i + 1; } } @@ -160,9 +160,9 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) ); connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) ); connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); - + // Intialise state setLength( mediaPlayerState->length() ); setPosition( mediaPlayerState->position() ); setLooping( mediaPlayerState->fullscreen() ); @@ -171,9 +171,9 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : } AudioWidget::~AudioWidget() { - + for ( int i = 0; i < 11; i++ ) { delete buttonPixUp[i]; delete buttonPixDown[i]; } @@ -273,9 +273,9 @@ void AudioWidget::setView( char view ) { // disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); // } else { // this stops the slider from being moved, thus // does not stop stream when it reaches the end - slider.show(); + // slider.show(); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); // } @@ -298,9 +298,9 @@ static QString timeAsString( long length ) { void AudioWidget::updateSlider( long i, long max ) { time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); // qDebug( timeAsString( i ) + " / " + timeAsString( max ) ) ; - + if ( max == 0 ) { return; } // Will flicker too much if we don't do this @@ -359,18 +359,18 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); - if ( isOnButton && i == AudioVolumeUp ) + if ( isOnButton && i == AudioVolumeUp ) qDebug("on up"); if ( isOnButton && !audioButtons[i].isHeld ) { audioButtons[i].isHeld = TRUE; toggleButton(i); switch (i) { - case AudioVolumeUp: + case AudioVolumeUp: qDebug("more clicked"); - emit moreClicked(); + emit moreClicked(); return; case AudioVolumeDown: emit lessClicked(); return; } } else if ( !isOnButton && audioButtons[i].isHeld ) { diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index 33889d0..d08ff04 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -45,9 +45,8 @@ 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( this, SIGNAL( positionChanged( long ) ), mediaPlayerState, SLOT( setPosition( 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 ) ) ); @@ -57,8 +56,9 @@ XineControl::~XineControl() { delete libXine; } void XineControl::play( const QString& fileName ) { + m_fileName = fileName; libXine->play( fileName ); mediaPlayerState->setPlaying( true ); // default to audio view until we know how to handle video // MediaDetect mdetect; @@ -110,9 +110,9 @@ void XineControl::length() { } long XineControl::position() { m_position = ( currentTime() ); - mediaPlayerState->setPosition( m_position ); + mediaPlayerState->updatePosition( m_position ); long emitPos = (long)m_position; emit positionChanged( emitPos ); if(mediaPlayerState->isPlaying) // needs to be stopped the media is stopped @@ -125,9 +125,10 @@ void XineControl::setFullscreen( bool isSet ) { libXine->showVideoFullScreen( isSet); } void XineControl::seekTo( long second ) { - // libXine-> + qDebug("seek triggered!!"); + libXine->play( m_fileName , 0, (int)second ); } void XineControl::videoResized ( const QSize &s ) diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h index 4a61f32..c7aefd4 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.h +++ b/noncore/multimedia/opieplayer2/xinecontrol.h @@ -62,9 +62,9 @@ private: XINE::Lib *libXine; MediaDetect mdetect; long m_currentTime; long m_position; - + QString m_fileName; signals: void positionChanged( long ); }; |