diff options
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 25 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.h | 2 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 18f96cc..344413d 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -182,6 +182,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) } doSeek(ms); + resetMarksIfRewound(); if(wasPlaying && state() != ErrorState) { doPlay(); @@ -402,6 +403,14 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds void MMF::AbstractMediaPlayer::positionTick() { + emitMarksIfReached(); + + const qint64 current = currentTime(); + emit MMF::AbstractPlayer::tick(current); +} + +void MMF::AbstractMediaPlayer::emitMarksIfReached() +{ const qint64 current = currentTime(); const qint64 total = totalTime(); const qint64 remaining = total - current; @@ -419,9 +428,21 @@ void MMF::AbstractMediaPlayer::positionTick() emit aboutToFinish(); } } +} - // For the MWC compiler, we need to qualify the base class. - emit MMF::AbstractPlayer::tick(current); +void MMF::AbstractMediaPlayer::resetMarksIfRewound() +{ + const qint64 current = currentTime(); + const qint64 total = totalTime(); + const qint64 remaining = total - current; + + if (prefinishMark() && m_prefinishMarkSent) + if (remaining >= (prefinishMark() + tickInterval()/2)) + m_prefinishMarkSent = false; + + if (m_aboutToFinishSent) + if (remaining >= tickInterval()) + m_aboutToFinishSent = false; } void MMF::AbstractMediaPlayer::bufferStatusTick() diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 24fa228..abd6bff 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -91,6 +91,8 @@ private: void stopBufferStatusTimer(); void stopTimers(); void doVolumeChanged(); + void emitMarksIfReached(); + void resetMarksIfRewound(); private Q_SLOTS: void positionTick(); |