mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
commit
b2966f9d1a
@ -8016,15 +8016,15 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
private void UpdateOverlapErrors(TimeCode startTime)
|
private void UpdateOverlapErrors(TimeCode startTime)
|
||||||
{
|
{
|
||||||
labelStartTimeWarning.Text = string.Empty;
|
string startTimeWarning = string.Empty;
|
||||||
labelDurationWarning.Text = string.Empty;
|
string durationWarning = string.Empty;
|
||||||
if (_subtitle.Paragraphs.Count > 0 && SubtitleListview1.SelectedItems.Count > 0 && startTime != null)
|
if (_subtitle.Paragraphs.Count > 0 && SubtitleListview1.SelectedItems.Count > 0 && startTime != null)
|
||||||
{
|
{
|
||||||
int firstSelectedIndex = SubtitleListview1.SelectedItems[0].Index;
|
int firstSelectedIndex = SubtitleListview1.SelectedItems[0].Index;
|
||||||
|
|
||||||
var prevParagraph = _subtitle.GetParagraphOrDefault(firstSelectedIndex - 1);
|
var prevParagraph = _subtitle.GetParagraphOrDefault(firstSelectedIndex - 1);
|
||||||
if (prevParagraph != null && prevParagraph.EndTime.TotalMilliseconds > startTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
if (prevParagraph != null && prevParagraph.EndTime.TotalMilliseconds > startTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
||||||
labelStartTimeWarning.Text = string.Format(_languageGeneral.OverlapPreviousLineX, prevParagraph.EndTime.TotalSeconds - startTime.TotalSeconds);
|
startTimeWarning = string.Format(_languageGeneral.OverlapPreviousLineX, prevParagraph.EndTime.TotalSeconds - startTime.TotalSeconds);
|
||||||
|
|
||||||
var nextParagraph = _subtitle.GetParagraphOrDefault(firstSelectedIndex + 1);
|
var nextParagraph = _subtitle.GetParagraphOrDefault(firstSelectedIndex + 1);
|
||||||
if (nextParagraph != null)
|
if (nextParagraph != null)
|
||||||
@ -8032,21 +8032,23 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
double durationMilliSeconds = GetDurationInMilliseconds();
|
double durationMilliSeconds = GetDurationInMilliseconds();
|
||||||
if (startTime.TotalMilliseconds + durationMilliSeconds > nextParagraph.StartTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
if (startTime.TotalMilliseconds + durationMilliSeconds > nextParagraph.StartTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
||||||
{
|
{
|
||||||
labelDurationWarning.Text = string.Format(_languageGeneral.OverlapX, ((startTime.TotalMilliseconds + durationMilliSeconds) - nextParagraph.StartTime.TotalMilliseconds) / TimeCode.BaseUnit);
|
durationWarning = string.Format(_languageGeneral.OverlapX, ((startTime.TotalMilliseconds + durationMilliSeconds) - nextParagraph.StartTime.TotalMilliseconds) / TimeCode.BaseUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labelStartTimeWarning.Text.Length == 0 &&
|
if (startTimeWarning.Length == 0 &&
|
||||||
startTime.TotalMilliseconds > nextParagraph.StartTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
startTime.TotalMilliseconds > nextParagraph.StartTime.TotalMilliseconds && Configuration.Settings.Tools.ListViewSyntaxColorOverlap)
|
||||||
{
|
{
|
||||||
double di = (startTime.TotalMilliseconds - nextParagraph.StartTime.TotalMilliseconds) / TimeCode.BaseUnit;
|
double di = (startTime.TotalMilliseconds - nextParagraph.StartTime.TotalMilliseconds) / TimeCode.BaseUnit;
|
||||||
labelStartTimeWarning.Text = string.Format(_languageGeneral.OverlapNextX, di);
|
startTimeWarning = string.Format(_languageGeneral.OverlapNextX, di);
|
||||||
}
|
}
|
||||||
else if (numericUpDownDuration.Value < 0)
|
else if (numericUpDownDuration.Value < 0)
|
||||||
{
|
{
|
||||||
labelDurationWarning.Text = _languageGeneral.Negative;
|
durationWarning = _languageGeneral.Negative;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
labelStartTimeWarning.Text = startTimeWarning;
|
||||||
|
labelDurationWarning.Text = durationWarning;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double GetDurationInMilliseconds()
|
private double GetDurationInMilliseconds()
|
||||||
@ -11064,7 +11066,6 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkBoxSyncListViewWithVideoWhilePlaying.Checked = oldSync;
|
checkBoxSyncListViewWithVideoWhilePlaying.Checked = oldSync;
|
||||||
numericUpDownDuration.ValueChanged += NumericUpDownDurationValueChanged;
|
|
||||||
|
|
||||||
if (goToNext)
|
if (goToNext)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user