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:
committed by
The Qt Project
parent
92323612d0
commit
d964388b38
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user