Change ext of MPlayer2 sub format from .mpl to .txt - thx Shadow :)

This commit is contained in:
niksedk 2021-12-19 13:19:54 +01:00
parent 7ace645355
commit 65e9995044
2 changed files with 11 additions and 2 deletions

View File

@ -644,7 +644,7 @@ namespace Nikse.SubtitleEdit.Core.Common
public string WebVttCueAn7 { get; set; } public string WebVttCueAn7 { get; set; }
public string WebVttCueAn8 { get; set; } public string WebVttCueAn8 { get; set; }
public string WebVttCueAn9 { get; set; } public string WebVttCueAn9 { get; set; }
public string MPlayer2Extension { get; set; }
public bool TeletextItalicFix { get; set; } public bool TeletextItalicFix { get; set; }
public bool MccDebug { get; set; } public bool MccDebug { get; set; }
@ -723,6 +723,8 @@ $HorzAlign = Center
WebVttCueAn8 = "line:20%"; WebVttCueAn8 = "line:20%";
WebVttCueAn9 = "position:80% line:20%"; WebVttCueAn9 = "position:80% line:20%";
MPlayer2Extension = ".txt";
TeletextItalicFix = true; TeletextItalicFix = true;
} }
@ -5932,6 +5934,12 @@ $HorzAlign = Center
settings.SubtitleSettings.WebVttCueAn9 = subNode.InnerText; settings.SubtitleSettings.WebVttCueAn9 = subNode.InnerText;
} }
subNode = node.SelectSingleNode("MPlayer2Extension");
if (subNode != null)
{
settings.SubtitleSettings.MPlayer2Extension = subNode.InnerText;
}
subNode = node.SelectSingleNode("TeletextItalicFix"); subNode = node.SelectSingleNode("TeletextItalicFix");
if (subNode != null) if (subNode != null)
{ {
@ -9430,6 +9438,7 @@ $HorzAlign = Center
textWriter.WriteElementString("WebVttCueAn7", settings.SubtitleSettings.WebVttCueAn7); textWriter.WriteElementString("WebVttCueAn7", settings.SubtitleSettings.WebVttCueAn7);
textWriter.WriteElementString("WebVttCueAn8", settings.SubtitleSettings.WebVttCueAn8); textWriter.WriteElementString("WebVttCueAn8", settings.SubtitleSettings.WebVttCueAn8);
textWriter.WriteElementString("WebVttCueAn9", settings.SubtitleSettings.WebVttCueAn9); textWriter.WriteElementString("WebVttCueAn9", settings.SubtitleSettings.WebVttCueAn9);
textWriter.WriteElementString("MPlayer2Extension", settings.SubtitleSettings.MPlayer2Extension);
textWriter.WriteElementString("TeletextItalicFix", settings.SubtitleSettings.TeletextItalicFix.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("TeletextItalicFix", settings.SubtitleSettings.TeletextItalicFix.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("MccDebug", settings.SubtitleSettings.MccDebug.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("MccDebug", settings.SubtitleSettings.MccDebug.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("WebVttUseXTimestampMap", settings.SubtitleSettings.WebVttUseXTimestampMap.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("WebVttUseXTimestampMap", settings.SubtitleSettings.WebVttUseXTimestampMap.ToString(CultureInfo.InvariantCulture));

View File

@ -10,7 +10,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
{ {
private static readonly Regex RegexMPlayer2Line = new Regex(@"^\[-?\d+]\[-?\d+].*$", RegexOptions.Compiled); private static readonly Regex RegexMPlayer2Line = new Regex(@"^\[-?\d+]\[-?\d+].*$", RegexOptions.Compiled);
public override string Extension => ".mpl"; public override string Extension => Configuration.Settings.SubtitleSettings.MPlayer2Extension;
public override string Name => "MPlayer2"; public override string Name => "MPlayer2";