mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Refactor (SubtitleFormats|Forms|Logic) part 3
This commit is contained in:
parent
d4309d144b
commit
5856c60471
@ -8,8 +8,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
public class UnknownSubtitle46 : SubtitleFormat
|
||||
{
|
||||
//7:00:01:27AM
|
||||
private static Regex regexTimeCodesAM = new Regex(@"^\d\:\d\d\:\d\d\:\d\dAM", RegexOptions.Compiled);
|
||||
private static Regex regexTimeCodesPM = new Regex(@"^\d\:\d\d\:\d\d\:\d\dPM", RegexOptions.Compiled);
|
||||
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"; }
|
||||
@ -37,9 +37,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
//OFF THE RECORD STARTS RIGHT NOW. 7:00:01:27AM
|
||||
//HERE IS THE RUNDOWN. 7:00:05:03AM
|
||||
var sb = new StringBuilder();
|
||||
const string format = "{0}{1}";
|
||||
foreach (Paragraph p in subtitle.Paragraphs)
|
||||
{
|
||||
sb.AppendLine(string.Format("{0}{1}", p.Text.Replace(Environment.NewLine, " ").PadRight(35), EncodeTimeCode(p.StartTime)));
|
||||
sb.AppendLine(string.Format(format, p.Text.Replace(Environment.NewLine, " ").PadRight(35), EncodeTimeCode(p.StartTime)));
|
||||
}
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
@ -100,7 +101,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
subtitle.RemoveEmptyLines();
|
||||
subtitle.Renumber();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user