summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBe <be@mixxx.org>2019-10-22 02:33:38 -0500
committerBe <be@mixxx.org>2019-10-22 02:33:38 -0500
commitb2d8bdd3db0f316505ed2eca215573b29a9cf5f9 (patch)
tree7256e9dea83109803c90529141432029edd4a1d3 /src
parent187024ffcdac5a15a7d6dad051b27193f6118866 (diff)
AnalyzerSilence: reimplement moving default cue point to first sound when upgrading
Diffstat (limited to 'src')
-rw-r--r--src/analyzer/analyzersilence.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/analyzer/analyzersilence.cpp b/src/analyzer/analyzersilence.cpp
index 7108de3900..3947e8b542 100644
--- a/src/analyzer/analyzersilence.cpp
+++ b/src/analyzer/analyzersilence.cpp
@@ -106,11 +106,17 @@ void AnalyzerSilence::storeResults(TrackPointer pTrack) {
double mainCue = pTrack->getCuePoint().getPosition();
double introStart = firstSound;
- if (mainCue == kCueNotSet) {
+ // Before Mixxx 2.3, the default position for the main cue was 0.0. In this
+ // case, move the main cue point to the first sound. This case can be
+ // distinguished from a user intentionally setting the main cue position
+ // to 0.0 at a later time after analysis because in that case the intro cue
+ // would have already been created by this analyzer.
+ bool upgradingWithMainCueAtDefault = (mainCue == 0.0 && pIntroCue == nullptr);
+ if (mainCue == kCueNotSet || upgradingWithMainCueAtDefault) {
pTrack->setCuePoint(CuePosition(firstSound));
// NOTE: the actual default for this ConfigValue is set in DlgPrefDeck.
} else if (m_pConfig->getValue(ConfigKey("[Controls]", "SetIntroStartAtMainCue"), false)
- && pIntroCue == nullptr && mainCue != 0.0) {
+ && pIntroCue == nullptr) {
introStart = mainCue;
}