mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Refactor (src/Logic/SubtitleFormats) part 4
This commit is contained in:
parent
4b99e4052b
commit
bdf07a864a
@ -112,8 +112,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
private static double ParseTimeCode(string start)
|
||||
{
|
||||
string[] arr = start.Split(':');
|
||||
var ts = new TimeSpan(0, int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]), int.Parse(arr[3]));
|
||||
return ts.TotalMilliseconds;
|
||||
return new TimeSpan(0, int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]), int.Parse(arr[3])).TotalMilliseconds;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
public class UnknownSubtitle74 : SubtitleFormat
|
||||
{
|
||||
|
||||
//07:02:27
|
||||
//>> GOOD MORNING AND WELCOME TO THE FALL 2014 COMMENCEMENT CEREMONY, A TIME TO RECOGNIZE OUR GRADUATING SENIORS.
|
||||
//07:02:43
|
||||
|
@ -42,14 +42,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
var sb = new StringBuilder();
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
{
|
||||
sb.AppendFormat(paragraphWriteFormat, p.StartTime.ToString().Replace(",", "."), p.Text);
|
||||
sb.AppendFormat(paragraphWriteFormat, p.StartTime.ToString().Replace(',', '.'), p.Text);
|
||||
}
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
|
||||
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
|
||||
{
|
||||
Paragraph paragraph = new Paragraph();
|
||||
var paragraph = new Paragraph();
|
||||
_errorCount = 0;
|
||||
subtitle.Paragraphs.Clear();
|
||||
for (int i = 0; i < lines.Count; i++)
|
||||
|
@ -52,7 +52,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
//<a class="caption" starttime="0" duration="16000">[♪techno music♪]</a>
|
||||
|
||||
StringBuilder temp = new StringBuilder();
|
||||
var temp = new StringBuilder();
|
||||
foreach (string l in lines)
|
||||
temp.Append(l);
|
||||
string all = temp.ToString();
|
||||
|
Loading…
Reference in New Issue
Block a user