Skip to content

Commit 28e5ae6

Browse files
authored
Merge pull request #16279 from daschuer/gh16075
cue cleanup
2 parents 054870d + 9d22fb1 commit 28e5ae6

3 files changed

Lines changed: 13 additions & 26 deletions

File tree

src/engine/controls/cuecontrol.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,6 @@ void CueControl::attachCue(const CuePointer& pCue, HotcueControl* pControl) {
472472
return;
473473
}
474474
detachCue(pControl);
475-
connect(pCue.get(),
476-
&Cue::updated,
477-
this,
478-
&CueControl::cueUpdated,
479-
Qt::DirectConnection);
480-
481475
pControl->setCue(pCue);
482476
}
483477

@@ -491,7 +485,6 @@ void CueControl::detachCue(HotcueControl* pControl) {
491485
return;
492486
}
493487

494-
disconnect(pCue.get(), nullptr, this, nullptr);
495488
m_pCurrentSavedLoopControl.testAndSetRelease(pControl, nullptr);
496489
pControl->resetCue();
497490
}
@@ -640,11 +633,6 @@ void CueControl::slotCueModeChanged(double) {
640633
}
641634
}
642635

643-
void CueControl::cueUpdated() {
644-
//auto lock = lockMutex(&m_mutex);
645-
// We should get a trackCuesUpdated call anyway, so do nothing.
646-
}
647-
648636
void CueControl::loadCuesFromTrack() {
649637
auto lock = lockMutex(&m_trackMutex);
650638
if (!m_pLoadedTrack) {
@@ -983,15 +971,15 @@ void CueControl::hotcueSet(HotcueControl* pControl, double value, HotcueSetMode
983971
}
984972
}
985973

986-
CuePointer pCue = m_pLoadedTrack->createAndAddCue(
974+
m_pLoadedTrack->createAndAddCue(
987975
cueType,
988976
hotcueIndex,
989977
cueStartPosition,
990978
cueEndPosition,
991979
color);
992980

993-
// TODO(XXX) deal with spurious signals
994-
attachCue(pCue, pControl);
981+
// Note: createAndAddCue() emits cuesUpdated() connected to loadCuesFromTrack()
982+
// updating pControl with the created Cue.
995983

996984
if (cueType == mixxx::CueType::Loop) {
997985
setCurrentSavedLoopControlAndActivate(pControl);

src/engine/controls/cuecontrol.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ class CueControl : public EngineControl {
218218
void quantizeChanged(double v);
219219
void slotCueModeChanged(double v);
220220

221-
void cueUpdated();
222221
void trackAnalyzed();
223222
void trackCuesUpdated();
224223
void hotcueSet(HotcueControl* pControl, double v, HotcueSetMode mode);

src/track/track.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,12 @@ void Track::setMainCuePosition(mixxx::audio::FramePos position) {
945945
}
946946

947947
// Store the cue point as main cue
948-
CuePointer pLoadCue = findCueByType(mixxx::CueType::MainCue);
948+
CuePointer pMainCue = findCueByType(mixxx::CueType::MainCue);
949949
if (position.isValid()) {
950-
if (pLoadCue) {
951-
pLoadCue->setStartPosition(position);
950+
if (pMainCue) {
951+
pMainCue->setStartPosition(position);
952952
} else {
953-
pLoadCue = CuePointer(new Cue(
953+
pMainCue = CuePointer(new Cue(
954954
mixxx::CueType::MainCue,
955955
Cue::kNoHotCue,
956956
position,
@@ -959,16 +959,16 @@ void Track::setMainCuePosition(mixxx::audio::FramePos position) {
959959
// While this method could be called from any thread,
960960
// associated Cue objects should always live on the
961961
// same thread as their host, namely this->thread().
962-
pLoadCue->moveToThread(thread());
963-
connect(pLoadCue.get(),
962+
pMainCue->moveToThread(thread());
963+
connect(pMainCue.get(),
964964
&Cue::updated,
965965
this,
966966
&Track::slotCueUpdated);
967-
m_cuePoints.push_back(pLoadCue);
967+
m_cuePoints.push_back(pMainCue);
968968
}
969-
} else if (pLoadCue) {
970-
disconnect(pLoadCue.get(), nullptr, this, nullptr);
971-
m_cuePoints.removeOne(pLoadCue);
969+
} else if (pMainCue) {
970+
disconnect(pMainCue.get(), nullptr, this, nullptr);
971+
m_cuePoints.removeOne(pMainCue);
972972
}
973973

974974
markDirtyAndUnlock(&locked);

0 commit comments

Comments
 (0)