Formatting (whitespace only)

This commit is contained in:
Waldi Ravens 2016-08-11 12:36:19 +02:00
parent 5b312d4a3a
commit 251f0378af
12 changed files with 151 additions and 156 deletions

View File

@ -2110,6 +2110,7 @@ can edit in same subtitle file (collaboration)",
AdjustSetStartTimeKeepDuration = "Set start time, keep duration",
AdjustSetEndAndOffsetTheRest = "Set end, offset the rest",
AdjustSetEndAndOffsetTheRestAndGoToNext = "Set end, offset the rest and go to next",
AdjustExtendCurrentSubtitle = "Extend current line to next subtitle or max duration",
MainCreateStartDownEndUp = "Create new at key-down, set end time at key-up",
MergeDialog = "Merge dialog (insert dashes)",
GoToNext = "Go to next line",
@ -2117,7 +2118,6 @@ can edit in same subtitle file (collaboration)",
GoToCurrentSubtitleStart = "Go to current line start",
GoToCurrentSubtitleEnd = "Go to current line end",
GoToNextSubtitleAndFocusVideo = "Go to next line and set video position",
AdjustExtendCurrentSubtitle = "Extend current line to next subtitle or max duration",
ToggleFocus = "Toggle focus between list view and subtitle text box",
ToggleDialogDashes = "Toggle dialog dashes",
Alignment = "Alignment (selected lines)",

View File

@ -2495,7 +2495,6 @@
public string RemoveSceneChange { get; set; }
public string GuessTimeCodes { get; set; }
public string SeekSilence { get; set; }
}
public class WaveformGenerateTimeCodes

View File

@ -180,7 +180,7 @@ namespace Nikse.SubtitleEdit.Core
public bool ExportTextNewLineAfterText { get; set; }
public bool ExportTextNewLineBetweenSubtitles { get; set; }
public bool VideoOffsetKeepTimeCodes { get; set; }
public ToolsSettings()
{
@ -1917,7 +1917,7 @@ namespace Nikse.SubtitleEdit.Core
settings.Tools.ExportTextNewLineAfterText = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("ExportTextNewLineBetweenSubtitles");
if (subNode != null)
settings.Tools.ExportTextNewLineBetweenSubtitles = Convert.ToBoolean(subNode.InnerText);
settings.Tools.ExportTextNewLineBetweenSubtitles = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("VideoOffsetKeepTimeCodes");
if (subNode != null)
settings.Tools.VideoOffsetKeepTimeCodes = Convert.ToBoolean(subNode.InnerText);
@ -3146,7 +3146,7 @@ namespace Nikse.SubtitleEdit.Core
textWriter.WriteElementString("ExportTextNewLineAfterText", settings.Tools.ExportTextNewLineAfterText.ToString());
textWriter.WriteElementString("ExportTextNewLineBetweenSubtitles", settings.Tools.ExportTextNewLineBetweenSubtitles.ToString());
textWriter.WriteElementString("VideoOffsetKeepTimeCodes", settings.Tools.VideoOffsetKeepTimeCodes.ToString());
if (settings.Tools.FindHistory != null && settings.Tools.FindHistory.Count > 0)
{
const int maximumFindHistoryItems = 10;

View File

@ -33,125 +33,125 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
const string xmpTemplate = @"<?xml version='1.0' encoding='UNICODE'?>
<MediaTransData Version='1'>
<Settings Version='1'>
<Type></Type>
<Description Version='1'>
<Count>2</Count>
<Item1>For editing SDTV video</Item1>
<Item2>Standard PAL video (4:3interlaced)</Item2>
</Description>
<General Version='1'>
<EditingMode>SDTV</EditingMode>
<Timebase>25.00 fps</Timebase>
<DropFrame>True</DropFrame>
<Horizontal>720</Horizontal>
<Vertical>400</Vertical>
<ScreenAspectRatio>720/400</ScreenAspectRatio>
<PixelAspectRatio>D1/DV PAL (1.067)</PixelAspectRatio>
<Editor>
<LineSeparator>|</LineSeparator>
</Editor>
</General>
<Render Version='1'>
<Location>Default</Location>
<Name>Default</Name>
<Type>24Bit PNG</Type>
<Index>0001</Index>
<ExportPartial>False</ExportPartial>
<ServerData Version='1'>
<Track>0</Track>
<Field>1</Field>
<PAC>False</PAC>
<Category>Default</Category>
<Subtitle>FOX-HD-Malaysia</Subtitle>
<Timecode>Default</Timecode>
<NBJ>False</NBJ>
</ServerData>
</Render>
<TimecodeBase Version='1'>
<FramesPerSecTimesOneHundred>2500</FramesPerSecTimesOneHundred>
<UseTimecodeBaseOfFile>FALSE</UseTimecodeBaseOfFile>
<TimecodeBaseOfFile>00:00:00:00</TimecodeBaseOfFile>
<RepeatOfTimecodeBaseOfFile>1</RepeatOfTimecodeBaseOfFile>
<TimecodeBaseUserSupplied>09:59:35:00</TimecodeBaseUserSupplied>
<RepeatOfTimecodeBaseUserSupplied>1</RepeatOfTimecodeBaseUserSupplied>
</TimecodeBase>
</Settings>
<Movie Version='1'>
<Name>C:\Project\uknown.mpg</Name>
<Format>29.97DF</Format>
</Movie>
<Tracks Version='1'>
<Count>1</Count>
<Track1 Version='1'>
<Owner></Owner>
<Name>Track 1</Name>
<Enabled>True</Enabled>
<Locked>False</Locked>
<Password></Password>
<Columns Version='1'>
<Count>7</Count>
<Column1>
<Name>No</Name>
<Length>40</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column1>
<Column2>
<Name>In</Name>
<Length>64</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column2>
<Column3>
<Name>Out</Name>
<Length>66</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column3>
<Column4>
<Name>Style</Name>
<Length>15</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column4>
<Column5>
<Name>StyleEx</Name>
<Length>96</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column5>
<Column6>
<Name>Comment</Name>
<Length>77</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column6>
<Column7>
<Name>Language 01</Name>
<Length>349</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column7>
</Columns>
<Rows Version='1'>
<Count>4096</Count>
</Rows>
<Data Version='1'>
<Count>[COUNT]</Count>
</Data>
<Highlights Version='1'>
<Count>0</Count>
</Highlights>
</Track1>
</Tracks>
<Settings Version='1'>
<Type></Type>
<Description Version='1'>
<Count>2</Count>
<Item1>For editing SDTV video</Item1>
<Item2>Standard PAL video (4:3interlaced)</Item2>
</Description>
<General Version='1'>
<EditingMode>SDTV</EditingMode>
<Timebase>25.00 fps</Timebase>
<DropFrame>True</DropFrame>
<Horizontal>720</Horizontal>
<Vertical>400</Vertical>
<ScreenAspectRatio>720/400</ScreenAspectRatio>
<PixelAspectRatio>D1/DV PAL (1.067)</PixelAspectRatio>
<Editor>
<LineSeparator>|</LineSeparator>
</Editor>
</General>
<Render Version='1'>
<Location>Default</Location>
<Name>Default</Name>
<Type>24Bit PNG</Type>
<Index>0001</Index>
<ExportPartial>False</ExportPartial>
<ServerData Version='1'>
<Track>0</Track>
<Field>1</Field>
<PAC>False</PAC>
<Category>Default</Category>
<Subtitle>FOX-HD-Malaysia</Subtitle>
<Timecode>Default</Timecode>
<NBJ>False</NBJ>
</ServerData>
</Render>
<TimecodeBase Version='1'>
<FramesPerSecTimesOneHundred>2500</FramesPerSecTimesOneHundred>
<UseTimecodeBaseOfFile>FALSE</UseTimecodeBaseOfFile>
<TimecodeBaseOfFile>00:00:00:00</TimecodeBaseOfFile>
<RepeatOfTimecodeBaseOfFile>1</RepeatOfTimecodeBaseOfFile>
<TimecodeBaseUserSupplied>09:59:35:00</TimecodeBaseUserSupplied>
<RepeatOfTimecodeBaseUserSupplied>1</RepeatOfTimecodeBaseUserSupplied>
</TimecodeBase>
</Settings>
<Movie Version='1'>
<Name>C:\Project\uknown.mpg</Name>
<Format>29.97DF</Format>
</Movie>
<Tracks Version='1'>
<Count>1</Count>
<Track1 Version='1'>
<Owner></Owner>
<Name>Track 1</Name>
<Enabled>True</Enabled>
<Locked>False</Locked>
<Password></Password>
<Columns Version='1'>
<Count>7</Count>
<Column1>
<Name>No</Name>
<Length>40</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column1>
<Column2>
<Name>In</Name>
<Length>64</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column2>
<Column3>
<Name>Out</Name>
<Length>66</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column3>
<Column4>
<Name>Style</Name>
<Length>15</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column4>
<Column5>
<Name>StyleEx</Name>
<Length>96</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column5>
<Column6>
<Name>Comment</Name>
<Length>77</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column6>
<Column7>
<Name>Language 01</Name>
<Length>349</Length>
<Locked>False</Locked>
<Password></Password>
<NonText>False</NonText>
</Column7>
</Columns>
<Rows Version='1'>
<Count>4096</Count>
</Rows>
<Data Version='1'>
<Count>[COUNT]</Count>
</Data>
<Highlights Version='1'>
<Count>0</Count>
</Highlights>
</Track1>
</Tracks>
</MediaTransData>";
const string paragraphTemplate = @"
@ -161,14 +161,14 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
<StyleEx></StyleEx>
<Comment></Comment>
<Fields Version=""2"">
<Field1>
<Type>Text</Type>
<Data>Line1|Line2</Data>
</Field1>
<Field1>
<Type>Text</Type>
<Data>Line1|Line2</Data>
</Field1>
</Fields>";
var xml = new XmlDocument();
xml.LoadXml(xmpTemplate.Replace('\'', '"').Replace("[COUNT]", subtitle.Paragraphs.Count.ToString()));
xml.LoadXml(xmpTemplate.Replace("[COUNT]", subtitle.Paragraphs.Count.ToString()));
var paragraphInsertNode = xml.DocumentElement.SelectSingleNode("Tracks/Track1/Data");
int count = 1;
foreach (Paragraph p in subtitle.Paragraphs)

View File

@ -107,14 +107,13 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
nsmgr.AddNamespace("tts", "http://www.w3.org/ns/10/ttml#style");
nsmgr.AddNamespace("ttm", "http://www.w3.org/ns/10/ttml#metadata");
string xmlStructure =
@"<?xml version='1.0' encoding='utf -8' ?>
const string xmlStructure = @"<?xml version='1.0' encoding='utf-8'?>
<tt xmlns='http://www.w3.org/ns/ttml' xmlns:ttm='http://www.w3.org/ns/ttml#metadata' xmlns:tts='http://www.w3.org/ns/ttml#styling' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<head>
<metadata>
<ttm:title>Netflix Subtitle</ttm:title>
</metadata>
<styling>
</metadata>
<styling>
<style tts:fontStyle='normal' tts:fontWeight='normal' xml:id='s1' tts:color='white' tts:fontFamily='Arial' tts:fontSize='100%'></style>
</styling>
<layout>
@ -123,10 +122,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
</layout>
</head>
<body>
<div style='s1' xml:id='d1'>
</div>
<div style='s1' xml:id='d1'></div>
</body>
</tt>".Replace("'", "\"");
</tt>";
xml.LoadXml(xmlStructure);
if (!string.IsNullOrWhiteSpace(title))
{
@ -307,8 +305,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
get
{
return false;
return false;
}
}

View File

@ -74,7 +74,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{
var timeCodes = line.Substring(line.IndexOf(")", StringComparison.Ordinal) + 1, line.IndexOf("Durée", StringComparison.Ordinal) - 2).Trim().Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
p = new Paragraph(string.Empty, TimeCode.ParseHHMMSSFFToMilliseconds(timeCodes[0]), TimeCode.ParseHHMMSSFFToMilliseconds(timeCodes[1]));
}
catch (Exception)
{

View File

@ -226,7 +226,7 @@ namespace Nikse.SubtitleEdit.Core
return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", ts.Hours, ts.Minutes, ts.Seconds + 1, 0);
return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", ts.Hours, ts.Minutes, ts.Seconds, SubtitleFormat.MillisecondsToFramesMaxFrameRate(ts.Milliseconds));
}
public string ToSSFF()
{
var ts = TimeSpan;

View File

@ -522,7 +522,7 @@ namespace Nikse.SubtitleEdit.Controls
if (pos > 0 && pos < Width)
{
if (Math.Abs(currentPositionPos - pos) < 0.01)
{ // scene change and current pos is the save - draw 2 pixels + current pos dotted
{ // scene change and current pos are the same - draw 2 pixels + current pos dotted
currentPosDone = true;
using (var p = new Pen(Color.AntiqueWhite, 2))
graphics.DrawLine(p, pos, 0, pos, Height);

View File

@ -2339,7 +2339,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
_paddingDictionary.Add(paddingKey, baseLinePadding);
}
// align lines with "gjpqy,ýęçÇ/()[]" a bit lower
// align lines with "gjpqy,ýęçÇ/()[]" a bit lower
var lines = text.SplitToLines();
if (lines.Length > 0)
{

View File

@ -101,7 +101,7 @@ namespace Nikse.SubtitleEdit.Forms
// Parse string (HH:MM:SS.ms)
string[] timeParts = line.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
if (timeParts.Length == 2)
{
{
SceneChangesInSeconds.Add(new TimeSpan(0, 0, 0, Convert.ToInt32(timeParts[0]), Convert.ToInt32(timeParts[1])).TotalSeconds);
}
else if (timeParts.Length == 3)

View File

@ -201,7 +201,7 @@ namespace Nikse.SubtitleEdit.Forms
private Keys _waveformAddTextAtHereFromClipboard = Keys.None;
private Keys _waveformFocusListView = Keys.None;
private Keys _waveformGoToNextSceneChange = Keys.None;
private Keys _waveformToggleSceneChange = Keys.None;
private Keys _waveformToggleSceneChange = Keys.None;
private Keys _mainTranslateCustomSearch1 = Keys.None;
private Keys _mainTranslateCustomSearch2 = Keys.None;
private Keys _mainTranslateCustomSearch3 = Keys.None;
@ -10889,7 +10889,7 @@ namespace Nikse.SubtitleEdit.Forms
ShowSubtitle();
e.SuppressKeyPress = true;
}
}
}
else if (_mainGeneralFileSaveAll == e.KeyData)
{
ToolStripButtonSaveClick(sender, e);
@ -11271,7 +11271,7 @@ namespace Nikse.SubtitleEdit.Forms
{
GoFullscreen();
e.SuppressKeyPress = true;
}
}
else if (audioVisualizer.Focused && audioVisualizer.NewSelectionParagraph != null && e.KeyData == _waveformAddTextAtHere)
{
addParagraphHereToolStripMenuItem_Click(null, null);
@ -14980,7 +14980,7 @@ namespace Nikse.SubtitleEdit.Forms
_waveformFocusListView = UiUtil.GetKeys(Configuration.Settings.Shortcuts.WaveformFocusListView);
_waveformGoToNextSceneChange = UiUtil.GetKeys(Configuration.Settings.Shortcuts.WaveformGoToNextSceneChange);
_waveformToggleSceneChange = UiUtil.GetKeys(Configuration.Settings.Shortcuts.WaveformToggleSceneChange);
_mainTranslateCustomSearch1 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch1);
_mainTranslateCustomSearch2 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch2);
_mainTranslateCustomSearch3 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainTranslateCustomSearch3);

View File

@ -902,19 +902,19 @@ namespace Nikse.SubtitleEdit.Logic
targetFormatFound = true;
outputFileName = FormatOutputFileNameForBatchConvert(fileName, ".txt", outputFolder, overwrite);
Console.Write("{0}: {1} -> {2}...", count, Path.GetFileName(fileName), outputFileName);
File.WriteAllText(outputFileName, ExportText.GeneratePlainText(sub,
Configuration.Settings.Tools.ExportTextShowLineNumbers,
File.WriteAllText(outputFileName, ExportText.GeneratePlainText(sub,
Configuration.Settings.Tools.ExportTextShowLineNumbers,
Configuration.Settings.Tools.ExportTextShowLineNumbersNewLine,
Configuration.Settings.Tools.ExportTextShowTimeCodes,
Configuration.Settings.Tools.ExportTextShowTimeCodes,
Configuration.Settings.Tools.ExportTextShowTimeCodesNewLine,
false,
Configuration.Settings.Tools.ExportTextShowTimeCodes,
string.Empty,
false,
Configuration.Settings.Tools.ExportTextShowTimeCodes,
string.Empty,
Configuration.Settings.Tools.ExportTextRemoveStyling,
Configuration.Settings.Tools.ExportTextFormatText == "Unbreak",
Configuration.Settings.Tools.ExportTextNewLineAfterText,
Configuration.Settings.Tools.ExportTextFormatText == "Unbreak",
Configuration.Settings.Tools.ExportTextNewLineAfterText,
Configuration.Settings.Tools.ExportTextNewLineBetweenSubtitles,
Configuration.Settings.Tools.ExportTextFormatText == "MergeAll"), targetEncoding);
Configuration.Settings.Tools.ExportTextFormatText == "MergeAll"), targetEncoding);
Console.WriteLine(" done.");
}
}