summaryrefslogtreecommitdiffstats
path: root/src/analyzer
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2020-11-29 19:35:10 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2020-11-29 19:35:10 +0100
commit3e6775ab3fe30526da4a2cbd8fb0f57aa37894bb (patch)
tree0b3b78b8a0c5bdd6adf57fe8089db9440d82a5ec /src/analyzer
parent8b0614dea84726b5d1e05b95bf92fc496d47d83c (diff)
Add Cue::setStartAndEndPosition() for setting both under one locking scope
Diffstat (limited to 'src/analyzer')
-rw-r--r--src/analyzer/analyzersilence.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/analyzer/analyzersilence.cpp b/src/analyzer/analyzersilence.cpp
index c07cde2e53..2307798bae 100644
--- a/src/analyzer/analyzersilence.cpp
+++ b/src/analyzer/analyzersilence.cpp
@@ -95,17 +95,21 @@ void AnalyzerSilence::storeResults(TrackPointer pTrack) {
CuePointer pAudibleSound = pTrack->findCueByType(mixxx::CueType::AudibleSound);
if (pAudibleSound == nullptr) {
- pAudibleSound = pTrack->createAndAddCue();
- pAudibleSound->setType(mixxx::CueType::AudibleSound);
+ pAudibleSound = pTrack->createAndAddCue(
+ mixxx::CueType::AudibleSound,
+ Cue::kNoHotCue,
+ firstSound,
+ lastSound);
+ } else {
+ // The user has no way to directly edit the AudibleSound cue. If the user
+ // has deleted the Intro or Outro Cue, this analysis will be rerun when
+ // the track is loaded again. In this case, adjust the AudibleSound Cue's
+ // positions. This could be helpful, for example, when the track length
+ // is changed in a different program, or the silence detection threshold
+ // is changed.
+ pAudibleSound->setStartPosition(firstSound);
+ pAudibleSound->setEndPosition(lastSound);
}
- // The user has no way to directly edit the AudibleSound cue. If the user
- // has deleted the Intro or Outro Cue, this analysis will be rerun when
- // the track is loaded again. In this case, adjust the AudibleSound Cue's
- // positions. This could be helpful, for example, when the track length
- // is changed in a different program, or the silence detection threshold
- // is changed.
- pAudibleSound->setStartPosition(firstSound);
- pAudibleSound->setEndPosition(lastSound);
CuePointer pIntroCue = pTrack->findCueByType(mixxx::CueType::Intro);