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

Add load point option 'First hotcue' #12869

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 16 additions & 6 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void CueControl::trackLoaded(TrackPointer pNewTrack) {
m_pVinylControlMode->get() == MIXXX_VCMODE_ABSOLUTE)) {
seekOnLoad(mixxx::audio::kStartFramePos);
}
break;
return;
case SeekOnLoadMode::FirstSound: {
CuePointer pN60dBSound =
pNewTrack->findCueByType(mixxx::CueType::N60dBSound);
Expand All @@ -567,8 +567,19 @@ void CueControl::trackLoaded(TrackPointer pNewTrack) {
m_pCuePoint->get());
if (mainCuePosition.isValid()) {
seekOnLoad(mainCuePosition);
} else {
seekOnLoad(mixxx::audio::kStartFramePos);
return;
}
break;
}
case SeekOnLoadMode::FirstHotcue: {
mixxx::audio::FramePos firstHotcuePosition;
HotcueControl* pControl = m_hotcueControls.value(0, nullptr);
if (pControl) {
firstHotcuePosition = pControl->getPosition();
if (firstHotcuePosition.isValid()) {
seekOnLoad(firstHotcuePosition);
return;
}
}
break;
}
Expand All @@ -578,16 +589,15 @@ void CueControl::trackLoaded(TrackPointer pNewTrack) {
m_pIntroStartPosition->get());
if (introStartPosition.isValid()) {
seekOnLoad(introStartPosition);
} else {
seekOnLoad(mixxx::audio::kStartFramePos);
return;
}
break;
}
default:
DEBUG_ASSERT(!"Unknown enum value");
seekOnLoad(mixxx::audio::kStartFramePos);
break;
}
seekOnLoad(mixxx::audio::kStartFramePos);
}

void CueControl::seekOnLoad(mixxx::audio::FramePos seekOnLoadPosition) {
Expand Down
1 change: 1 addition & 0 deletions src/engine/controls/cuecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum class SeekOnLoadMode {
Beginning = 1, // Use 0:00.000
FirstSound = 2, // Skip leading silence
IntroStart = 3, // Use intro start cue point
FirstHotcue = 4,
};

/// Used for requesting a specific hotcue type when activating/setting a
Expand Down
1 change: 1 addition & 0 deletions src/preferences/dialog/dlgprefdeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ DlgPrefDeck::DlgPrefDeck(QWidget* parent, UserSettingsPointer pConfig)

comboBoxLoadPoint->addItem(tr("Intro start"), static_cast<int>(SeekOnLoadMode::IntroStart));
comboBoxLoadPoint->addItem(tr("Main cue"), static_cast<int>(SeekOnLoadMode::MainCue));
comboBoxLoadPoint->addItem(tr("First hotcue"), static_cast<int>(SeekOnLoadMode::FirstHotcue));
comboBoxLoadPoint->addItem(tr("First sound (skip silence)"), static_cast<int>(SeekOnLoadMode::FirstSound));
comboBoxLoadPoint->addItem(tr("Beginning of track"), static_cast<int>(SeekOnLoadMode::Beginning));
bool seekModeExisted = m_pConfig->exists(ConfigKey("[Controls]", "CueRecall"));
Expand Down