From d964388b38ec4762e315d86aacb779604bcdca1b Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 20 Feb 2014 19:42:20 +0100 Subject: 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 --- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/multimedia/audio/qsoundeffect_pulse_p.cpp') diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index ef09cd90a..570870fc9 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -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(); } -- cgit v1.2.3