Formatting (whitespace only)

This commit is contained in:
Waldi Ravens 2015-08-05 04:31:56 +02:00
parent 8374e0d31d
commit e49c27eb07
6 changed files with 21 additions and 33 deletions

View File

@ -153,7 +153,7 @@ namespace Nikse.SubtitleEdit.Forms
}
private void numericUpDownMaxMs_ValueChanged(object sender, EventArgs e)
{
{
GeneratePreview();
}
@ -169,4 +169,4 @@ namespace Nikse.SubtitleEdit.Forms
}
}
}
}

View File

@ -54,11 +54,11 @@ namespace Nikse.SubtitleEdit.Forms
SetGroupBoxProperties(groupBoxFontSet);
_subtitle = subtitle;
_textST = new TextST
{
StyleSegment = TextST.DialogStyleSegment.DefaultDialogStyleSegment,
PresentationSegments = new List<TextST.DialogPresentationSegment>(),
PresentationSegments = new List<TextST.DialogPresentationSegment>(),
};
_textST.StyleSegment.NumberOfDialogPresentationSegments = _subtitle.Paragraphs.Count;
foreach (var paragraph in _subtitle.Paragraphs)
@ -163,7 +163,7 @@ namespace Nikse.SubtitleEdit.Forms
else
{
var contentNode = new TreeNode(content.Name) { Tag = content };
subtitleRegionNode.Nodes.Add(contentNode);
subtitleRegionNode.Nodes.Add(contentNode);
}
}
}
@ -319,7 +319,7 @@ namespace Nikse.SubtitleEdit.Forms
groupBoxFontSet.Visible = true;
_currentSubtitleFontSet = e.Node.Tag as TextST.SubtitleRegionContentChangeFontSet;
numericUpDownFontSetFontId.Value = _currentSubtitleFontSet.FontId;
}
}
}
}
@ -362,7 +362,7 @@ namespace Nikse.SubtitleEdit.Forms
//{
// using (var fs = new FileStream(saveFileDialog1.FileName, FileMode.Create))
// {
// }
// MessageBox.Show("TextST M2TS file saved as " + saveFileDialog1.FileName);
//}
@ -483,7 +483,7 @@ namespace Nikse.SubtitleEdit.Forms
private void numericUpDownUserStyleHorPosDir_ValueChanged(object sender, EventArgs e)
{
_currentUserStyle.RegionHorizontalPositionDirection = GetIntFromNumericUpDown(sender);
_currentUserStyle.RegionHorizontalPositionDirection = GetIntFromNumericUpDown(sender);
}
private void numericUpDownUserStyleHorPosDelta_ValueChanged(object sender, EventArgs e)
@ -622,8 +622,6 @@ namespace Nikse.SubtitleEdit.Forms
{
contextMenuStripAddSubtitleContent.Show(treeView1, p);
}
}
}
}
@ -798,4 +796,4 @@ namespace Nikse.SubtitleEdit.Forms
}
}
}
}

View File

@ -119,7 +119,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
if (text.Contains('<') && text.Contains('>'))
{
bool tagOn = false;
for (int i = 0; i < text.Length; i++)
{
@ -432,4 +431,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
}
}
}
}

View File

@ -56,7 +56,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
var sb = new StringBuilder();
foreach (Paragraph p in subtitle.Paragraphs)
{
// to avoid rounding errors in duration
var startFrame = MillisecondsToFramesMaxFrameRate(p.StartTime.Milliseconds);
var endFrame = MillisecondsToFramesMaxFrameRate(p.EndTime.Milliseconds);

View File

@ -15,7 +15,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
public static class StreamExtensions
{
public static void WritePts(this Stream stream, ulong pts)
{
//TODO: check max
@ -84,7 +84,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
return Color.FromArgb(T, arr[0], arr[1], arr[2]);
}
}
}
public class RegionStyle
@ -393,7 +392,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
return dss;
}
}
}
@ -404,12 +402,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public int DataLength { get; set; }
public string Name { get; set; }
public abstract void WriteExtraToStream(Stream stream);
}
public class SubtitleRegionContentText : SubtitleRegionContent
{
private string _text;
public string Text
@ -434,13 +430,12 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
var buffer = Encoding.UTF8.GetBytes(Text);
stream.Write(buffer, 0, buffer.Length);
}
}
public class SubtitleRegionContentChangeFontSet : SubtitleRegionContent
{
public int FontId { get; set; }
public SubtitleRegionContentChangeFontSet()
{
EscapeCode = 27;
@ -453,7 +448,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
stream.WriteByte((byte)FontId);
}
}
public class SubtitleRegionContentChangeFontStyle : SubtitleRegionContent
@ -761,7 +755,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
EscapeCode = escapeCode,
DataType = dataType,
DataLength = dataLength,
Text = text
Text = text
});
}
else if (dataType == 0x02) // Change a font set
@ -910,16 +904,16 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
stream.WriteByte((byte)palette.Y);
stream.WriteByte((byte)palette.Cb);
stream.WriteByte((byte)palette.Cr);
stream.WriteByte((byte)palette.T);
stream.WriteByte((byte)palette.T);
}
}
else
{
stream.WriteByte(0); // 1 bit = palette update (0=no update), next 7 bits reserved
stream.WriteByte(0); // 1 bit = palette update (0=no update), next 7 bits reserved
}
stream.WriteByte((byte)Regions.Count); // number of regions
stream.Write(regionSubtitle, 0, regionSubtitle.Length);
stream.Write(regionSubtitle, 0, regionSubtitle.Length);
}
private byte[] MakeSubtitleRegions()
@ -957,8 +951,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
}
return ms.ToArray();
}
}
}
}
public DialogStyleSegment StyleSegment;
@ -984,10 +977,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
}
public override bool IsMine(List<string> lines, string fileName)
{
{
if (string.IsNullOrEmpty(fileName))
return false;
if ((fileName.EndsWith(".m2ts", StringComparison.OrdinalIgnoreCase) && FileUtil.IsM2TransportStream(fileName)) ||
(fileName.EndsWith(".textst", StringComparison.OrdinalIgnoreCase) && FileUtil.IsMpeg2PrivateStream2(fileName)))
{
@ -1145,4 +1138,4 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
}
}
}
}

View File

@ -1191,8 +1191,7 @@ namespace Nikse.SubtitleEdit.Logic
public static readonly string[] AutoDetectWordsHungarian = { "hogy", "lesz", "tudom", "vagy", "mondtam", "még" };
public static readonly string[] AutoDetectWordsCroatian = { "sam", "öto", "äto", "ovo", "vas", "što" };
public static readonly string[] AutoDetectWordsTurkish = { "için", "Tamam", "Hayır", "benim", "daha", "deðil", "önce", "lazým", "benim", "çalýþýyor", "burada", "efendim" };
public static string AutoDetectGoogleLanguage(string text, int bestCount)
{
int count = GetCount(text, AutoDetectWordsEnglish);