-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
AutoDJ: don't use removed Intro end and outro start makers, use transition time instead #11830
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dd608bf
Auto-DJ: Don't adopt last sound as outro end, when user has explicit …
daschuer 430a8f8
Auto-DJ: Don't adopt first sound as intro start, when user has explic…
daschuer 8f892dc
Add some comments
daschuer 8e1e8bb
Improve comments
daschuer c2a54a7
Allow to place an automatic set transition into the prerole
daschuer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1093,8 +1093,18 @@ void AutoDJProcessor::playerOutroEndChanged(DeckAttributes* pAttributes, double | |
double AutoDJProcessor::getIntroStartSecond(DeckAttributes* pDeck) { | ||
const mixxx::audio::FramePos trackEndPosition = pDeck->trackEndPosition(); | ||
const mixxx::audio::FramePos introStartPosition = pDeck->introStartPosition(); | ||
const mixxx::audio::FramePos introEndPosition = pDeck->introEndPosition(); | ||
if (!introStartPosition.isValid() || introStartPosition > trackEndPosition) { | ||
return getFirstSoundSecond(pDeck); | ||
double firstSoundSecond = getFirstSoundSecond(pDeck); | ||
if (!introEndPosition.isValid() || introEndPosition > trackEndPosition) { | ||
// No intro start and intro end set, use First Sound. | ||
return firstSoundSecond; | ||
} | ||
double introEndSecond = framePositionToSeconds(introEndPosition, pDeck); | ||
if (m_transitionTime >= 0) { | ||
return introEndSecond - m_transitionTime; | ||
} | ||
return introEndSecond; | ||
} | ||
return framePositionToSeconds(introStartPosition, pDeck); | ||
} | ||
|
@@ -1127,12 +1137,30 @@ double AutoDJProcessor::getOutroStartSecond(DeckAttributes* pDeck) { | |
|
||
double AutoDJProcessor::getOutroEndSecond(DeckAttributes* pDeck) { | ||
const mixxx::audio::FramePos trackEndPosition = pDeck->trackEndPosition(); | ||
const mixxx::audio::FramePos outroStartPosition = pDeck->outroStartPosition(); | ||
const mixxx::audio::FramePos outroEndPosition = pDeck->outroEndPosition(); | ||
if (!outroEndPosition.isValid() || outroEndPosition > trackEndPosition) { | ||
return getLastSoundSecond(pDeck); | ||
double lastSoundSecond = getLastSoundSecond(pDeck); | ||
DEBUG_ASSERT(lastSoundSecond <= framePositionToSeconds(trackEndPosition, pDeck)); | ||
if (!outroStartPosition.isValid() || outroStartPosition > trackEndPosition) { | ||
// No outro start and outro end set, use Last Sound. | ||
return lastSoundSecond; | ||
} | ||
// Try to find a better Outro End using Outro Start and transition time | ||
double outroStartSecond = framePositionToSeconds(outroStartPosition, pDeck); | ||
if (m_transitionTime >= 0 && lastSoundSecond > outroStartSecond) { | ||
double outroEndFromTime = outroStartSecond + m_transitionTime; | ||
if (outroEndFromTime < lastSoundSecond) { | ||
Comment on lines
+1152
to
+1153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you'll also need to check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lastSoundSecond has been clamped to be <= trackEndPosition |
||
// The outroEnd is automatically placed by AnalyzerSilence at the last sound | ||
// Here the user has removed it, but has placed a outro start. | ||
// Use the transition time instead of the dismissed last sound position. | ||
return outroEndFromTime; | ||
} | ||
return lastSoundSecond; | ||
} | ||
return outroStartSecond; | ||
} | ||
return framePositionToSeconds(outroEndPosition, pDeck); | ||
; | ||
} | ||
|
||
double AutoDJProcessor::getFirstSoundSecond(DeckAttributes* pDeck) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't this dependent on transition mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we calculate a reliable OutroEnd position, as an input to the transition mode dependent code.
The change here takes place in case we have an OutroStart. Than we try to use the transition time to calulate a better OutroEnd than just the lastSoundSecond as the last resort.