QSoundEffect: fix changing the loop count while playing.

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>
This commit is contained in:
Yoann Lopes
2014-02-20 19:42:20 +01:00
committed by The Qt Project
parent 92323612d0
commit d964388b38
4 changed files with 96 additions and 13 deletions

View File

@@ -516,6 +516,8 @@ void QSoundEffectPrivate::setLoopCount(int loopCount)
if (loopCount == 0)
loopCount = 1;
m_loopCount = loopCount;
if (m_playing)
setLoopsRemaining(loopCount);
}
qreal QSoundEffectPrivate::volume() const
@@ -647,7 +649,7 @@ void QSoundEffectPrivate::play()
emptyStream();
return;
}
m_runningCount = m_loopCount;
setLoopsRemaining(m_loopCount);
playSample();
}