Ditto when only the left out-cue is on a shot change

This commit is contained in:
Martijn van Berkel (Flitskikker) 2024-02-05 21:16:13 +01:00
parent 48b7c612b3
commit 2270bf012b

View File

@ -573,11 +573,40 @@ namespace Nikse.SubtitleEdit.Core.Forms
var fixedRightInCueFrame = GetFixedChainableSubtitlesRightInCueFrameOutCueOnShot(bestLeftOutCueFrame, bestRightInCueFrame); var fixedRightInCueFrame = GetFixedChainableSubtitlesRightInCueFrameOutCueOnShot(bestLeftOutCueFrame, bestRightInCueFrame);
if (fixedRightInCueFrame != null) if (fixedRightInCueFrame != null)
{ {
newLeftOutCueFrame = bestLeftOutCueFrame; // Check if there are any shot changes in between them
newRightInCueFrame = fixedRightInCueFrame.Value; var lastShotChangeInBetween = GetLastShotChangeFrameInBetween(bestLeftOutCueFrame, bestRightInCueFrame);
if (lastShotChangeInBetween != 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 = bestLeftOutCueFrame;
newRightInCueFrame = fixedRightInCueFrame.Value;
// Make sure the newly connected subtitles get fixed // Make sure the newly connected subtitles get fixed
shouldFixConnectedSubtitles = true; shouldFixConnectedSubtitles = true;
break;
case BeautifyTimeCodesSettings.BeautifyTimeCodesProfile.ChainingGeneralShotChangeBehaviorEnum.ExtendUntilShotChange:
// Put the right in cue on the shot change, plus gap
newLeftOutCueFrame = bestLeftOutCueFrame;
newRightInCueFrame = lastShotChangeInBetween.Value + Configuration.Settings.BeautifyTimeCodes.Profile.OutCuesGap;
break;
}
}
else
{
// Apply the chaining
newLeftOutCueFrame = bestLeftOutCueFrame;
newRightInCueFrame = fixedRightInCueFrame.Value;
// Make sure the newly connected subtitles get fixed
shouldFixConnectedSubtitles = true;
}
} }
else else
{ {