Skip to content

Commit

Permalink
Do not add main cue if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 24, 2021
1 parent 987250c commit e7c1131
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/engine/controls/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,15 +648,24 @@ void CueControl::loadCuesFromTrack() {
m_pLoadedTrack->setMainCuePosition(mainCuePosition);
} else {
// If no load cue point is stored, read from track
// Note: This is 0:00 for new tracks
// Note: This is mixxx::audio::kStartFramePos for new tracks
// and always a valid position.
mainCuePosition = m_pLoadedTrack->getMainCuePosition();
DEBUG_ASSERT(mainCuePosition == mixxx::audio::kStartFramePos);
// Than add the load cue to the list of cue
CuePointer pCue = m_pLoadedTrack->createAndAddCue(
mixxx::CueType::MainCue,
Cue::kNoHotCue,
mainCuePosition,
mixxx::audio::kInvalidFramePos);
DEBUG_ASSERT(mainCuePosition.isValid());
// A main cue point only needs to be added if the position
// differs from the default position.
if (mainCuePosition != mixxx::audio::kStartFramePos) {
qInfo()
<< "Adding missing main cue point at"
<< mainCuePosition
<< "for track"
<< m_pLoadedTrack->getLocation();
m_pLoadedTrack->createAndAddCue(
mixxx::CueType::MainCue,
Cue::kNoHotCue,
mainCuePosition,
mixxx::audio::kInvalidFramePos);
}
}

DEBUG_ASSERT(mainCuePosition.isValid());
Expand Down

0 comments on commit e7c1131

Please sign in to comment.