mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Allow negative video offfset - thx Marcello :)
This commit is contained in:
parent
0e492d3178
commit
0e4f25167b
@ -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));
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user