Skip to content

Commit

Permalink
Hotcue: allow setting hotcue inside active, saved loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Jan 22, 2024
1 parent 1fa52bb commit 5a74988
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,25 @@ void CueControl::hotcueSet(HotcueControl* pControl, double value, HotcueSetMode

bool loopEnabled = m_pLoopEnabled->toBool();
if (mode == HotcueSetMode::Auto) {
mode = loopEnabled ? HotcueSetMode::Loop : HotcueSetMode::Cue;
if (loopEnabled) {
// Don't create a hotcue at loop start if there is one already.
// This allows to set a hotuce inside an active, saved loop with
// 'hotcue_X_activate'.
auto pSavedLoopControl = m_pCurrentSavedLoopControl.loadAcquire();

Check warning on line 859 in src/engine/controls/cuecontrol.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy

'auto pSavedLoopControl' can be declared as 'auto *pSavedLoopControl' [readability-qualified-auto]
if (pSavedLoopControl &&
pSavedLoopControl->getPosition() ==
mixxx::audio::FramePos::fromEngineSamplePosMaybeInvalid(
m_pLoopStartPosition->get()) &&
pSavedLoopControl->getEndPosition() ==
mixxx::audio::FramePos::fromEngineSamplePosMaybeInvalid(
m_pLoopEndPosition->get())) {
mode = HotcueSetMode::Cue;
} else {
mode = HotcueSetMode::Loop;
}
} else {
mode = HotcueSetMode::Cue;
}
}

switch (mode) {
Expand Down

0 comments on commit 5a74988

Please sign in to comment.