mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Ran CodeMaid.
This commit is contained in:
parent
e709c67ec1
commit
f13d7c1b81
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.MaterialExchangeFormat
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.MaterialExchangeFormat
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.ContainerFormats.Ebml;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.ContainerFormats.Ebml;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.Matroska
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Ripped from http://www.codeproject.com/KB/recipes/DetectEncoding.aspx
|
||||
|
||||
using Nikse.SubtitleEdit.Core.DetectEncoding.Multilang;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.DetectEncoding.Multilang;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.DetectEncoding
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
private int _successCount;
|
||||
|
||||
public string Error { get; set; }
|
||||
|
||||
public bool Done
|
||||
{
|
||||
get
|
||||
@ -25,6 +26,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
return _successCount == 1;
|
||||
}
|
||||
}
|
||||
|
||||
public string LatestVersionNumber { get; set; }
|
||||
public string LatestChangeLog { get; set; }
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
{
|
||||
@ -42,6 +42,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
}
|
||||
|
||||
private string _language = "en";
|
||||
|
||||
public string Language
|
||||
{
|
||||
get { return _language; }
|
||||
@ -54,6 +55,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
}
|
||||
|
||||
private Encoding _encoding = Encoding.UTF8;
|
||||
|
||||
public Encoding Encoding
|
||||
{
|
||||
get { return _encoding; }
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
{
|
||||
public class FixHyphensAdd : IFixCommonError
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
{
|
||||
public class FixHyphensRemove : IFixCommonError
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
{
|
||||
|
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
{
|
||||
public class RemoveSpaceBetweenNumbers : IFixCommonError
|
||||
{
|
||||
|
@ -661,7 +661,6 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
text = "<i>" + text.Remove(0, removeText.Length).TrimStart(' ');
|
||||
}
|
||||
|
||||
|
||||
if (oldText != text)
|
||||
{
|
||||
// insert spaces before "-"
|
||||
|
@ -1364,6 +1364,7 @@
|
||||
|
||||
//translation helper
|
||||
public string AutoRepeat { get; set; }
|
||||
|
||||
public string AutoRepeatOn { get; set; }
|
||||
public string AutoRepeatCount { get; set; }
|
||||
public string AutoContinue { get; set; }
|
||||
@ -1383,6 +1384,7 @@
|
||||
|
||||
// create/adjust
|
||||
public string InsertNewSubtitleAtVideoPosition { get; set; }
|
||||
|
||||
public string Auto { get; set; }
|
||||
public string PlayFromJustBeforeText { get; set; }
|
||||
public string Pause { get; set; }
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
@ -1098,7 +1098,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
|
||||
var pixels = new byte[_bitmapData.Length];
|
||||
int offsetDest = 0;
|
||||
for (int y = Height-1; y >= 0; y--) // takes lines from bottom lines to top (mirrowed horizontally)
|
||||
for (int y = Height - 1; y >= 0; y--) // takes lines from bottom lines to top (mirrowed horizontally)
|
||||
{
|
||||
for (int x = 0; x < Width; x++)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Security;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32;
|
||||
using System.Security;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Nikse.SubtitleEdit.Core.Interfaces;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
|
@ -1849,7 +1849,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
settings.SubtitleSettings.SsaMarginRight = Convert.ToInt32(subNode.InnerText);
|
||||
subNode = node.SelectSingleNode("SsaMarginTopBottom");
|
||||
if (subNode != null)
|
||||
settings.SubtitleSettings.SsaMarginTopBottom= Convert.ToInt32(subNode.InnerText);
|
||||
settings.SubtitleSettings.SsaMarginTopBottom = Convert.ToInt32(subNode.InnerText);
|
||||
subNode = node.SelectSingleNode("DCinemaFontFile");
|
||||
if (subNode != null)
|
||||
settings.SubtitleSettings.DCinemaFontFile = subNode.InnerText;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
|
@ -110,7 +110,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
header[2082] = 0x01;
|
||||
header[2085] = 0x01;
|
||||
|
||||
|
||||
// Microsoft Sans Serif
|
||||
header[2088] = 0x4d;
|
||||
header[2089] = 0x69;
|
||||
|
@ -717,7 +717,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
_languageIdLine2 = LanguageIdRussian;
|
||||
}
|
||||
|
||||
|
||||
// Chinese
|
||||
else if (_languageIdLine1 == LanguageIdChineseSimplified)
|
||||
{
|
||||
@ -730,7 +729,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
_languageIdLine2 = LanguageIdChineseTraditional;
|
||||
}
|
||||
|
||||
|
||||
int i = 455;
|
||||
int lastNumber = -1;
|
||||
while (i < buffer.Length - 20)
|
||||
|
@ -148,7 +148,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
text = text.Remove(0, 5);
|
||||
}
|
||||
|
||||
|
||||
// special language codes...
|
||||
text = text.Replace("ÔA", "Á");
|
||||
text = text.Replace("ÔE", "É");
|
||||
|
@ -13,7 +13,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
public class Ebu : SubtitleFormat
|
||||
{
|
||||
|
||||
const string LanguageCodeChinese = "75";
|
||||
private const string LanguageCodeChinese = "75";
|
||||
|
||||
public interface IEbuUiHelper
|
||||
{
|
||||
@ -382,7 +382,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
else if (Configuration.Settings.SubtitleSettings.EbuStlTeletextUseDoubleHeight)
|
||||
{
|
||||
newline = encoding.GetString(new byte[] {0x8a, 0x8a, 0x0d, 0x0d }); // 0d==double height
|
||||
newline = encoding.GetString(new byte[] { 0x8a, 0x8a, 0x0d, 0x0d }); // 0d==double height
|
||||
}
|
||||
if (header.DisplayStandardCode == "0") // 0=Open subtitling
|
||||
{
|
||||
@ -1162,22 +1162,21 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
sb.Append("<u>");
|
||||
else if (b == underlineOff && header.LanguageCode != LanguageCodeChinese)
|
||||
sb.Append("</u>");
|
||||
|
||||
else if (b == 0xd3 && header.CharacterCodeTableNumber == "00") // Latin
|
||||
{
|
||||
sb.Append("©");
|
||||
sb.Append("©");
|
||||
}
|
||||
else if (b == 0xd4 && header.CharacterCodeTableNumber == "00") // Latin
|
||||
{
|
||||
sb.Append("™");
|
||||
sb.Append("™");
|
||||
}
|
||||
else if (b == 0xd5 && header.CharacterCodeTableNumber == "00") // Latin
|
||||
{
|
||||
sb.Append("♪");
|
||||
sb.Append("♪");
|
||||
}
|
||||
|
||||
//else if (b == 0xD0) // em-dash
|
||||
// sb.Append('–');
|
||||
//else if (b == 0xD0) // em-dash
|
||||
// sb.Append('–');
|
||||
else if (b == textFieldTerminator)
|
||||
break;
|
||||
else if ((b >= 0x20 && b <= 0x7F) || b >= 0xA1 || header.LanguageCode == LanguageCodeChinese)
|
||||
|
@ -122,10 +122,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
int.TryParse(parts[4], out milliseconds))
|
||||
{
|
||||
return new Paragraph
|
||||
{
|
||||
StartTime = { TimeSpan = new TimeSpan(0, hours, minutes, seconds, milliseconds) },
|
||||
Text = parts[6]
|
||||
};
|
||||
{
|
||||
StartTime = { TimeSpan = new TimeSpan(0, hours, minutes, seconds, milliseconds) },
|
||||
Text = parts[6]
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
Paragraph p = subtitle.Paragraphs[index];
|
||||
p.Text = FixText(p.Text);
|
||||
|
||||
Paragraph next = subtitle.GetParagraphOrDefault(index+1);
|
||||
Paragraph next = subtitle.GetParagraphOrDefault(index + 1);
|
||||
if (next != null)
|
||||
{
|
||||
if (next.StartTime.TotalMilliseconds - p.StartTime.TotalMilliseconds <= MaxDurationMs)
|
||||
|
@ -12,7 +12,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
public interface IGetPacEncoding
|
||||
{
|
||||
int GetPacEncoding(byte[] previewBuffer , string fileName);
|
||||
int GetPacEncoding(byte[] previewBuffer, string fileName);
|
||||
}
|
||||
|
||||
public static IGetPacEncoding GetPacEncodingImplementation;
|
||||
|
@ -130,7 +130,6 @@ Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
||||
if (!string.IsNullOrEmpty(p.MarginV) && Utilities.IsInteger(p.MarginV))
|
||||
marginV = p.MarginV.PadLeft(4, '0');
|
||||
|
||||
|
||||
string effect = "";
|
||||
if (!string.IsNullOrEmpty(p.Effect))
|
||||
effect = p.Effect;
|
||||
|
@ -1,11 +1,11 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.TransportStream;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.TransportStream;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using Helper = Nikse.SubtitleEdit.Core.TransportStream.Helper;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
@ -422,7 +422,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract class SubtitleRegionContent
|
||||
{
|
||||
public int EscapeCode { get; set; }
|
||||
@ -803,22 +802,28 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var fontOutlineThickness = buffer[idx + 2];
|
||||
switch (fontStyle)
|
||||
{
|
||||
case 1: region.Texts.Add("<b>");
|
||||
case 1:
|
||||
region.Texts.Add("<b>");
|
||||
endStyle = "</b>";
|
||||
break;
|
||||
case 2: region.Texts.Add("<i>");
|
||||
case 2:
|
||||
region.Texts.Add("<i>");
|
||||
endStyle = "</i>";
|
||||
break;
|
||||
case 3: region.Texts.Add("<b><i>");
|
||||
case 3:
|
||||
region.Texts.Add("<b><i>");
|
||||
endStyle = "</i></b>";
|
||||
break;
|
||||
case 5: region.Texts.Add("<b>");
|
||||
case 5:
|
||||
region.Texts.Add("<b>");
|
||||
endStyle = "</b>";
|
||||
break;
|
||||
case 6: region.Texts.Add("<i>");
|
||||
case 6:
|
||||
region.Texts.Add("<i>");
|
||||
endStyle = "</i>";
|
||||
break;
|
||||
case 7: region.Texts.Add("<b><i>");
|
||||
case 7:
|
||||
region.Texts.Add("<b><i>");
|
||||
endStyle = "</i></b>";
|
||||
break;
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
double dBegin, dEnd;
|
||||
if (!start.Contains(':') && Utilities.CountTagInText(start, '.') == 1 &&
|
||||
!end.Contains(':') && Utilities.CountTagInText(end, '.') == 1 &&
|
||||
double.TryParse(start, NumberStyles.Float , CultureInfo.InvariantCulture, out dBegin) && double.TryParse(end, NumberStyles.Float, CultureInfo.InvariantCulture, out dEnd))
|
||||
double.TryParse(start, NumberStyles.Float, CultureInfo.InvariantCulture, out dBegin) && double.TryParse(end, NumberStyles.Float, CultureInfo.InvariantCulture, out dEnd))
|
||||
{
|
||||
subtitle.Paragraphs.Add(new Paragraph(text, dBegin * TimeCode.BaseUnit, dEnd * TimeCode.BaseUnit));
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
double dBegin, dEnd;
|
||||
if (!start.Contains(':') && Utilities.CountTagInText(start, '.') == 1 &&
|
||||
!end.Contains(':') && Utilities.CountTagInText(end, '.') == 1 &&
|
||||
double.TryParse(start, NumberStyles.Float , CultureInfo.InvariantCulture, out dBegin) && double.TryParse(end, NumberStyles.Float, CultureInfo.InvariantCulture, out dEnd))
|
||||
double.TryParse(start, NumberStyles.Float, CultureInfo.InvariantCulture, out dBegin) && double.TryParse(end, NumberStyles.Float, CultureInfo.InvariantCulture, out dEnd))
|
||||
{
|
||||
subtitle.Paragraphs.Add(new Paragraph(text, dBegin * TimeCode.BaseUnit, dEnd * TimeCode.BaseUnit));
|
||||
}
|
||||
|
@ -87,11 +87,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
string start = line.Substring(indexStartTime);
|
||||
string end = line.Substring(indexEndTime);
|
||||
var paragraph = new Paragraph
|
||||
{
|
||||
Text = text,
|
||||
StartTime = { TotalMilliseconds = GetMilliseconds(start) },
|
||||
EndTime = { TotalMilliseconds = GetMilliseconds(end) }
|
||||
};
|
||||
{
|
||||
Text = text,
|
||||
StartTime = { TotalMilliseconds = GetMilliseconds(start) },
|
||||
EndTime = { TotalMilliseconds = GetMilliseconds(end) }
|
||||
};
|
||||
subtitle.Paragraphs.Add(paragraph);
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
|
@ -72,7 +72,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
if (!rtf.StartsWith("{\\rtf"))
|
||||
return;
|
||||
|
||||
|
||||
lines = rtf.FromRtf().SplitToLines().ToList();
|
||||
_errorCount = 0;
|
||||
Paragraph p = null;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
@ -11,6 +11,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
private static readonly Regex RegexTimeCodes = new Regex(@"^\d\d\:\d\d\:\d\d\s+\d+ ", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexNumberAndText = new Regex(@"^\d+ [^ ]+", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".txt"; }
|
||||
|
@ -9,6 +9,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
|
||||
private static readonly Regex RegexTimeCodes = new Regex(@"^\d\d\:\d\d\:\d\d\t[^ ]+", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".txt"; }
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
@ -10,6 +10,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
//7:00:01:27AM
|
||||
private static readonly Regex regexTimeCodesAM = new Regex(@"^\d\:\d\d\:\d\d\:\d\dAM", RegexOptions.Compiled);
|
||||
private static readonly Regex regexTimeCodesPM = new Regex(@"^\d\:\d\d\:\d\d\:\d\dPM", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".pst"; }
|
||||
|
@ -9,6 +9,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
//7:00:01:27AM
|
||||
private static Regex regexTimeCodes = new Regex(@"^\d\:\d\d\:\d\d\:\d\d\t", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".txt"; }
|
||||
|
@ -8,6 +8,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
|
||||
private static readonly Regex RegexTimeCodes = new Regex(@"^\d\d\:\d\d\:\d\d\:\d\d [^ ]+", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".txt"; }
|
||||
|
@ -11,6 +11,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
public static readonly Regex RegexTimeCodes2 = new Regex(@"^\d\d\:\d\d\:\d\d.+\d\d\:\d\d\:\d\d$", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexStartOnly = new Regex(@"^\d\d\:\d\d\:\d\d\t.+$", RegexOptions.Compiled);
|
||||
private static readonly Regex RegexEndOnly = new Regex(@"\d\d\:\d\d\:\d\d$", RegexOptions.Compiled);
|
||||
|
||||
public override string Extension
|
||||
{
|
||||
get { return ".txt"; }
|
||||
|
@ -8,23 +8,23 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
public class UnknownSubtitle75 : SubtitleFormat
|
||||
{
|
||||
|
||||
//BOSTA - English
|
||||
//REEL 1
|
||||
//0001: 124+12 127+12
|
||||
//Get going, you idiot!
|
||||
//0002: 139+13 143+07
|
||||
//They scorn it, but they don't
|
||||
//know its true value.
|
||||
//0003: 143+12 146+09
|
||||
//Move on, move on!
|
||||
//0004: 147+04 151+00
|
||||
//In 1943, it was one of a kind.
|
||||
//0005: 159+00 161+15
|
||||
//...
|
||||
//1083: 1575+05 1583+09
|
||||
//THE END IS THE BEGINNING
|
||||
//1084: 1918+12 0+00
|
||||
//END OF THE FILM
|
||||
//BOSTA - English
|
||||
//REEL 1
|
||||
//0001: 124+12 127+12
|
||||
//Get going, you idiot!
|
||||
//0002: 139+13 143+07
|
||||
//They scorn it, but they don't
|
||||
//know its true value.
|
||||
//0003: 143+12 146+09
|
||||
//Move on, move on!
|
||||
//0004: 147+04 151+00
|
||||
//In 1943, it was one of a kind.
|
||||
//0005: 159+00 161+15
|
||||
//...
|
||||
//1083: 1575+05 1583+09
|
||||
//THE END IS THE BEGINNING
|
||||
//1084: 1918+12 0+00
|
||||
//END OF THE FILM
|
||||
|
||||
private static readonly Regex RegexTimeCodes = new Regex(@"^\d\d\d\d:\s+\d+\+\d+\s+\d+\+\d+$", RegexOptions.Compiled);
|
||||
|
||||
|
@ -5,7 +5,7 @@ using System.Xml;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
class UnknownSubtitle78 : SubtitleFormat
|
||||
internal class UnknownSubtitle78 : SubtitleFormat
|
||||
{
|
||||
public override string Extension
|
||||
{
|
||||
|
@ -42,7 +42,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
//0 = Height (0=bottom, 5=middle, 9=top)
|
||||
//N or I or B = Normal or Italic or Bold
|
||||
|
||||
|
||||
const string paragraphWriteFormat = "SUB [{0} {1} {2}>{3}]{4}{5}";
|
||||
var sb = new StringBuilder();
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
|
@ -40,7 +40,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
sb.AppendLine(" <div id=\"transcriptPanel\">");
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
{
|
||||
sb.AppendLine(string.Format(" <a class=\"caption\" starttime=\"{0}\" duration=\"{1}\">{2}</a>",((long)(Math.Round(p.StartTime.TotalMilliseconds))).ToString(CultureInfo.InvariantCulture), ((long)(Math.Round(p.Duration.TotalMilliseconds))).ToString(CultureInfo.InvariantCulture), p.Text.Replace(Environment.NewLine, "<br />")));
|
||||
sb.AppendLine(string.Format(" <a class=\"caption\" starttime=\"{0}\" duration=\"{1}\">{2}</a>", ((long)(Math.Round(p.StartTime.TotalMilliseconds))).ToString(CultureInfo.InvariantCulture), ((long)(Math.Round(p.Duration.TotalMilliseconds))).ToString(CultureInfo.InvariantCulture), p.Text.Replace(Environment.NewLine, "<br />")));
|
||||
}
|
||||
sb.AppendLine(" </div>");
|
||||
sb.AppendLine(" </div>");
|
||||
|
@ -119,7 +119,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
globalFileInfoNode.Attributes["StopTime"].InnerText = lastTimeCode.ToHHMMSSFF();
|
||||
globalFileInfoNode.Attributes["NumberOfCaptions"].InnerText = subtitle.Paragraphs.Count.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
|
||||
var fileBodyNode = xml.DocumentElement.SelectSingleNode("FileBody");
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
return;
|
||||
}
|
||||
|
||||
DataBuffer = new byte[dataSize+1];
|
||||
DataBuffer = new byte[dataSize + 1];
|
||||
//Buffer.BlockCopy(buffer, dataIndex, DataBuffer, 0, dataSize);
|
||||
Buffer.BlockCopy(buffer, dataIndex - 1, DataBuffer, 0, DataBuffer.Length); // why subtract one from dataIndex???
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
{
|
||||
@ -20,8 +20,10 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
public long TotalNumberOfPrivateStream1Continuation0 { get; private set; }
|
||||
public List<int> SubtitlePacketIds { get; private set; }
|
||||
public List<Packet> SubtitlePackets { get; private set; }
|
||||
|
||||
// public List<Packet> ProgramAssociationTables { get; private set; }
|
||||
private Dictionary<int, List<DvbSubPes>> SubtitlesLookup { get; set; }
|
||||
|
||||
private Dictionary<int, List<TransportStreamSubtitle>> DvbSubtitlesLookup { get; set; }
|
||||
public bool IsM2TransportStream { get; private set; }
|
||||
public ulong FirstVideoPts { get; private set; }
|
||||
|
@ -5,6 +5,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
public class TransportStreamSubtitle
|
||||
{
|
||||
private ulong _startMilliseconds;
|
||||
|
||||
public ulong StartMilliseconds
|
||||
{
|
||||
get
|
||||
@ -20,6 +21,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
|
||||
}
|
||||
|
||||
private ulong _endMilliseconds;
|
||||
|
||||
public ulong EndMilliseconds
|
||||
{
|
||||
get
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
|
@ -177,8 +177,6 @@ namespace Nikse.SubtitleEdit.Core
|
||||
return string.Format("{0:0.0} gb", (float)fileSize / (1024 * 1024 * 1024));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Downloads the requested resource as a <see cref="String"/> using the configured <see cref="WebProxy"/>.
|
||||
/// </summary>
|
||||
@ -907,7 +905,6 @@ namespace Nikse.SubtitleEdit.Core
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static bool IsValidRegex(string testPattern)
|
||||
{
|
||||
if (string.IsNullOrEmpty(testPattern))
|
||||
|
@ -58,6 +58,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
/// Size of sound data
|
||||
/// </summary>
|
||||
public uint DataChunkSize { get; private set; }
|
||||
|
||||
public int DataStartPosition { get; private set; }
|
||||
|
||||
public WaveHeader(Stream stream)
|
||||
@ -559,7 +560,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
private static int ReadValue16Bit(byte[] data, ref int index)
|
||||
{
|
||||
int result = (short)
|
||||
((data[index ] ) |
|
||||
((data[index]) |
|
||||
(data[index + 1] << 8));
|
||||
index += 2;
|
||||
return result;
|
||||
@ -568,7 +569,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
private static int ReadValue24Bit(byte[] data, ref int index)
|
||||
{
|
||||
int result =
|
||||
((data[index ] << 8) |
|
||||
((data[index] << 8) |
|
||||
(data[index + 1] << 16) |
|
||||
(data[index + 2] << 24)) >> 8;
|
||||
index += 3;
|
||||
@ -578,8 +579,8 @@ namespace Nikse.SubtitleEdit.Core
|
||||
private static int ReadValue32Bit(byte[] data, ref int index)
|
||||
{
|
||||
int result =
|
||||
(data[index ] ) |
|
||||
(data[index + 1] << 8) |
|
||||
(data[index]) |
|
||||
(data[index + 1] << 8) |
|
||||
(data[index + 2] << 16) |
|
||||
(data[index + 3] << 24);
|
||||
index += 4;
|
||||
@ -593,20 +594,20 @@ namespace Nikse.SubtitleEdit.Core
|
||||
|
||||
private static void WriteValue16Bit(byte[] buffer, int offset, int value)
|
||||
{
|
||||
buffer[offset ] = (byte)value;
|
||||
buffer[offset] = (byte)value;
|
||||
buffer[offset + 1] = (byte)(value >> 8);
|
||||
}
|
||||
|
||||
private static void WriteValue24Bit(byte[] buffer, int offset, int value)
|
||||
{
|
||||
buffer[offset ] = (byte)value;
|
||||
buffer[offset] = (byte)value;
|
||||
buffer[offset + 1] = (byte)(value >> 8);
|
||||
buffer[offset + 2] = (byte)(value >> 16);
|
||||
}
|
||||
|
||||
private static void WriteValue32Bit(byte[] buffer, int offset, int value)
|
||||
{
|
||||
buffer[offset ] = (byte)value;
|
||||
buffer[offset] = (byte)value;
|
||||
buffer[offset + 1] = (byte)(value >> 8);
|
||||
buffer[offset + 2] = (byte)(value >> 16);
|
||||
buffer[offset + 3] = (byte)(value >> 24);
|
||||
|
@ -38,7 +38,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
var nibble_end = buf.Length * 2;
|
||||
var x = 0;
|
||||
var y = 0;
|
||||
for (; ; )
|
||||
for (;;)
|
||||
{
|
||||
if (nibbleOffset >= nibble_end)
|
||||
return -1;
|
||||
|
@ -160,7 +160,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
|
||||
List<ZipFileEntry> result = new List<ZipFileEntry>();
|
||||
|
||||
for (int pointer = 0; pointer < this.CentralDirImage.Length; )
|
||||
for (int pointer = 0; pointer < this.CentralDirImage.Length;)
|
||||
{
|
||||
uint signature = BitConverter.ToUInt32(CentralDirImage, pointer);
|
||||
if (signature != 0x02014b50)
|
||||
|
@ -109,6 +109,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
public const double ZoomMinimum = 0.1;
|
||||
public const double ZoomMaximum = 2.5;
|
||||
private double _zoomFactor = 1.0; // 1.0=no zoom
|
||||
|
||||
public double ZoomFactor
|
||||
{
|
||||
get
|
||||
@ -133,6 +134,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
public const double VerticalZoomMinimum = 1.0;
|
||||
public const double VerticalZoomMaximum = 20.0;
|
||||
private double _verticalZoomFactor = 1.0; // 1.0=no zoom
|
||||
|
||||
public double VerticalZoomFactor
|
||||
{
|
||||
get
|
||||
@ -181,6 +183,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
}
|
||||
|
||||
private bool _showSpectrogram;
|
||||
|
||||
public bool ShowSpectrogram
|
||||
{
|
||||
get
|
||||
@ -200,6 +203,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
public bool AllowOverlap { get; set; }
|
||||
|
||||
private bool _showWaveform;
|
||||
|
||||
public bool ShowWaveform
|
||||
{
|
||||
get
|
||||
@ -217,6 +221,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
}
|
||||
|
||||
private double _startPositionSeconds;
|
||||
|
||||
public double StartPositionSeconds
|
||||
{
|
||||
get
|
||||
|
@ -23,6 +23,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
private Font _subtitleFont = new Font("Tahoma", 8.25F);
|
||||
|
||||
private string _subtitleFontName = "Tahoma";
|
||||
|
||||
public string SubtitleFontName
|
||||
{
|
||||
get { return _subtitleFontName; }
|
||||
@ -37,6 +38,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
}
|
||||
|
||||
private bool _subtitleFontBold;
|
||||
|
||||
public bool SubtitleFontBold
|
||||
{
|
||||
get { return _subtitleFontBold; }
|
||||
@ -51,6 +53,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
}
|
||||
|
||||
private int _subtitleFontSize = 8;
|
||||
|
||||
public int SubtitleFontSize
|
||||
{
|
||||
get { return _subtitleFontSize; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
@ -59,7 +59,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
textBoxAddName.Text = text.Trim().TrimEnd('.','!', '?');
|
||||
textBoxAddName.Text = text.Trim().TrimEnd('.', '!', '?');
|
||||
if (textBoxAddName.Text.Length > 1)
|
||||
textBoxAddName.Text = char.ToUpper(textBoxAddName.Text[0]) + textBoxAddName.Text.Substring(1);
|
||||
}
|
||||
|
@ -247,7 +247,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
|
||||
// check for delay in matroska files
|
||||
var audioTrackNames = new List<string>();
|
||||
var mkvAudioTrackNumbers = new Dictionary<int, int>();
|
||||
|
@ -15,6 +15,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private HashSet<string> _notAllowedFixes = new HashSet<string>();
|
||||
|
||||
private Dictionary<string, string> _fixedText = new Dictionary<string, string>();
|
||||
|
||||
public Dictionary<string, string> FixedText
|
||||
{
|
||||
get { return _fixedText; }
|
||||
|
@ -854,7 +854,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prev.EndTime.TotalMilliseconds >= p.StartTime.TotalMilliseconds)
|
||||
prev.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds - 1;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Forms;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -15,12 +15,14 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private class TranslationInfo : IEquatable<TranslationInfo>
|
||||
{
|
||||
private readonly string _cultureName;
|
||||
|
||||
public string CultureName
|
||||
{
|
||||
get { return _cultureName; }
|
||||
}
|
||||
|
||||
private readonly string _displayName;
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get { return _displayName; }
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.DCinema
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.DCinema
|
||||
{
|
||||
|
@ -1156,7 +1156,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
string fileNameNoExt = Path.GetFileNameWithoutExtension(fileNameNoPath);
|
||||
string template = " <clipitem id=\"" + System.Security.SecurityElement.Escape(fileNameNoPath) + "\">" + Environment.NewLine +
|
||||
|
||||
// <pathurl>file://localhost/" + fileNameNoPath.Replace(" ", "%20") + @"</pathurl>
|
||||
// <pathurl>file://localhost/" + fileNameNoPath.Replace(" ", "%20") + @"</pathurl>
|
||||
|
||||
@" <name>" + System.Security.SecurityElement.Escape(fileNameNoPath) + @"</name>
|
||||
<duration>[DURATION]</duration>
|
||||
|
@ -134,7 +134,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
count++;
|
||||
var presentationSegmentNode = new TreeNode(string.Format("Segment {0}: {1} -- > {2}", count,
|
||||
new TimeCode(segment.StartPtsMilliseconds), new TimeCode(segment.EndPtsMilliseconds))) { Tag = segment };
|
||||
new TimeCode(segment.StartPtsMilliseconds), new TimeCode(segment.EndPtsMilliseconds)))
|
||||
{ Tag = segment };
|
||||
presentationSegmentsNode.Nodes.Add(presentationSegmentNode);
|
||||
|
||||
foreach (var subtitleRegion in segment.Regions)
|
||||
@ -708,7 +709,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void addFontSizeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var newContent = new TextST.SubtitleRegionContentChangeFontSize { FontSize = 45};
|
||||
var newContent = new TextST.SubtitleRegionContentChangeFontSize { FontSize = 45 };
|
||||
AddSubtitleContent(newContent, newContent.Name);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -2,6 +2,7 @@
|
||||
using Nikse.SubtitleEdit.Core.Dictionaries;
|
||||
using Nikse.SubtitleEdit.Core.Forms.FixCommonErrors;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.Ocr;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -10,7 +11,6 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -31,6 +31,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private FormattingType[] _formattingTypes;
|
||||
|
||||
private Encoding _screenScrapingEncoding;
|
||||
|
||||
public Encoding ScreenScrapingEncoding
|
||||
{
|
||||
get { return _screenScrapingEncoding; }
|
||||
@ -309,7 +310,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string languagePair = (comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|" + (comboBoxTo.SelectedItem as ComboBoxItem).Value;
|
||||
bool romanji = languagePair.EndsWith("|romanji", StringComparison.InvariantCulture);
|
||||
if (romanji)
|
||||
languagePair = (comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|ja" ;
|
||||
languagePair = (comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|ja";
|
||||
|
||||
input = PreTranslate(input.TrimEnd('|').Trim());
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -443,7 +443,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
buttonCustomUrl2.Text = Configuration.Settings.VideoControls.CustomSearchText2;
|
||||
buttonCustomUrl2.Visible = Configuration.Settings.VideoControls.CustomSearchUrl2.Length > 1;
|
||||
|
||||
|
||||
if (fileName.Length > 0 && File.Exists(fileName))
|
||||
{
|
||||
OpenSubtitle(fileName, null);
|
||||
@ -1903,7 +1902,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (format == null)
|
||||
{
|
||||
var cavena890 = new Cavena890();
|
||||
@ -2505,7 +2503,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Try to use a generic subtitle format parser (guessing subtitle format)
|
||||
try
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -10,6 +10,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public bool FromCurrentVideoPosition { get; set; }
|
||||
|
||||
private TimeCode _videoOffset = new TimeCode(0);
|
||||
|
||||
public TimeCode VideoOffset
|
||||
{
|
||||
get
|
||||
|
@ -38,6 +38,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public string ChangeWord { get { return textBoxWord.Text; } set { textBoxWord.Text = value; } }
|
||||
public string ChangeWholeText { get { return textBoxWholeText.Text; } }
|
||||
public bool AutoFixNames { get { return checkBoxAutoChangeNames.Checked; } }
|
||||
|
||||
public int CurrentLineIndex
|
||||
{
|
||||
get { return _currentIndex; }
|
||||
|
@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private string _mostUsedLines;
|
||||
private string _general;
|
||||
private string _mostUsedWords;
|
||||
const string WriteFormat = @"File generated by: Subtitle Edit
|
||||
private const string WriteFormat = @"File generated by: Subtitle Edit
|
||||
http://www.nikse.dk/subtitleedit/
|
||||
https://github.com/SubtitleEdit/subtitleedit
|
||||
============================= General =============================
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
{
|
||||
|
@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
@ -6,9 +9,6 @@ using System.Drawing.Text;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
{
|
||||
@ -40,7 +40,7 @@ namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
|
||||
var l = Configuration.Settings.Language.SubStationAlphaStyles;
|
||||
Text = l.Title;
|
||||
// groupBoxStyles.Text = l.Styles;
|
||||
// groupBoxStyles.Text = l.Styles;
|
||||
groupBoxProperties.Text = l.Properties;
|
||||
groupBoxFont.Text = l.Font;
|
||||
labelFontName.Text = l.FontName;
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.Globalization;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
@ -1,11 +1,11 @@
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
|
@ -5588,7 +5588,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
//}
|
||||
//Text = (ts / _elapseds.Count).ToString(); // display ms in win title bar
|
||||
|
||||
|
||||
_lastLine = text;
|
||||
|
||||
text = text.Replace("<i>-</i>", "-");
|
||||
@ -7951,7 +7950,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Configuration.Settings.VobSubOcr.LastBinaryImageSpellCheck = comboBoxDictionaries.SelectedItem.ToString();
|
||||
}
|
||||
|
||||
|
||||
if (_bluRaySubtitlesOriginal != null)
|
||||
Configuration.Settings.VobSubOcr.BlurayAllowDifferenceInPercent = (double)numericUpDownMaxErrorPct.Value;
|
||||
else
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System.Globalization;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
using Nikse.SubtitleEdit.Core.ContainerFormats.Matroska;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Forms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core.BluRaySup;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
@ -484,7 +484,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a argument from the command line
|
||||
/// </summary>
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.Enums;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.Networking
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.VobSub;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
if (bob.ExpandCount == 0)
|
||||
System.Windows.Forms.MessageBox.Show("Ups, not expanded image in CompareImagesExpanded!");
|
||||
bob.Save(gz);
|
||||
if (bob.ExpandedList.Count != bob.ExpandCount -1)
|
||||
if (bob.ExpandedList.Count != bob.ExpandCount - 1)
|
||||
{
|
||||
throw new Exception("BinaryOcrDb.Save: Expanded image should have " + (bob.ExpandCount - 1) + " sub images");
|
||||
}
|
||||
@ -130,8 +130,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
int index;
|
||||
if (bob.ExpandCount > 0)
|
||||
{
|
||||
if (bob.ExpandedList == null || bob.ExpandCount -1 != bob.ExpandedList.Count )
|
||||
throw new Exception("BinaryOcrDb.Add: There should be " + (bob.ExpandCount -1) + " sub image(s)");
|
||||
if (bob.ExpandedList == null || bob.ExpandCount - 1 != bob.ExpandedList.Count)
|
||||
throw new Exception("BinaryOcrDb.Add: There should be " + (bob.ExpandCount - 1) + " sub image(s)");
|
||||
|
||||
if (bob.ExpandedList[0].Text != null)
|
||||
throw new Exception("BinaryOcrDb.Add: sub image should have null text");
|
||||
@ -153,7 +153,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
if (!allAlike)
|
||||
CompareImagesExpanded.Add(bob);
|
||||
else
|
||||
throw new Exception("BinaryOcrDb.Add: Expanded image already in db!");
|
||||
throw new Exception("BinaryOcrDb.Add: Expanded image already in db!");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.SpellCheck
|
||||
{
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using Nikse.SubtitleEdit.Controls;
|
||||
using Nikse.SubtitleEdit.Controls;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Forms;
|
||||
using Nikse.SubtitleEdit.Logic.VideoPlayers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
@ -309,7 +309,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
control.Height = newHeight;
|
||||
}
|
||||
|
||||
|
||||
public static void InitializeSubtitleFont(Control control)
|
||||
{
|
||||
var gs = Configuration.Settings.General;
|
||||
|
@ -153,7 +153,6 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
private delegate int libvlc_video_set_spu(IntPtr mediaPlayer, int trackNumber);
|
||||
private libvlc_video_set_spu _libvlc_video_set_spu;
|
||||
|
||||
|
||||
//[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
//public unsafe delegate void* LockEventHandler(void* opaque, void** plane);
|
||||
|
||||
@ -238,7 +237,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
private bool IsAllMethodsLoaded()
|
||||
{
|
||||
return _libvlc_new != null &&
|
||||
//_libvlc_get_version != null &&
|
||||
//_libvlc_get_version != null &&
|
||||
_libvlc_release != null &&
|
||||
_libvlc_media_new_path != null &&
|
||||
_libvlc_media_player_new_from_media != null &&
|
||||
@ -248,12 +247,12 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
_libvlc_audio_set_volume != null &&
|
||||
_libvlc_media_player_play != null &&
|
||||
_libvlc_media_player_stop != null &&
|
||||
//_libvlc_media_player_pause != null &&
|
||||
//_libvlc_media_player_pause != null &&
|
||||
_libvlc_media_player_set_hwnd != null &&
|
||||
_libvlc_media_player_is_playing != null &&
|
||||
_libvlc_media_player_get_time != null &&
|
||||
_libvlc_media_player_set_time != null &&
|
||||
//_libvlc_media_player_get_fps != null &&
|
||||
//_libvlc_media_player_get_fps != null &&
|
||||
_libvlc_media_player_get_state != null &&
|
||||
_libvlc_media_player_get_length != null &&
|
||||
_libvlc_media_player_release != null &&
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
{
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
{
|
||||
@ -33,6 +33,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
}
|
||||
|
||||
private float _volume;
|
||||
|
||||
public override int Volume
|
||||
{
|
||||
get
|
||||
@ -55,6 +56,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
}
|
||||
|
||||
private double _timePosition;
|
||||
|
||||
public override double CurrentPosition
|
||||
{
|
||||
get
|
||||
|
@ -38,6 +38,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
|
||||
}
|
||||
|
||||
private int _volume = 75;
|
||||
|
||||
public override int Volume
|
||||
{
|
||||
get
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using QuartzTypeLib;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using Nikse.SubtitleEdit.Core;
|
||||
using QuartzTypeLib;
|
||||
using System.ComponentModel;
|
||||
|
||||
//http://msdn.microsoft.com/en-us/library/dd375454%28VS.85%29.aspx
|
||||
//http://msdn.microsoft.com/en-us/library/dd387928%28v=vs.85%29.aspx
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user