summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-05-06 15:58:15 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-05-06 15:58:15 +0200
commit892087bd9b9f412c67ed7ed2e3834cb5bbb5e501 (patch)
tree074b98498024f802e8eff9ebc47e3ad4f3210b93 /src
parentd9c53c569bc053b173261bd296fa5412d737fad0 (diff)
engine/controls/cuecontrol: Allow using saved loops as hotcues
Diffstat (limited to 'src')
-rw-r--r--src/engine/controls/cuecontrol.cpp23
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;
}
}