diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-02-20 19:42:20 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-25 15:00:44 +0100 |
commit | d964388b38ec4762e315d86aacb779604bcdca1b (patch) | |
tree | d774d576c66db43cdd91cb0ebee6fbd052c17012 /src/multimedia/audio/qsoundeffect_qaudio_p.cpp | |
parent | 92323612d01e9bd6438fb9da0dd810c6dad045a3 (diff) |
QSoundEffect: fix changing the loop count while playing.v5.3.0-alpha1
The running count was not updated with the new value.
Auto-test added and documentation updated to be more clear about this
behavior.
Task-number: QTBUG-36643
Change-Id: I29e98ca4679f950a75133b21873738bcb72d23d4
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/multimedia/audio/qsoundeffect_qaudio_p.cpp')
-rw-r--r-- | src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index aed8a7aea..2b4359ccf 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -172,7 +172,8 @@ void QSoundEffectPrivate::setLoopCount(int loopCount) if (loopCount == 0) loopCount = 1; d->m_loopCount = loopCount; - d->m_runningCount = loopCount; + if (d->m_playing) + setLoopsRemaining(loopCount); } qreal QSoundEffectPrivate::volume() const @@ -228,7 +229,7 @@ QSoundEffect::Status QSoundEffectPrivate::status() const void QSoundEffectPrivate::play() { d->m_offset = 0; - d->m_runningCount = d->m_loopCount; + setLoopsRemaining(d->m_loopCount); #ifdef QT_QAUDIO_DEBUG qDebug() << this << "play"; #endif @@ -283,7 +284,7 @@ void QSoundEffectPrivate::setPlaying(bool playing) void QSoundEffectPrivate::setLoopsRemaining(int loopsRemaining) { - if (!d->m_runningCount && loopsRemaining) + if (d->m_runningCount == loopsRemaining) return; #ifdef QT_QAUDIO_DEBUG qDebug() << this << "setLoopsRemaining " << loopsRemaining; |