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.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.cpp')
-rw-r--r-- | src/multimedia/audio/qsoundeffect.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp index 83b28c453..cdf5ab300 100644 --- a/src/multimedia/audio/qsoundeffect.cpp +++ b/src/multimedia/audio/qsoundeffect.cpp @@ -184,16 +184,20 @@ void QSoundEffect::setSource(const QUrl &url) /*! \qmlproperty int QtMultimedia::SoundEffect::loops - This property provides a way to control the number of times to repeat the sound on each play(). + This property holds the number of times the sound is played. A value of 0 or 1 means + the sound will be played only once; set to SoundEffect.Infinite to enable infinite looping. - Set to SoundEffect.Infinite to enable infinite looping. + The value can be changed while the sound effect is playing, in which case it will update + the remaining loops to the new value. */ /*! \property QSoundEffect::loops - This property provides a way to control the number of times to repeat the sound on each play(). + This property holds the number of times the sound is played. A value of 0 or 1 means + the sound will be played only once; set to SoundEffect.Infinite to enable infinite looping. - Set to QSoundEffect::Infinite to enable infinite looping. + The value can be changed while the sound effect is playing, in which case it will update + the remaining loops to the new value. */ /*! @@ -213,8 +217,14 @@ int QSoundEffect::loopCount() const */ /*! - Set the total number of times to repeat playing this sound effect on each play() call to \a loopCount. - Pass \c QSoundEffect::Infinite to repeat until stop() is called. + Set the total number of times to play this sound effect to \a loopCount. + + Setting the loop count to 0 or 1 means the sound effect will be played only once; + pass \c QSoundEffect::Infinite to repeat indefinitely. The loop count can be changed while + the sound effect is playing, in which case it will update the remaining loops to + the new \a loopCount. + + \sa loopsRemaining() */ void QSoundEffect::setLoopCount(int loopCount) { |