diff options
-rw-r--r-- | src/engine/controls/cuecontrol.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/engine/controls/cuecontrol.cpp b/src/engine/controls/cuecontrol.cpp index 46bb3f2060..c479f42d5c 100644 --- a/src/engine/controls/cuecontrol.cpp +++ b/src/engine/controls/cuecontrol.cpp @@ -467,21 +467,30 @@ void CueControl::loadCuesFromTrack() { return; for (const CuePointer& pCue: m_pLoadedTrack->getCuePoints()) { - if (pCue->getType() == mixxx::CueType::MainCue) { + switch (pCue->getType()) { + case mixxx::CueType::MainCue: DEBUG_ASSERT(!pLoadCue); // There should be only one MainCue cue pLoadCue = pCue; - } else if (pCue->getType() == mixxx::CueType::Intro) { + break; + case mixxx::CueType::Intro: DEBUG_ASSERT(!pIntroCue); // There should be only one Intro cue pIntroCue = pCue; - } else if (pCue->getType() == mixxx::CueType::Outro) { + break; + case mixxx::CueType::Outro: DEBUG_ASSERT(!pOutroCue); // There should be only one Outro cue pOutroCue = pCue; - } else if (pCue->getType() == mixxx::CueType::HotCue && pCue->getHotCue() != Cue::kNoHotCue) { + break; + case mixxx::CueType::HotCue: + case mixxx::CueType::Loop: { + if (pCue->getHotCue() == Cue::kNoHotCue) { + continue; + } + int hotcue = pCue->getHotCue(); HotcueControl* pControl = m_hotcueControls.value(hotcue, NULL); // Cue's hotcue doesn't have a hotcue control. - if (pControl == NULL) { + if (pControl == nullptr) { continue; } @@ -498,6 +507,10 @@ void CueControl::loadCuesFromTrack() { } // Add the hotcue to the list of active hotcues active_hotcues.insert(hotcue); + break; + } + default: + continue; } } |