summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-10-24 20:41:39 -0700
committerLars Knoll <lars.knoll@qt.io>2017-11-03 09:33:08 +0000
commita383e038116654cebb3105554dfff8915b0b3f70 (patch)
tree64a4197e3bb19d1f57acee59809eb67c733bacad
parent186fd094173eed1d0ebb197f40356e53d25ba164 (diff)
Update to new QRandomGenerator APIv5.10.0-beta4
Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r--src/imports/audioengine/qdeclarative_playvariation_p.cpp4
-rw-r--r--src/imports/audioengine/qdeclarative_sound_p.cpp2
-rw-r--r--src/multimedia/playback/qmedianetworkplaylistprovider.cpp2
-rw-r--r--src/multimedia/playback/qmediaplaylistnavigator.cpp4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/imports/audioengine/qdeclarative_playvariation_p.cpp b/src/imports/audioengine/qdeclarative_playvariation_p.cpp
index 5dd88506..e6d3697d 100644
--- a/src/imports/audioengine/qdeclarative_playvariation_p.cpp
+++ b/src/imports/audioengine/qdeclarative_playvariation_p.cpp
@@ -273,7 +273,7 @@ void QDeclarativePlayVariation::setSampleObject(QDeclarativeAudioSample *sampleO
void QDeclarativePlayVariation::applyParameters(QSoundInstance *soundInstance)
{
- qreal pitch = QRandomGenerator::bounded(1001 * 0.001f) * (m_maxPitch - m_minPitch) + m_minPitch;
- qreal gain = QRandomGenerator::bounded(1001 * 0.001f) * (m_maxGain - m_minGain) + m_minGain;
+ qreal pitch = QRandomGenerator::global()->bounded(1001 * 0.001f) * (m_maxPitch - m_minPitch) + m_minPitch;
+ qreal gain = QRandomGenerator::global()->bounded(1001 * 0.001f) * (m_maxGain - m_minGain) + m_minGain;
soundInstance->updateVariationParameters(pitch, gain, m_looping);
}
diff --git a/src/imports/audioengine/qdeclarative_sound_p.cpp b/src/imports/audioengine/qdeclarative_sound_p.cpp
index adbe9e53..a11490ce 100644
--- a/src/imports/audioengine/qdeclarative_sound_p.cpp
+++ b/src/imports/audioengine/qdeclarative_sound_p.cpp
@@ -317,7 +317,7 @@ int QDeclarativeSound::genVariationIndex(int oldVariationIndex)
case QDeclarativeSound::Random: {
if (oldVariationIndex < 0)
oldVariationIndex = 0;
- return (oldVariationIndex + (QRandomGenerator::bounded(m_playlist.count() + 1))) % m_playlist.count();
+ return (oldVariationIndex + (QRandomGenerator::global()->bounded(m_playlist.count() + 1))) % m_playlist.count();
}
default:
return (oldVariationIndex + 1) % m_playlist.count();
diff --git a/src/multimedia/playback/qmedianetworkplaylistprovider.cpp b/src/multimedia/playback/qmedianetworkplaylistprovider.cpp
index 50db4fad..3f24d0f5 100644
--- a/src/multimedia/playback/qmedianetworkplaylistprovider.cpp
+++ b/src/multimedia/playback/qmedianetworkplaylistprovider.cpp
@@ -267,7 +267,7 @@ void QMediaNetworkPlaylistProvider::shuffle()
QList<QMediaContent> resources;
while (!d->resources.isEmpty()) {
- resources.append(d->resources.takeAt(QRandomGenerator::bounded(d->resources.size())));
+ resources.append(d->resources.takeAt(QRandomGenerator::global()->bounded(d->resources.size())));
}
d->resources = resources;
diff --git a/src/multimedia/playback/qmediaplaylistnavigator.cpp b/src/multimedia/playback/qmediaplaylistnavigator.cpp
index 0bacbf2b..0966c939 100644
--- a/src/multimedia/playback/qmediaplaylistnavigator.cpp
+++ b/src/multimedia/playback/qmediaplaylistnavigator.cpp
@@ -125,7 +125,7 @@ int QMediaPlaylistNavigatorPrivate::nextItemPos(int steps) const
randomModePositions.append(-1);
int res = randomModePositions[randomPositionsOffset+steps];
if (res<0 || res >= playlist->mediaCount()) {
- res = QRandomGenerator::bounded(playlist->mediaCount());
+ res = QRandomGenerator::global()->bounded(playlist->mediaCount());
randomModePositions[randomPositionsOffset+steps] = res;
}
@@ -178,7 +178,7 @@ int QMediaPlaylistNavigatorPrivate::previousItemPos(int steps) const
int res = randomModePositions[randomPositionsOffset-steps];
if (res<0 || res >= playlist->mediaCount()) {
- res = QRandomGenerator::bounded(playlist->mediaCount());
+ res = QRandomGenerator::global()->bounded(playlist->mediaCount());
randomModePositions[randomPositionsOffset-steps] = res;
}