diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/controls/cuecontrol.cpp | 9 | ||||
-rw-r--r-- | src/library/rekordbox/rekordboxfeature.cpp | 3 | ||||
-rw-r--r-- | src/preferences/broadcastsettings.cpp | 6 | ||||
-rw-r--r-- | src/preferences/broadcastsettingsmodel.cpp | 3 | ||||
-rw-r--r-- | src/preferences/colorpalettesettings.cpp | 22 | ||||
-rw-r--r-- | src/preferences/dialog/dlgprefbroadcast.cpp | 3 | ||||
-rw-r--r-- | src/preferences/dialog/dlgprefcolors.cpp | 3 | ||||
-rw-r--r-- | src/preferences/dialog/dlgprefeffects.cpp | 6 | ||||
-rw-r--r-- | src/skin/skinloader.cpp | 3 | ||||
-rw-r--r-- | src/soundio/soundmanagerconfig.cpp | 33 | ||||
-rw-r--r-- | src/test/soundproxy_test.cpp | 56 | ||||
-rw-r--r-- | src/track/serato/markers2.cpp | 8 | ||||
-rw-r--r-- | src/track/serato/tags.cpp | 6 | ||||
-rw-r--r-- | src/track/track.cpp | 6 |
14 files changed, 107 insertions, 60 deletions
diff --git a/src/engine/controls/cuecontrol.cpp b/src/engine/controls/cuecontrol.cpp index 6b38a67325..ab53d49e46 100644 --- a/src/engine/controls/cuecontrol.cpp +++ b/src/engine/controls/cuecontrol.cpp @@ -375,7 +375,8 @@ void CueControl::trackLoaded(TrackPointer pNewTrack) { Qt::DirectConnection); CuePointer pMainCue; - for (const CuePointer& pCue : m_pLoadedTrack->getCuePoints()) { + const QList<CuePointer> cuePoints = m_pLoadedTrack->getCuePoints(); + for (const CuePointer& pCue : cuePoints) { if (pCue->getType() == mixxx::CueType::MainCue) { DEBUG_ASSERT(!pMainCue); pMainCue = pCue; @@ -478,10 +479,12 @@ void CueControl::loadCuesFromTrack() { QSet<int> active_hotcues; CuePointer pLoadCue, pIntroCue, pOutroCue; - if (!m_pLoadedTrack) + if (!m_pLoadedTrack) { return; + } - for (const CuePointer& pCue: m_pLoadedTrack->getCuePoints()) { + const QList<CuePointer> cues = m_pLoadedTrack->getCuePoints(); + for (const auto& pCue : cues) { switch (pCue->getType()) { case mixxx::CueType::MainCue: DEBUG_ASSERT(!pLoadCue); // There should be only one MainCue cue diff --git a/src/library/rekordbox/rekordboxfeature.cpp b/src/library/rekordbox/rekordboxfeature.cpp index 27488afadb..3358f066a3 100644 --- a/src/library/rekordbox/rekordboxfeature.cpp +++ b/src/library/rekordbox/rekordboxfeature.cpp @@ -790,7 +790,8 @@ void setHotCue(TrackPointer track, double startPosition, double endPosition, int CuePointer pCue; bool hotCueFound = false; - for (const CuePointer& trackCue : track->getCuePoints()) { + const QList<CuePointer> cuePoints = track->getCuePoints(); + for (const CuePointer& trackCue : cuePoints) { if (trackCue->getHotCue() == id) { pCue = trackCue; hotCueFound = true; diff --git a/src/preferences/broadcastsettings.cpp b/src/preferences/broadcastsettings.cpp index cc5e022bc4..70e0e167c6 100644 --- a/src/preferences/broadcastsettings.cpp +++ b/src/preferences/broadcastsettings.cpp @@ -212,7 +212,8 @@ void BroadcastSettings::applyModel(BroadcastSettingsModel* pModel) { } // Step 2: add new profiles - for(BroadcastProfilePtr profileCopy : pModel->profiles()) { + const QList<BroadcastProfilePtr> existingProfiles = pModel->profiles(); + for (auto profileCopy : existingProfiles) { // Check if profile already exists in settings BroadcastProfilePtr existingProfile = m_profiles.value(profileCopy->getProfileName()); @@ -226,7 +227,8 @@ void BroadcastSettings::applyModel(BroadcastSettingsModel* pModel) { } // Step 3: update existing profiles - for(BroadcastProfilePtr profileCopy : pModel->profiles()) { + const QList<BroadcastProfilePtr> allProfiles = pModel->profiles(); + for (BroadcastProfilePtr profileCopy : allProfiles) { BroadcastProfilePtr actualProfile = m_profiles.value(profileCopy->getProfileName()); if (actualProfile) { diff --git a/src/preferences/broadcastsettingsmodel.cpp b/src/preferences/broadcastsettingsmodel.cpp index c5eacab004..88da2bf050 100644 --- a/src/preferences/broadcastsettingsmodel.cpp +++ b/src/preferences/broadcastsettingsmodel.cpp @@ -25,7 +25,8 @@ void BroadcastSettingsModel::resetFromSettings(BroadcastSettingsPointer pSetting m_profiles.clear(); } - for(BroadcastProfilePtr profile : pSettings->profiles()) { + const QList<BroadcastProfilePtr> profiles = pSettings->profiles(); + for (BroadcastProfilePtr profile : profiles) { BroadcastProfilePtr copy = profile->valuesCopy(); copy->setConnectionStatus(profile->connectionStatus()); connect(profile.data(), SIGNAL(statusChanged(bool)), diff --git a/src/preferences/colorpalettesettings.cpp b/src/preferences/colorpalettesettings.cpp index b6ddf30e71..2270194491 100644 --- a/src/preferences/colorpalettesettings.cpp +++ b/src/preferences/colorpalettesettings.cpp @@ -45,15 +45,18 @@ ColorPalette ColorPaletteSettings::getColorPalette( const QString group = kColorPaletteGroupStart + name + kColorPaletteGroupEnd; QList<mixxx::RgbColor> colorList; QList<int> hotcueIndices; - for (const ConfigKey& key : m_pConfig->getKeysWithGroup(group)) { + const QList<ConfigKey> keys = m_pConfig->getKeysWithGroup(group); + for (const auto& key : keys) { if (key.item == kColorPaletteHotcueIndicesConfigItem) { - for (const QString& stringIndex : - m_pConfig->getValueString(key).split(kColorPaletteHotcueIndicesConfigSeparator, + const QStringList stringIndices = + m_pConfig->getValueString(key).split( + kColorPaletteHotcueIndicesConfigSeparator, #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - Qt::SkipEmptyParts)) { + Qt::SkipEmptyParts); #else - QString::SkipEmptyParts)) { + QString::SkipEmptyParts); #endif + for (const auto& stringIndex : stringIndices) { bool ok; int index = stringIndex.toInt(&ok); if (ok && index >= 0) { @@ -96,7 +99,8 @@ void ColorPaletteSettings::setColorPalette(const QString& name, const ColorPalet } QStringList stringIndices; - for (const unsigned int index : colorPalette.getIndicesByHotcue()) { + const QList<int> intIndices = colorPalette.getIndicesByHotcue(); + for (const int index : intIndices) { stringIndices << QString::number(index); } if (!stringIndices.isEmpty()) { @@ -108,7 +112,8 @@ void ColorPaletteSettings::setColorPalette(const QString& name, const ColorPalet void ColorPaletteSettings::removePalette(const QString& name) { const QString group = kColorPaletteGroupStart + name + kColorPaletteGroupEnd; - for (const ConfigKey& key : m_pConfig->getKeysWithGroup(group)) { + const QList<ConfigKey> keys = m_pConfig->getKeysWithGroup(group); + for (const ConfigKey& key : keys) { m_pConfig->remove(key); } } @@ -159,7 +164,8 @@ void ColorPaletteSettings::setTrackColorPalette(const ColorPalette& colorPalette QSet<QString> ColorPaletteSettings::getColorPaletteNames() const { QSet<QString> names; - for (const QString& group : m_pConfig->getGroups()) { + const QSet<QString> groups = m_pConfig->getGroups(); + for (const auto& group : groups) { int pos = kColorPaletteGroupNameRegex.indexIn(group); if (pos > -1) { names.insert(kColorPaletteGroupNameRegex.cap(1)); diff --git a/src/preferences/dialog/dlgprefbroadcast.cpp b/src/preferences/dialog/dlgprefbroadcast.cpp index 13d9a33887..05a286c589 100644 --- a/src/preferences/dialog/dlgprefbroadcast.cpp +++ b/src/preferences/dialog/dlgprefbroadcast.cpp @@ -202,7 +202,8 @@ void DlgPrefBroadcast::slotApply() { // Check for Icecast connections with identical mountpoints on the same host QMap<QString, QString> mountpoints; - for (const BroadcastProfilePtr& profile : m_pSettingsModel->profiles()) { + const QList<BroadcastProfilePtr> broadcastProfiles = m_pSettingsModel->profiles(); + for (const auto& profile : broadcastProfiles) { if (profile->getServertype() != BROADCAST_SERVER_ICECAST2) { continue; } diff --git a/src/preferences/dialog/dlgprefcolors.cpp b/src/preferences/dialog/dlgprefcolors.cpp index f131115126..1210c9b419 100644 --- a/src/preferences/dialog/dlgprefcolors.cpp +++ b/src/preferences/dialog/dlgprefcolors.cpp @@ -89,7 +89,8 @@ void DlgPrefColors::loadSettings() { paletteIcon); } - for (const auto& paletteName : m_colorPaletteSettings.getColorPaletteNames()) { + const QSet<QString> colorPaletteNames = m_colorPaletteSettings.getColorPaletteNames(); + for (const auto& paletteName : colorPaletteNames) { QIcon paletteIcon = drawPalettePreview(paletteName); comboBoxHotcueColors->addItem(paletteName); comboBoxHotcueColors->setItemIcon( diff --git a/src/preferences/dialog/dlgprefeffects.cpp b/src/preferences/dialog/dlgprefeffects.cpp index 2639c6cf56..d1122e6ade 100644 --- a/src/preferences/dialog/dlgprefeffects.cpp +++ b/src/preferences/dialog/dlgprefeffects.cpp @@ -13,7 +13,8 @@ DlgPrefEffects::DlgPrefEffects(QWidget* pParent, setupUi(this); m_availableEffectsModel.resetFromEffectManager(pEffectsManager); - for (auto& profile : m_availableEffectsModel.profiles()) { + const QList<EffectProfilePtr> effectProfiles = m_availableEffectsModel.profiles(); + for (auto& profile : effectProfiles) { EffectManifestPointer pManifest = profile->pManifest; // Users are likely to have lots of external plugins installed and @@ -60,7 +61,8 @@ void DlgPrefEffects::slotUpdate() { } void DlgPrefEffects::slotApply() { - for (const EffectProfilePtr& profile : m_availableEffectsModel.profiles()) { + const QList<EffectProfilePtr> effectProfiles = m_availableEffectsModel.profiles(); + for (const EffectProfilePtr& profile : effectProfiles) { EffectManifestPointer pManifest = profile->pManifest; m_pEffectsManager->setEffectVisibility(pManifest, profile->bIsVisible); diff --git a/src/skin/skinloader.cpp b/src/skin/skinloader.cpp index 69499aa778..abc5a45db0 100644 --- a/src/skin/skinloader.cpp +++ b/src/skin/skinloader.cpp @@ -49,7 +49,8 @@ QList<QDir> SkinLoader::getSkinSearchPaths() const { } QString SkinLoader::getSkinPath(const QString& skinName) const { - for (QDir dir : getSkinSearchPaths()) { + const QList<QDir> skinSearchPaths = getSkinSearchPaths(); + for (QDir dir : skinSearchPaths) { if (dir.cd(skinName)) { return dir.absolutePath(); } diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index ea24987c90..6e77113c21 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -224,7 +224,8 @@ bool SoundManagerConfig::writeToDisk() const { docElement.setAttribute(xmlAttributeDeckCount, m_deckCount); doc.appendChild(docElement); - for (const auto& deviceId: getDevices()) { + const QSet<SoundDeviceId> deviceIds = getDevices(); + for (const auto& deviceId : deviceIds) { QDomElement devElement(doc.createElement(xmlElementSoundDevice)); devElement.setAttribute(xmlAttributeDeviceName, deviceId.name); devElement.setAttribute(xmlAttributePortAudioIndex, deviceId.portAudioIndex); @@ -336,21 +337,29 @@ void SoundManagerConfig::setDeckCount(unsigned int deckCount) { void SoundManagerConfig::setCorrectDeckCount(int configuredDeckCount) { int minimum_deck_count = 0; - for (const auto& device: getDevices()) { - foreach (AudioInput in, m_inputs.values(device)) { - if ((in.getType() == AudioInput::DECK || - in.getType() == AudioInput::VINYLCONTROL || - in.getType() == AudioInput::AUXILIARY) && - in.getIndex() + 1 > minimum_deck_count) { + const QSet<SoundDeviceId> deviceIds = getDevices(); + for (const auto& deviceId : deviceIds) { + for (auto it = m_inputs.constFind(deviceId); + it != m_inputs.constEnd() && it.key() == deviceId; + ++it) { + const int index = it.value().getIndex(); + const AudioPathType type = it.value().getType(); + if ((type == AudioInput::DECK || + type == AudioInput::VINYLCONTROL || + type == AudioInput::AUXILIARY) && + index + 1 > minimum_deck_count) { qDebug() << "Found an input connection above current deck count"; - minimum_deck_count = in.getIndex() + 1; + minimum_deck_count = index + 1; } } - foreach (AudioOutput out, m_outputs.values(device)) { - if (out.getType() == AudioOutput::DECK && - out.getIndex() + 1 > minimum_deck_count) { + for (auto it = m_outputs.constFind(deviceId); + it != m_outputs.constEnd() && it.key() == deviceId; + ++it) { + const int index = it.value().getIndex(); + const AudioPathType type = it.value().getType(); + if (type == AudioOutput::DECK && index + 1 > minimum_deck_count) { qDebug() << "Found an output connection above current deck count"; - minimum_deck_count = out.getIndex() + 1; + minimum_deck_count = index + 1; } } } diff --git a/src/test/soundproxy_test.cpp b/src/test/soundproxy_test.cpp index 7781bb017a..c20c8e2d67 100644 --- a/src/test/soundproxy_test.cpp +++ b/src/test/soundproxy_test.cpp @@ -77,7 +77,8 @@ class SoundSourceProxyTest : public MixxxTest { static QStringList getFilePaths() { QStringList filePaths; - for (const auto& fileNameSuffix: getFileNameSuffixes()) { + const QStringList fileNameSuffixes = getFileNameSuffixes(); + for (const auto& fileNameSuffix : fileNameSuffixes) { filePaths.append(kTestDir.absoluteFilePath("cover-test" + fileNameSuffix)); } return filePaths; @@ -166,11 +167,13 @@ class SoundSourceProxyTest : public MixxxTest { TEST_F(SoundSourceProxyTest, open) { // This test piggy-backs off of the cover-test files. - for (const auto& filePath : getFilePaths()) { + const QStringList filePaths = getFilePaths(); + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pAudioSource = openAudioSource( filePath, providerRegistration.getProvider()); @@ -189,7 +192,8 @@ TEST_F(SoundSourceProxyTest, open) { } TEST_F(SoundSourceProxyTest, openEmptyFile) { - for (const auto& fileNameSuffix: getFileNameSuffixes()) { + const QStringList fileNameSuffixes = getFileNameSuffixes(); + for (const auto& fileNameSuffix : fileNameSuffixes) { const auto tmpFileName = mixxxtest::createEmptyTemporaryFile("emptyXXXXXX" + fileNameSuffix); const mixxxtest::FileRemover tmpFileRemover(tmpFileName); @@ -230,13 +234,15 @@ TEST_F(SoundSourceProxyTest, TOAL_TPE2) { TEST_F(SoundSourceProxyTest, seekForwardBackward) { const SINT kReadFrameCount = 10000; - for (const auto& filePath : getFilePaths()) { + const QStringList filePaths = getFilePaths(); + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); qDebug() << "Seek forward/backward test:" << filePath; const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pContReadSource = openAudioSource( filePath, providerRegistration.getProvider()); @@ -319,13 +325,15 @@ TEST_F(SoundSourceProxyTest, seekForwardBackward) { TEST_F(SoundSourceProxyTest, skipAndRead) { for (auto kReadFrameCount : kBufferSizes) { - for (const auto& filePath : getFilePaths()) { + const QStringList filePaths = getFilePaths(); + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); qDebug() << "Skip and read test:" << filePath; const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pContReadSource = openAudioSource( filePath, providerRegistration.getProvider()); @@ -435,13 +443,15 @@ TEST_F(SoundSourceProxyTest, skipAndRead) { TEST_F(SoundSourceProxyTest, seekBoundaries) { const SINT kReadFrameCount = 1000; - for (const auto& filePath : getFilePaths()) { + const QStringList filePaths = getFilePaths(); + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); qDebug() << "Seek boundaries test:" << filePath; const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pSeekReadSource = openAudioSource( filePath, providerRegistration.getProvider()); @@ -546,14 +556,15 @@ TEST_F(SoundSourceProxyTest, seekBoundaries) { TEST_F(SoundSourceProxyTest, readBeyondEnd) { const SINT kReadFrameCount = 1000; - - for (const auto& filePath : getFilePaths()) { + const QStringList filePaths = getFilePaths(); + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); qDebug() << "read beyond end test:" << filePath; const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pAudioSource = openAudioSource( filePath, providerRegistration.getProvider()); @@ -612,14 +623,15 @@ TEST_F(SoundSourceProxyTest, regressionTestCachingReaderChunkJumpForward) { // seek/read loop in SoundSourceMediaFoundation. Unfortunately this // test doesn't fail even prior to fixing the reported bug. // https://github.com/mixxxdj/mixxx/pull/1317#issuecomment-349674161 - + const QStringList filePaths = getFilePaths(); for (auto kReadFrameCount : kBufferSizes) { - for (const auto& filePath : getFilePaths()) { + for (const auto& filePath : filePaths) { ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); const auto fileUrl = QUrl::fromLocalFile(filePath); - for (const auto& providerRegistration : - SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl)) { + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { mixxx::AudioSourcePointer pAudioSource = openAudioSource( filePath, providerRegistration.getProvider()); diff --git a/src/track/serato/markers2.cpp b/src/track/serato/markers2.cpp index 1c4137cc88..a7a192f3c1 100644 --- a/src/track/serato/markers2.cpp +++ b/src/track/serato/markers2.cpp @@ -599,7 +599,9 @@ QList<CueInfo> SeratoMarkers2::getCues() const { QList<CueInfo> cueInfos; - for (const auto& pEntry : findEntriesByType(SeratoMarkers2Entry::TypeId::Cue)) { + const QList<SeratoMarkers2EntryPointer> cueEntries = + findEntriesByType(SeratoMarkers2Entry::TypeId::Cue); + for (const auto& pEntry : cueEntries) { VERIFY_OR_DEBUG_ASSERT(pEntry) { continue; } @@ -619,7 +621,9 @@ QList<CueInfo> SeratoMarkers2::getCues() const { cueInfos.append(cueInfo); } - for (const auto& pEntry : findEntriesByType(SeratoMarkers2Entry::TypeId::Loop)) { + const QList<SeratoMarkers2EntryPointer> loopEntries = + findEntriesByType(SeratoMarkers2Entry::TypeId::Loop); + for (const auto& pEntry : loopEntries) { VERIFY_OR_DEBUG_ASSERT(pEntry) { continue; } diff --git a/src/track/serato/tags.cpp b/src/track/serato/tags.cpp index c20da45013..d329b91052 100644 --- a/src/track/serato/tags.cpp +++ b/src/track/serato/tags.cpp @@ -278,7 +278,8 @@ QList<CueInfo> SeratoTags::getCueInfos() const { // Serato will use the values from "Serato Markers_"). QMap<int, CueInfo> cueMap; - for (const CueInfo& cueInfo : m_seratoMarkers2.getCues()) { + const QList<CueInfo> cuesMarkers2 = m_seratoMarkers2.getCues(); + for (const CueInfo& cueInfo : cuesMarkers2) { std::optional<int> index = findIndexForCueInfo(cueInfo); if (!index) { continue; @@ -313,7 +314,8 @@ QList<CueInfo> SeratoTags::getCueInfos() const { unsetCuesInMarkersTag.insert(i); } - for (const CueInfo& cueInfo : m_seratoMarkers.getCues()) { + const QList<CueInfo> cuesMarkers = m_seratoMarkers.getCues(); + for (const CueInfo& cueInfo : cuesMarkers) { std::optional<int> index = findIndexForCueInfo(cueInfo); if (!index) { continue; diff --git a/src/track/track.cpp b/src/track/track.cpp index f7ba1a41fc..a02810343b 100644 --- a/src/track/track.cpp +++ b/src/track/track.cpp @@ -1100,8 +1100,10 @@ bool Track::importPendingCueInfosWhileLocked() { const auto trackId = m_record.getId(); QList<CuePointer> cuePoints; cuePoints.reserve(m_pCueInfoImporterPending->size()); - for (const auto& cueInfo : m_pCueInfoImporterPending->importCueInfosAndApplyTimingOffset( - getLocation(), m_streamInfo->getSignalInfo())) { + const auto cueInfos = + m_pCueInfoImporterPending->importCueInfosAndApplyTimingOffset( + getLocation(), m_streamInfo->getSignalInfo()); + for (const auto& cueInfo : cueInfos) { CuePointer pCue(new Cue(cueInfo, sampleRate, true)); // While this method could be called from any thread, // associated Cue objects should always live on the |