Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't disable loop cues when latching it via play. lp1942656 #4265

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't disable loop cues when latching it via play. lp1942656
This fixes also a segfault that happens when deleting a cue in preview state.
daschuer committed Sep 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 615554321ef0c63d8c749a7db4ee63c6d78b2d7c
20 changes: 16 additions & 4 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
@@ -1084,9 +1084,9 @@ void CueControl::updateCurrentlyPreviewingIndex(int hotcueIndex) {
m_pLoopEnabled->set(0);
}
CuePointer pLastCue(pLastControl->getCue());
pLastControl->setStatus((pLastCue->getType() == mixxx::CueType::Invalid)
? HotcueControl::Status::Empty
: HotcueControl::Status::Set);
if (pLastCue && pLastCue->getType() != mixxx::CueType::Invalid) {
pLastControl->setStatus(HotcueControl::Status::Set);
}
}
}

@@ -1921,7 +1921,19 @@ bool CueControl::updateIndicatorsAndModifyPlay(
if (m_currentlyPreviewingIndex != Cue::kNoHotCue) {
if (!newPlay && oldPlay) {
// play latch request: stop previewing and go into normal play mode.
updateCurrentlyPreviewingIndex(Cue::kNoHotCue);
int oldPreviewingIndex =
m_currentlyPreviewingIndex.fetchAndStoreRelease(
Cue::kNoHotCue);
if (oldPreviewingIndex >= 0 && oldPreviewingIndex < m_iNumHotCues) {
HotcueControl* pLastControl = m_hotcueControls.at(oldPreviewingIndex);
mixxx::CueType lastType = pLastControl->getPreviewingType();
if (lastType != mixxx::CueType::Loop) {
CuePointer pLastCue(pLastControl->getCue());
if (pLastCue && pLastCue->getType() != mixxx::CueType::Invalid) {
pLastControl->setStatus(HotcueControl::Status::Set);
}
}
}
Comment on lines -1924 to +1936
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this code go in updateCurrentlyPreviewingIndex instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not work here, because we need to keep the active state of the loop cue here for latching. Using updateCurrentlyPreviewingIndex in both cases was the root cause of this bug.

newPlay = true;
m_pPlayLatched->forceSet(1.0);
} else {