diff options
author | xerus2000 <27jf@pm.me> | 2020-11-13 21:35:08 +0100 |
---|---|---|
committer | xerus2000 <27jf@pm.me> | 2020-11-13 21:35:08 +0100 |
commit | 8e18c532f3bb04177093581f2ec1bc993225079e (patch) | |
tree | 56b4492feeaa7ca036de3b9cd91bc0e566c78d36 /src/engine | |
parent | 2d9dcff9256b8b092af0d6d89f94b797e441c95a (diff) | |
parent | 3a9048073bf045c40ae015d61634bf6248540ce2 (diff) |
Merge remote-tracking branch 'upstream/2.3' into cleanup-headers
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/controls/cuecontrol.cpp | 15 | ||||
-rw-r--r-- | src/engine/effects/engineeffectchain.cpp | 4 | ||||
-rw-r--r-- | src/engine/effects/engineeffectrack.cpp | 4 | ||||
-rw-r--r-- | src/engine/sidechain/enginenetworkstream.cpp | 4 | ||||
-rw-r--r-- | src/engine/sync/enginesync.cpp | 4 |
5 files changed, 17 insertions, 14 deletions
diff --git a/src/engine/controls/cuecontrol.cpp b/src/engine/controls/cuecontrol.cpp index 9a5947a32c..3a92609105 100644 --- a/src/engine/controls/cuecontrol.cpp +++ b/src/engine/controls/cuecontrol.cpp @@ -341,7 +341,7 @@ void CueControl::trackLoaded(TrackPointer pNewTrack) { QMutexLocker lock(&m_mutex); if (m_pLoadedTrack) { disconnect(m_pLoadedTrack.get(), 0, this, 0); - for (const auto& pControl : m_hotcueControls) { + for (const auto& pControl : qAsConst(m_hotcueControls)) { detachCue(pControl); } @@ -372,7 +372,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; @@ -475,10 +476,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 @@ -902,7 +905,7 @@ void CueControl::hintReader(HintVector* pHintList) { // this is called from the engine thread // it is no locking required, because m_hotcueControl is filled during the // constructor and getPosition()->get() is a ControlObject - for (const auto& pControl: m_hotcueControls) { + for (const auto& pControl : qAsConst(m_hotcueControls)) { double position = pControl->getPosition(); if (position != Cue::kNoPosition) { cue_hint.frame = SampleUtil::floorPlayPosToFrame(position); @@ -1520,10 +1523,10 @@ void CueControl::outroEndActivate(double value) { } } +// This is also called from the engine thread. No locking allowed. bool CueControl::updateIndicatorsAndModifyPlay(bool newPlay, bool oldPlay, bool playPossible) { //qDebug() << "updateIndicatorsAndModifyPlay" << newPlay << playPossible // << m_iCurrentlyPreviewingHotcues << m_bPreviewing; - QMutexLocker lock(&m_mutex); CueMode cueMode = static_cast<CueMode>(static_cast<int>(m_pCueMode->get())); if ((cueMode == CueMode::Denon || cueMode == CueMode::Numark) && newPlay && !oldPlay && playPossible && diff --git a/src/engine/effects/engineeffectchain.cpp b/src/engine/effects/engineeffectchain.cpp index 2a8b5ac137..9fd5d8079a 100644 --- a/src/engine/effects/engineeffectchain.cpp +++ b/src/engine/effects/engineeffectchain.cpp @@ -212,7 +212,7 @@ void EngineEffectChain::deleteStatesForInputChannel(const ChannelHandle* inputCh for (auto&& outputChannelStatus : outputMap) { outputChannelStatus.enableState = EffectEnableState::Disabled; } - for (EngineEffect* pEffect : m_effects) { + for (EngineEffect* pEffect : qAsConst(m_effects)) { if (pEffect != nullptr) { pEffect->deleteStatesForInputChannel(inputChannel); } @@ -265,7 +265,7 @@ bool EngineEffectChain::process(const ChannelHandle& inputHandle, CSAMPLE* pIntermediateOutput; bool firstAddDryToWetEffectProcessed = false; - for (EngineEffect* pEffect: m_effects) { + for (EngineEffect* pEffect : qAsConst(m_effects)) { if (pEffect != nullptr) { // Select an unused intermediate buffer for the next output if (pIntermediateInput == m_buffer1.data()) { diff --git a/src/engine/effects/engineeffectrack.cpp b/src/engine/effects/engineeffectrack.cpp index f59ab97b52..7afe4ecb71 100644 --- a/src/engine/effects/engineeffectrack.cpp +++ b/src/engine/effects/engineeffectrack.cpp @@ -53,7 +53,7 @@ bool EngineEffectRack::process(const ChannelHandle& inputHandle, bool processingOccured = false; if (pIn == pOut) { // Effects are applied to the buffer in place - for (EngineEffectChain* pChain : m_chains) { + for (EngineEffectChain* pChain : qAsConst(m_chains)) { if (pChain != nullptr) { if (pChain->process(inputHandle, outputHandle, pIn, pOut, @@ -67,7 +67,7 @@ bool EngineEffectRack::process(const ChannelHandle& inputHandle, CSAMPLE* pIntermediateInput = pIn; CSAMPLE* pIntermediateOutput; - for (EngineEffectChain* pChain : m_chains) { + for (EngineEffectChain* pChain : qAsConst(m_chains)) { if (pChain != nullptr) { // Select an unused intermediate buffer for the next output if (pIntermediateInput == m_buffer1.data()) { diff --git a/src/engine/sidechain/enginenetworkstream.cpp b/src/engine/sidechain/enginenetworkstream.cpp index a3d406ee46..ea0b6eb586 100644 --- a/src/engine/sidechain/enginenetworkstream.cpp +++ b/src/engine/sidechain/enginenetworkstream.cpp @@ -78,7 +78,7 @@ void EngineNetworkStream::startStream(double sampleRate) { m_inputStreamStartTimeUs = getNetworkTimeUs(); m_inputStreamFramesWritten = 0; - for(NetworkOutputStreamWorkerPtr worker : m_outputWorkers) { + for (NetworkOutputStreamWorkerPtr worker : qAsConst(m_outputWorkers)) { if (worker.isNull()) { continue; } @@ -90,7 +90,7 @@ void EngineNetworkStream::startStream(double sampleRate) { void EngineNetworkStream::stopStream() { m_inputStreamStartTimeUs = -1; - for(NetworkOutputStreamWorkerPtr worker : m_outputWorkers) { + for (NetworkOutputStreamWorkerPtr worker : qAsConst(m_outputWorkers)) { if (worker.isNull()) { continue; } diff --git a/src/engine/sync/enginesync.cpp b/src/engine/sync/enginesync.cpp index d180f23b9b..bf27fbd1a7 100644 --- a/src/engine/sync/enginesync.cpp +++ b/src/engine/sync/enginesync.cpp @@ -30,7 +30,7 @@ Syncable* EngineSync::pickMaster(Syncable* enabling_syncable) { int stopped_deck_count = 0; int playing_deck_count = 0; - for (const auto& pSyncable : m_syncables) { + for (const auto& pSyncable : qAsConst(m_syncables)) { if (pSyncable->getBaseBpm() <= 0.0) { continue; } @@ -458,7 +458,7 @@ Syncable* EngineSync::pickNonSyncSyncTarget(EngineChannel* pDontPick) const { bool EngineSync::otherSyncedPlaying(const QString& group) { bool othersInSync = false; - for (Syncable* theSyncable : m_syncables) { + for (Syncable* theSyncable : qAsConst(m_syncables)) { bool isSynchonized = theSyncable->isSynchronized(); if (theSyncable->getGroup() == group) { if (!isSynchonized) { |