Allow negative video offfset - thx Marcello :)

This commit is contained in:
niksedk 2019-05-28 21:37:59 +02:00
parent 0e492d3178
commit 0e4f25167b
4 changed files with 10 additions and 10 deletions

View File

@ -5729,7 +5729,7 @@ $HorzAlign = Center
textWriter.WriteAttributeString("FirstVisibleIndex", item.FirstVisibleIndex.ToString(CultureInfo.InvariantCulture));
textWriter.WriteAttributeString("FirstSelectedIndex", item.FirstSelectedIndex.ToString(CultureInfo.InvariantCulture));
if (item.VideoOffsetInMs > 0)
if (item.VideoOffsetInMs != 0)
{
textWriter.WriteAttributeString("VideoOffset", item.VideoOffsetInMs.ToString(CultureInfo.InvariantCulture));
}

View File

@ -1364,7 +1364,7 @@ namespace Nikse.SubtitleEdit.Controls
private string GetDisplayTime(TimeCode timeCode)
{
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
return new TimeCode(timeCode.TotalMilliseconds + Configuration.Settings.General.CurrentVideoOffsetInMs).ToDisplayString();
}

View File

@ -466,7 +466,7 @@ namespace Nikse.SubtitleEdit.Forms
{
FixStartEndWithSameTimeCode();
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
_subtitle.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(Configuration.Settings.General.CurrentVideoOffsetInMs));
}
@ -819,7 +819,7 @@ namespace Nikse.SubtitleEdit.Forms
}
buttonExport.Enabled = true;
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
_subtitle.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(-Configuration.Settings.General.CurrentVideoOffsetInMs));
}

View File

@ -2105,7 +2105,7 @@ namespace Nikse.SubtitleEdit.Forms
{
OpenSubtitle(rfe.FileName, null, rfe.VideoFileName, rfe.OriginalFileName);
Configuration.Settings.General.CurrentVideoOffsetInMs = rfe.VideoOffsetInMs;
if (rfe.VideoOffsetInMs > 0)
if (rfe.VideoOffsetInMs != 0)
{
_subtitle.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(-Configuration.Settings.General.CurrentVideoOffsetInMs));
_changeSubtitleHash = _subtitle.GetFastHashCode(GetCurrentEncoding().BodyName);
@ -3431,7 +3431,7 @@ namespace Nikse.SubtitleEdit.Forms
{
OpenSubtitle(rfe.FileName, null, rfe.VideoFileName, rfe.OriginalFileName);
Configuration.Settings.General.CurrentVideoOffsetInMs = rfe.VideoOffsetInMs;
if (rfe.VideoOffsetInMs > 0)
if (rfe.VideoOffsetInMs != 0)
{
_subtitle.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(-Configuration.Settings.General.CurrentVideoOffsetInMs));
_changeSubtitleHash = _subtitle.GetFastHashCode(GetCurrentEncoding().BodyName);
@ -5708,7 +5708,7 @@ namespace Nikse.SubtitleEdit.Forms
index++;
}
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
_subtitle.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(-Configuration.Settings.General.CurrentVideoOffsetInMs));
}
@ -21614,7 +21614,7 @@ namespace Nikse.SubtitleEdit.Forms
smpteTimeModedropFrameToolStripMenuItem.Visible = !string.IsNullOrEmpty(_videoFileName);
if (!string.IsNullOrEmpty(_videoFileName))
{
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
setVideoOffsetToolStripMenuItem.Text = string.Format("{0} [{1}]", _language.Menu.Video.SetVideoOffset, new TimeCode(Configuration.Settings.General.CurrentVideoOffsetInMs).ToShortDisplayString());
}
@ -24606,7 +24606,7 @@ namespace Nikse.SubtitleEdit.Forms
sub.FileName = "Untitled";
}
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
sub.AddTimeToAllParagraphs(TimeSpan.FromMilliseconds(Configuration.Settings.General.CurrentVideoOffsetInMs));
}
@ -25192,7 +25192,7 @@ namespace Nikse.SubtitleEdit.Forms
using (var form = new SetVideoOffset())
{
form.VideoOffset = new TimeCode(10, 0, 0, 0);
if (Configuration.Settings.General.CurrentVideoOffsetInMs > 0)
if (Configuration.Settings.General.CurrentVideoOffsetInMs != 0)
{
form.VideoOffset = new TimeCode(Configuration.Settings.General.CurrentVideoOffsetInMs);
}