summaryrefslogtreecommitdiffstats
path: root/src/analyzer
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2020-11-29 20:18:50 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2020-11-29 20:18:50 +0100
commit39ff07894a1373368e46d04c86c9935406112fa0 (patch)
treee282a9324cdefaea21d416b35b54555786d412a7 /src/analyzer
parent3e6775ab3fe30526da4a2cbd8fb0f57aa37894bb (diff)
Create and initalize Cues at once to avoid sending singlas with halve initalized data
Diffstat (limited to 'src/analyzer')
-rw-r--r--src/analyzer/analyzersilence.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/analyzer/analyzersilence.cpp b/src/analyzer/analyzersilence.cpp
index 2307798bae..4b0c0e8b6a 100644
--- a/src/analyzer/analyzersilence.cpp
+++ b/src/analyzer/analyzersilence.cpp
@@ -107,8 +107,7 @@ void AnalyzerSilence::storeResults(TrackPointer pTrack) {
// 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);
+ pAudibleSound->setStartAndEndPosition(firstSound, lastSound);
}
CuePointer pIntroCue = pTrack->findCueByType(mixxx::CueType::Intro);
@@ -130,17 +129,19 @@ void AnalyzerSilence::storeResults(TrackPointer pTrack) {
}
if (pIntroCue == nullptr) {
- pIntroCue = pTrack->createAndAddCue();
- pIntroCue->setType(mixxx::CueType::Intro);
- pIntroCue->setStartPosition(introStart);
- pIntroCue->setEndPosition(Cue::kNoPosition);
+ pIntroCue = pTrack->createAndAddCue(
+ mixxx::CueType::Intro,
+ Cue::kNoHotCue,
+ introStart,
+ Cue::kNoPosition);
}
CuePointer pOutroCue = pTrack->findCueByType(mixxx::CueType::Outro);
if (pOutroCue == nullptr) {
- pOutroCue = pTrack->createAndAddCue();
- pOutroCue->setType(mixxx::CueType::Outro);
- pOutroCue->setStartPosition(Cue::kNoPosition);
- pOutroCue->setEndPosition(lastSound);
+ pOutroCue = pTrack->createAndAddCue(
+ mixxx::CueType::Outro,
+ Cue::kNoHotCue,
+ Cue::kNoPosition,
+ lastSound);
}
}