diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-08 10:31:26 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-12-08 13:07:33 (GMT) |
commit | fe5b275bfab1605da3ee95b6eb1d976aecb0a8a8 (patch) | |
tree | 64313ba3a4bfca96f5c20b9cd523282f55287748 /src/3rdparty/phonon/mmf | |
parent | 89e1e7fcbcbe93d8096afe0f7c240fe706cc9069 (diff) | |
download | Qt-fe5b275bfab1605da3ee95b6eb1d976aecb0a8a8.zip Qt-fe5b275bfab1605da3ee95b6eb1d976aecb0a8a8.tar.gz Qt-fe5b275bfab1605da3ee95b6eb1d976aecb0a8a8.tar.bz2 |
Re-emit prefinishMarkReached and aboutToFinish if rewound back past mark.
Task-number: QTBUG-6214
Reviewed-by: Frans Englich
Diffstat (limited to 'src/3rdparty/phonon/mmf')
-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(); |