When chaining, also check for shot changes in between when only the right in-cue is on a shot change

This commit is contained in:
Martijn van Berkel (Flitskikker) 2024-02-05 13:34:05 +01:00
parent 7fe11340e1
commit aed3ccd8f9

View File

@ -525,11 +525,40 @@ namespace Nikse.SubtitleEdit.Core.Forms
var fixedLeftOutCueFrame = GetFixedChainableSubtitlesLeftOutCueFrameInCueOnShot(bestLeftOutCueFrame, bestRightInCueFrame);
if (fixedLeftOutCueFrame != null)
{
newLeftOutCueFrame = fixedLeftOutCueFrame.Value;
newRightInCueFrame = bestRightInCueFrame;
// Check if there are any shot changes in between them
var firstShotChangeInBetween = GetFirstShotChangeFrameInBetween(bestLeftOutCueFrame, bestRightInCueFrame);
if (firstShotChangeInBetween != null)
{
// There are shot changes in between. Check behaviors
switch (Configuration.Settings.BeautifyTimeCodes.Profile.ChainingGeneralShotChangeBehavior)
{
case BeautifyTimeCodesSettings.BeautifyTimeCodesProfile.ChainingGeneralShotChangeBehaviorEnum.DontChain:
// Don't do anything
return false;
case BeautifyTimeCodesSettings.BeautifyTimeCodesProfile.ChainingGeneralShotChangeBehaviorEnum.ExtendCrossingShotChange:
// Apply the chaining
newLeftOutCueFrame = fixedLeftOutCueFrame.Value;
newRightInCueFrame = bestRightInCueFrame;
// Make sure the newly connected subtitles get fixed
shouldFixConnectedSubtitles = true;
// Make sure the newly connected subtitles get fixed
shouldFixConnectedSubtitles = true;
break;
case BeautifyTimeCodesSettings.BeautifyTimeCodesProfile.ChainingGeneralShotChangeBehaviorEnum.ExtendUntilShotChange:
// Put the left out cue on the shot change, minus gap
newLeftOutCueFrame = firstShotChangeInBetween.Value - Configuration.Settings.BeautifyTimeCodes.Profile.OutCuesGap;
newRightInCueFrame = bestRightInCueFrame;
break;
}
}
else
{
// Apply the chaining
newLeftOutCueFrame = fixedLeftOutCueFrame.Value;
newRightInCueFrame = bestRightInCueFrame;
// Make sure the newly connected subtitles get fixed
shouldFixConnectedSubtitles = true;
}
}
else
{