mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Formatting (whitespace only)
This commit is contained in:
parent
483d46278a
commit
3c3c6b6f8d
@ -32,7 +32,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string s = Path.GetFileName(fileName);
|
||||
string languageId = s.Substring(0, s.IndexOf('_'));
|
||||
var ci = CultureInfo.GetCultureInfoByIetfLanguageTag(languageId);
|
||||
|
@ -280,7 +280,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_lastNavEndPts = vobuEPtm;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
position += 0x800;
|
||||
|
||||
@ -491,4 +490,4 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -166,7 +166,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
richTextBoxPreview.Text += text;
|
||||
|
||||
_colorList.Add(new ColorEntry { Start = length, Length = text.Length, Color = string.IsNullOrWhiteSpace(color) ? Color.White : ColorTranslator.FromHtml(color) });
|
||||
|
||||
|
||||
var fontStyle = new FontStyle();
|
||||
if (underline)
|
||||
fontStyle = fontStyle | FontStyle.Underline;
|
||||
@ -384,4 +384,4 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -318,7 +318,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)
|
||||
if (romanji)
|
||||
languagePair = (comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|ja" ;
|
||||
|
||||
input = PreTranslate(input.TrimEnd('|').Trim());
|
||||
@ -485,7 +485,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
string res = sb.ToString();
|
||||
res = res.Replace(NewlineString, Environment.NewLine);
|
||||
|
@ -77,7 +77,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
lineNumber++;
|
||||
}
|
||||
|
@ -736,7 +736,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
ShowDialog(_mainWindow);
|
||||
return; // wait for user input
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1254,4 +1253,4 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -185,7 +185,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var arr = dialogText.SplitToLines();
|
||||
if (arr.Length == 2 && (arr[0].StartsWith('-') || arr[0].StartsWith("<i>-")) && (arr[1].StartsWith('-') || arr[1].StartsWith("<i>-")))
|
||||
isDialog = true;
|
||||
|
||||
}
|
||||
|
||||
if (!isDialog && !SplitLongLinesHelper.QualifiesForSplit(Utilities.AutoBreakLine(p.Text, language), singleLineMaxCharacters, totalLineMaxCharacters))
|
||||
@ -368,4 +367,4 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -76,7 +76,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void listBoxInspectItems_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@ -297,4 +296,4 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
form.ShowDialog(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -172,7 +172,6 @@ namespace Nikse.SubtitleEdit.Logic.BluRaySup
|
||||
public BluRaySupPalette(int palSize)
|
||||
: this(palSize, false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -469,4 +468,4 @@ namespace Nikse.SubtitleEdit.Logic.BluRaySup
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -205,7 +205,6 @@ namespace Nikse.SubtitleEdit.Logic.ColorChooser
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// You've moved the mouse.
|
||||
// Now update the screen to match.
|
||||
|
||||
@ -341,7 +340,6 @@ namespace Nikse.SubtitleEdit.Logic.ColorChooser
|
||||
|
||||
// Draw the gradients and points.
|
||||
UpdateDisplay();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -600,4 +598,4 @@ namespace Nikse.SubtitleEdit.Logic.ColorChooser
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -221,7 +221,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
if (toFormat.ToLower() != AdvancedSubStationAlpha.NameOfFormat.ToLower().Replace(" ", string.Empty) &&
|
||||
toFormat.ToLower() != SubStationAlpha.NameOfFormat.ToLower().Replace(" ", string.Empty))
|
||||
{
|
||||
|
||||
foreach (SubtitleFormat sf in formats)
|
||||
{
|
||||
if (sf.Name.Replace(" ", string.Empty).Equals(toFormat, StringComparison.OrdinalIgnoreCase) || sf.Name.Replace(" ", string.Empty).Equals(toFormat.Replace(" ", string.Empty), StringComparison.OrdinalIgnoreCase))
|
||||
@ -230,7 +229,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -723,4 +721,4 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -19,7 +19,6 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats.MaterialExchangeFormat
|
||||
|
||||
public MxfParser(string fileName)
|
||||
{
|
||||
|
||||
FileName = fileName;
|
||||
using (var fs = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||
{
|
||||
@ -126,4 +125,4 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats.MaterialExchangeFormat
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -102,7 +102,6 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats.Mp4.Boxes
|
||||
{
|
||||
for (int i = 0; i < numberOfSampleTimes; i++)
|
||||
{
|
||||
|
||||
uint sampleCount = GetUInt(8 + i * 8);
|
||||
uint sampleDelta = GetUInt(12 + i * 8);
|
||||
totalTime += sampleDelta / (double)timeScale;
|
||||
@ -198,4 +197,4 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats.Mp4.Boxes
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -390,7 +390,6 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats
|
||||
{
|
||||
m_audDataRate /= (double)avi->dwSampleSize;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -449,4 +448,4 @@ namespace Nikse.SubtitleEdit.Logic.ContainerFormats
|
||||
#endregion WAVE processing
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -181,8 +181,7 @@ namespace Nikse.SubtitleEdit.Logic.Forms
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -2438,7 +2438,6 @@ Keep changes?",
|
||||
Title = "WebVTT - set new voice",
|
||||
VoiceName = "Name of voice",
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//public static Language Load(StreamReader sr) // normal but slow .net way
|
||||
@ -2496,4 +2495,4 @@ Keep changes?",
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1322,7 +1322,6 @@
|
||||
public string SaveSelectedLines { get; set; }
|
||||
public string WebVTTSetNewVoice { get; set; }
|
||||
public string WebVTTRemoveVoices { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public FileMenu File { get; set; }
|
||||
@ -1410,7 +1409,6 @@
|
||||
public string Fast { get; set; }
|
||||
public string VeryFast { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class MatroskaSubtitleChooser
|
||||
@ -2322,4 +2320,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -727,7 +727,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
GuessUnknownWords = true;
|
||||
AutoBreakSubtitleIfMoreThanTwoLines = true;
|
||||
ItalicFactor = 0.2;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3203,4 +3202,4 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -387,7 +387,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
if (p.Duration.TotalMilliseconds <= 0)
|
||||
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -529,4 +528,4 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -135,7 +135,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
subtitle.Renumber();
|
||||
|
||||
}
|
||||
|
||||
private static string EncodeTimeCode(TimeCode time)
|
||||
|
@ -160,7 +160,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
@ -75,7 +75,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
text.Add(0x74);
|
||||
//text.Add(0x17);
|
||||
//text.Add(0x21);
|
||||
|
||||
}
|
||||
|
||||
// codes+text length
|
||||
|
@ -36,7 +36,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
fine++;
|
||||
else
|
||||
failed++;
|
||||
|
||||
}
|
||||
return fine > failed;
|
||||
}
|
||||
@ -96,4 +95,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -50,7 +50,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
else
|
||||
failed++;
|
||||
}
|
||||
|
||||
}
|
||||
return fine > failed;
|
||||
}
|
||||
@ -130,4 +129,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -54,7 +54,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
else
|
||||
failed++;
|
||||
}
|
||||
|
||||
}
|
||||
if (failed > 20)
|
||||
return false;
|
||||
@ -193,4 +192,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -73,7 +73,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount++;
|
||||
System.Diagnostics.Debug.WriteLine(exception.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (line.StartsWith("$DROP="))
|
||||
@ -113,4 +112,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -155,7 +155,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return result;
|
||||
return "Length must be 1024 but is " + result.Length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -98,8 +98,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -140,7 +140,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
// 220220/60000s
|
||||
if (duration != null)
|
||||
{
|
||||
|
||||
var arr = duration.Value.TrimEnd('s').Split('/');
|
||||
if (arr.Length == 2)
|
||||
{
|
||||
@ -155,4 +154,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -168,7 +168,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static TimeCode DecodeTime(XmlAttribute duration)
|
||||
@ -190,4 +189,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -187,7 +187,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static TimeCode DecodeTime(XmlAttribute duration)
|
||||
@ -195,7 +194,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
// 220220/60000s
|
||||
if (duration != null)
|
||||
{
|
||||
|
||||
var arr = duration.Value.TrimEnd('s').Split('/');
|
||||
if (arr.Length == 2)
|
||||
{
|
||||
@ -210,4 +208,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -140,7 +140,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static TimeCode DecodeTime(XmlAttribute duration)
|
||||
@ -148,7 +147,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
// 220220/60000s
|
||||
if (duration != null)
|
||||
{
|
||||
|
||||
var arr = duration.Value.TrimEnd('s').Split('/');
|
||||
if (arr.Length == 2)
|
||||
{
|
||||
@ -163,4 +161,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -246,7 +246,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
@ -122,7 +122,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string text = texts[i];
|
||||
if (text.StartsWith('['))
|
||||
{
|
||||
|
@ -105,7 +105,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
count++;
|
||||
}
|
||||
sb.AppendLine();
|
||||
|
||||
}
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
@ -160,4 +159,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
subtitle.Renumber();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -311,7 +311,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
foreach (string s2 in parts)
|
||||
{
|
||||
|
||||
if (count > 0)
|
||||
lineSb.AppendLine();
|
||||
|
||||
@ -565,4 +564,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -99,7 +99,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
if (subtitle.Paragraphs.Count > 0)
|
||||
subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].EndTime.TotalMilliseconds = subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].StartTime.TotalMilliseconds +
|
||||
Utilities.GetOptimalDisplayMilliseconds(subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].Text);
|
||||
|
||||
}
|
||||
subtitle.RemoveEmptyLines();
|
||||
subtitle.Renumber();
|
||||
|
@ -56,7 +56,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
sb.AppendLine(HtmlUtil.RemoveHtmlTags(p.Text));
|
||||
sb.AppendLine(EncodeTimeCode(p.StartTime));
|
||||
sb.AppendLine(EncodeTimeCode(p.EndTime));
|
||||
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -149,4 +148,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -87,7 +87,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
string value = line.Substring(start + 3, end - start - 3);
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
@ -98,4 +97,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -875,7 +875,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
switch (code.ToLower(CultureInfo.InvariantCulture))
|
||||
{
|
||||
|
||||
//NO x-coordinate?
|
||||
case "1140": return new SccPositionAndStyle(Color.White, FontStyle.Regular, 1, 0);
|
||||
case "1160": return new SccPositionAndStyle(Color.White, FontStyle.Regular, 2, 0);
|
||||
@ -1664,7 +1663,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
if (part != "94ae" && part != "9420" && part != "94ad" && part != "9426")
|
||||
{
|
||||
|
||||
// Spanish inverted question mark (extended char)
|
||||
if (part == "91b3" && k < parts.Length - 1 && parts[k + 1] == "91b3")
|
||||
{
|
||||
@ -1791,4 +1789,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -173,7 +173,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (syncEndPos <= 0)
|
||||
{
|
||||
@ -212,4 +211,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -101,7 +101,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!isTimeCode && lastParagraph != null && Utilities.GetNumberOfLines(lastParagraph.Text) < 5)
|
||||
{
|
||||
@ -114,4 +113,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
subtitle.Renumber();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -127,7 +127,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
line = line.Trim();
|
||||
if (RegexTimeCodes.IsMatch(line))
|
||||
{
|
||||
|
||||
//TIMEIN: 01:00:04:12 DURATION: 04:25 TIMEOUT: 01:00:09:07
|
||||
string s = line.Replace("TIMEIN:", string.Empty).Replace("DURATION", string.Empty).Replace("TIMEOUT", string.Empty).Replace(" ", string.Empty).Replace("\t", string.Empty);
|
||||
string[] parts = s.Split(':');
|
||||
@ -174,4 +173,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -134,7 +134,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
line = line.Trim();
|
||||
if (RegexTimeCodes.IsMatch(line))
|
||||
{
|
||||
|
||||
//SUBTITLE: 1 TIMEIN: 00:00:07:01 DURATION: 03:11 TIMEOUT: 00:00:10:12
|
||||
string s = line.Replace("SUBTITLE:", string.Empty).Replace("TIMEIN", string.Empty).Replace("DURATION", string.Empty).Replace("TIMEOUT", string.Empty).Replace(" ", string.Empty).Replace("\t", string.Empty);
|
||||
string[] parts = s.Split(':');
|
||||
@ -171,4 +170,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -133,7 +133,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
line = line.Trim();
|
||||
if (RegexTimeCodes.IsMatch(line))
|
||||
{
|
||||
|
||||
//SUBTITLE: 59 TIMEIN: 00:04:28:06 TIMEOUT: 00:04:32:12
|
||||
string s = line.Replace("SUBTITLE:", string.Empty).Replace("TIMEIN", string.Empty).Replace("TIMEOUT", string.Empty).Replace(" ", string.Empty).Replace("\t", string.Empty);
|
||||
string[] parts = s.Split(':');
|
||||
@ -169,4 +168,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -126,7 +126,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
index++;
|
||||
p.Number = index;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -680,7 +680,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
bold = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (innerNode.HasChildNodes)
|
||||
{
|
||||
@ -887,4 +886,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -9,14 +9,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
/// <summary>
|
||||
/// Timeline Ascii export - THE MOVIE TITRE EDITOR - http://www.pld.ttu.ee/~priidu/timeline/ by priidu@pld.ttu.ee
|
||||
///
|
||||
///
|
||||
/// Sample:
|
||||
/// 1.
|
||||
/// 00:00:43.02
|
||||
/// 00:00:47.03
|
||||
/// ±NE/SEVÎ
|
||||
/// ³ÂÍÅ/ÑÅÁß
|
||||
///
|
||||
///
|
||||
/// 2.
|
||||
/// 00:01:36.00
|
||||
/// 00:01:37.00
|
||||
|
@ -9,14 +9,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
/// <summary>
|
||||
/// Timeline Ascii export - THE MOVIE TITRE EDITOR - http://www.pld.ttu.ee/~priidu/timeline/ by priidu@pld.ttu.ee
|
||||
///
|
||||
///
|
||||
/// Sample:
|
||||
/// 1.
|
||||
/// 41,10
|
||||
/// 46,10
|
||||
/// ±NE/SEVÎ
|
||||
/// ³ÂÍÅ/ÑÅÁß
|
||||
///
|
||||
///
|
||||
/// 2.
|
||||
/// 49,05
|
||||
/// 51,09
|
||||
|
@ -67,7 +67,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
string xmlAsString = sb.ToString().Trim();
|
||||
if ((xmlAsString.Contains("<TMPGEncVMESubtitleTextFormat>") || xmlAsString.Contains("<SubtitleItem ")) && (xmlAsString.Contains("<Subtitle")))
|
||||
{
|
||||
|
||||
var subtitle = new Subtitle();
|
||||
LoadSubtitle(subtitle, lines, fileName);
|
||||
return subtitle.Paragraphs.Count > _errorCount;
|
||||
@ -82,4 +81,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -40,7 +40,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
string xmlAsString = sb.ToString().Trim();
|
||||
if ((xmlAsString.Contains("<TMPGEncVMESubtitleTextFormat>") || xmlAsString.Contains("<SubtitleItem ")) && (xmlAsString.Contains("<Subtitle")))
|
||||
{
|
||||
|
||||
var subtitle = new Subtitle();
|
||||
LoadSubtitle(subtitle, lines, fileName);
|
||||
return subtitle.Paragraphs.Count > _errorCount;
|
||||
@ -384,4 +383,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return new TimeCode(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -134,8 +134,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -86,7 +86,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
subtitle.Renumber();
|
||||
|
||||
}
|
||||
|
||||
private static string EncodeTimeCode(TimeCode time)
|
||||
|
@ -108,8 +108,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
_errorCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -404,7 +404,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
//// else if (code.Substring(11, 4) == "0101")
|
||||
//// sb.Append("<font color=\"yellow\">");
|
||||
//}
|
||||
|
||||
}
|
||||
else if (b == 0x80)
|
||||
{
|
||||
|
@ -89,7 +89,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
p = null;
|
||||
_errorCount++;
|
||||
}
|
||||
|
||||
}
|
||||
else if (p == null)
|
||||
{
|
||||
@ -115,4 +114,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return new TimeCode(0, int.Parse(parts[0]), int.Parse(parts[1]), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -225,7 +225,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
text = lineSb + post;
|
||||
subtitle.Paragraphs.Add(new Paragraph(startTime, endTime, text));
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
@ -271,4 +270,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -137,7 +137,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
line = line.Trim();
|
||||
if (RegexTimeCodes.IsMatch(line))
|
||||
{
|
||||
|
||||
//0001 01:00:15:08 01:00:18:05
|
||||
try
|
||||
{
|
||||
@ -168,4 +167,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -118,7 +118,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
subtitle.Paragraphs.Add(_paragraph);
|
||||
_paragraph = new Paragraph();
|
||||
_expecting = ExpectingLine.Number;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -151,4 +150,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -91,7 +91,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
System.Diagnostics.Debug.WriteLine(exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(line))
|
||||
{
|
||||
@ -131,4 +130,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -110,7 +110,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
System.Diagnostics.Debug.WriteLine(exception.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(line) || regexTimeCodes1.IsMatch(" " + s))
|
||||
{
|
||||
@ -151,4 +150,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -146,7 +146,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
expecting = ExpectingLine.TimeCodes;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(p.Text))
|
||||
subtitle.Paragraphs.Add(p);
|
||||
@ -177,4 +176,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -122,7 +122,6 @@ SRPSKI
|
||||
paragraph.Text += Environment.NewLine + s;
|
||||
else
|
||||
paragraph.Text = s;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,4 +131,4 @@ SRPSKI
|
||||
subtitle.Renumber();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -34,7 +34,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
public override string ToText(Subtitle subtitle, string title)
|
||||
{
|
||||
|
||||
//1) 00:00:06:14 00:00:07:07 Durée : 00:18 Lisibilité : 011 Intervalle : 06:14 Nbc : 018
|
||||
//text
|
||||
//line2
|
||||
|
@ -135,7 +135,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
subtitle.Renumber();
|
||||
|
||||
}
|
||||
|
||||
private static string EncodeTimeCode(TimeCode time)
|
||||
|
@ -310,7 +310,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
foreach (string s2 in parts)
|
||||
{
|
||||
|
||||
if (count > 0)
|
||||
lineSb.AppendLine();
|
||||
|
||||
@ -564,4 +563,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -102,11 +102,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
int durationMilliseconds;
|
||||
if (text.Length > 0 && int.TryParse(startTime, out startMilliseconds) && int.TryParse(duration, out durationMilliseconds))
|
||||
subtitle.Paragraphs.Add(new Paragraph(text, startMilliseconds, startMilliseconds + durationMilliseconds));
|
||||
|
||||
}
|
||||
}
|
||||
subtitle.Renumber();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -169,7 +169,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
startIndex = s.IndexOf("<v ", startIndex + 1, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -185,7 +184,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
text = text.Remove(indexOfTag, indexOfEnd - indexOfTag + 1);
|
||||
text = text.Replace("</" + tag + ">", string.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
return text;
|
||||
}
|
||||
@ -201,4 +199,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -185,7 +185,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
startIndex = s.IndexOf("<v ", startIndex + 1, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -201,7 +200,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
text = text.Remove(indexOfTag, indexOfEnd - indexOfTag + 1);
|
||||
text = text.Replace("</" + tag + ">", string.Empty);
|
||||
}
|
||||
|
||||
}
|
||||
return text;
|
||||
}
|
||||
@ -217,4 +215,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -76,7 +76,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string text = line.Substring(0, indexOfTen).Trim();
|
||||
string time = line.Substring(indexOf7001 - 16, 16);
|
||||
p = new Paragraph(DecodeTimeCode(time.Substring(0, 8)), DecodeTimeCode(time.Substring(8)), text);
|
||||
@ -112,4 +111,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -107,7 +107,6 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
using (var path = new GraphicsPath())
|
||||
{
|
||||
|
||||
var sb = new StringBuilder(text);
|
||||
bool newLine = false;
|
||||
const int leftMargin = 0;
|
||||
@ -137,4 +136,4 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -103,7 +103,6 @@ namespace Nikse.SubtitleEdit.Logic.TransportStream
|
||||
{
|
||||
AdaptationFieldExtensionLength = packetBuffer[index];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -236,7 +236,6 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
_mplayer.StandardInput.WriteLine("loadfile " + _videoFileName);
|
||||
if (OnVideoEnded != null)
|
||||
OnVideoEnded.Invoke(this, null);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -414,4 +413,4 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -52,7 +52,9 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
else
|
||||
(_quartzFilgraphManager as IBasicAudio).Volume = (value - 100) * 35;
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +209,9 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
|
||||
Marshal.ReleaseComObject(quartzFilgraphManager);
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@ -230,7 +234,9 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
{
|
||||
OnVideoLoaded.Invoke(_quartzFilgraphManager, new EventArgs());
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
_videoEndTimer = null;
|
||||
}
|
||||
@ -286,7 +292,9 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
if (_quartzVideo != null)
|
||||
_quartzVideo.Owner = -1;
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
if (_quartzFilgraphManager != null)
|
||||
{
|
||||
@ -296,7 +304,9 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
Marshal.ReleaseComObject(_quartzFilgraphManager);
|
||||
_quartzFilgraphManager = null;
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
_quartzVideo = null;
|
||||
}
|
||||
|
@ -105,7 +105,6 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
|
||||
fs.Seek(position, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -212,7 +211,6 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
|
||||
buffer[1] == 0 &&
|
||||
buffer[2] == 1 &&
|
||||
buffer[3] == 0xba; // 0xba == 186 - MPEG-2 Pack Header
|
||||
|
||||
}
|
||||
|
||||
internal static bool IsPrivateStream1(byte[] buffer, int index)
|
||||
@ -237,4 +235,4 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -407,7 +407,9 @@ namespace System.IO.Compression
|
||||
}
|
||||
} while (this.ZipFileStream.Position > 0);
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -432,4 +434,4 @@ namespace System.IO.Compression
|
||||
|
||||
#endregion IDisposable Members
|
||||
}
|
||||
}
|
||||
}
|
@ -96,7 +96,6 @@ namespace Test
|
||||
CopyStream(strm, file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Use ClassCleanup to run code after all tests in a class have run
|
||||
@ -572,7 +571,6 @@ namespace Test
|
||||
{
|
||||
using (var form = new FixCommonErrors())
|
||||
{
|
||||
|
||||
Configuration.Settings.Tools.OcrFixUseHardcodedRules = true;
|
||||
const string input = "i.e., your killer.";
|
||||
var ofe = new Nikse.SubtitleEdit.Logic.Ocr.OcrFixEngine("eng", "not there", form);
|
||||
@ -1454,4 +1452,4 @@ namespace Test
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
@ -9,7 +9,6 @@ namespace UpdateAssemblyInfo
|
||||
|
||||
private class Template
|
||||
{
|
||||
|
||||
private string templateFile;
|
||||
private string templateText;
|
||||
|
||||
@ -31,7 +30,6 @@ namespace UpdateAssemblyInfo
|
||||
{
|
||||
File.WriteAllText(target, templateText, Encoding.UTF8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static int Main(string[] args)
|
||||
@ -165,11 +163,13 @@ namespace UpdateAssemblyInfo
|
||||
return path;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
Console.WriteLine("WARNING: Might not be able to run Git command line tool!");
|
||||
return "git";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user