mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
Remove a few properties from ttml IMSC 1.1
This commit is contained in:
parent
087199c51c
commit
40d20a70d3
@ -68,7 +68,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
public override string ToText(Subtitle subtitle, string title)
|
||||
{
|
||||
var xml = new XmlDocument { XmlResolver = null };
|
||||
xml.LoadXml(GetXmlStructure());
|
||||
var xmlStructure = GetXmlStructure();
|
||||
var language = LanguageAutoDetect.AutoDetectGoogleLanguage(subtitle);
|
||||
xmlStructure = xmlStructure.Replace("lang=\"en\"", $"lang=\"{language}\"");
|
||||
xml.LoadXml(xmlStructure);
|
||||
var namespaceManager = new XmlNamespaceManager(xml.NameTable);
|
||||
namespaceManager.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
|
||||
var div = xml.DocumentElement.SelectSingleNode("ttml:body", namespaceManager).SelectSingleNode("ttml:div", namespaceManager);
|
||||
|
165
src/ui/Forms/TimedTextPropertiesIms11.Designer.cs
generated
165
src/ui/Forms/TimedTextPropertiesIms11.Designer.cs
generated
@ -36,10 +36,6 @@
|
||||
this.comboBoxTimeCodeFormat = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelTimeCode = new System.Windows.Forms.Label();
|
||||
this.comboBoxFrameRateMultiplier = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.textBoxDescription = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.textBoxTitle = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.label6 = new System.Windows.Forms.Label();
|
||||
this.comboBoxDefaultRegion = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelDefaultRegion = new System.Windows.Forms.Label();
|
||||
this.comboBoxDropMode = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
@ -49,8 +45,6 @@
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.comboBoxTimeBase = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.comboBoxLanguage = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelCollision = new System.Windows.Forms.Label();
|
||||
this.comboBoxDefaultStyle = new Nikse.SubtitleEdit.Controls.NikseComboBox();
|
||||
this.labelWrapStyle = new System.Windows.Forms.Label();
|
||||
this.groupBoxOptions.SuspendLayout();
|
||||
@ -59,7 +53,7 @@
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonOK.Location = new System.Drawing.Point(335, 401);
|
||||
this.buttonOK.Location = new System.Drawing.Point(329, 321);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonOK.TabIndex = 98;
|
||||
@ -71,7 +65,7 @@
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(416, 401);
|
||||
this.buttonCancel.Location = new System.Drawing.Point(410, 321);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCancel.TabIndex = 99;
|
||||
@ -89,10 +83,6 @@
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxTimeCodeFormat);
|
||||
this.groupBoxOptions.Controls.Add(this.labelTimeCode);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxFrameRateMultiplier);
|
||||
this.groupBoxOptions.Controls.Add(this.textBoxDescription);
|
||||
this.groupBoxOptions.Controls.Add(this.label7);
|
||||
this.groupBoxOptions.Controls.Add(this.textBoxTitle);
|
||||
this.groupBoxOptions.Controls.Add(this.label6);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxDefaultRegion);
|
||||
this.groupBoxOptions.Controls.Add(this.labelDefaultRegion);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxDropMode);
|
||||
@ -102,13 +92,11 @@
|
||||
this.groupBoxOptions.Controls.Add(this.label2);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxTimeBase);
|
||||
this.groupBoxOptions.Controls.Add(this.label1);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxLanguage);
|
||||
this.groupBoxOptions.Controls.Add(this.labelCollision);
|
||||
this.groupBoxOptions.Controls.Add(this.comboBoxDefaultStyle);
|
||||
this.groupBoxOptions.Controls.Add(this.labelWrapStyle);
|
||||
this.groupBoxOptions.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBoxOptions.Name = "groupBoxOptions";
|
||||
this.groupBoxOptions.Size = new System.Drawing.Size(479, 383);
|
||||
this.groupBoxOptions.Size = new System.Drawing.Size(473, 303);
|
||||
this.groupBoxOptions.TabIndex = 0;
|
||||
this.groupBoxOptions.TabStop = false;
|
||||
//
|
||||
@ -129,7 +117,7 @@
|
||||
".xml",
|
||||
".ttml",
|
||||
".dfxp"});
|
||||
this.comboBoxFileExtensions.Location = new System.Drawing.Point(191, 346);
|
||||
this.comboBoxFileExtensions.Location = new System.Drawing.Point(191, 251);
|
||||
this.comboBoxFileExtensions.MaxLength = 32767;
|
||||
this.comboBoxFileExtensions.Name = "comboBoxFileExtensions";
|
||||
this.comboBoxFileExtensions.SelectedIndex = -1;
|
||||
@ -142,7 +130,7 @@
|
||||
// labelFileExtension
|
||||
//
|
||||
this.labelFileExtension.AutoSize = true;
|
||||
this.labelFileExtension.Location = new System.Drawing.Point(6, 349);
|
||||
this.labelFileExtension.Location = new System.Drawing.Point(6, 254);
|
||||
this.labelFileExtension.Name = "labelFileExtension";
|
||||
this.labelFileExtension.Size = new System.Drawing.Size(71, 13);
|
||||
this.labelFileExtension.TabIndex = 22;
|
||||
@ -171,7 +159,7 @@
|
||||
"hh:mm:ss.ms-two-digits",
|
||||
"hh:mm:ss,ms",
|
||||
"Frames"});
|
||||
this.comboBoxTimeCodeFormat.Location = new System.Drawing.Point(191, 309);
|
||||
this.comboBoxTimeCodeFormat.Location = new System.Drawing.Point(191, 214);
|
||||
this.comboBoxTimeCodeFormat.MaxLength = 32767;
|
||||
this.comboBoxTimeCodeFormat.Name = "comboBoxTimeCodeFormat";
|
||||
this.comboBoxTimeCodeFormat.SelectedIndex = -1;
|
||||
@ -184,7 +172,7 @@
|
||||
// labelTimeCode
|
||||
//
|
||||
this.labelTimeCode.AutoSize = true;
|
||||
this.labelTimeCode.Location = new System.Drawing.Point(6, 312);
|
||||
this.labelTimeCode.Location = new System.Drawing.Point(6, 217);
|
||||
this.labelTimeCode.Name = "labelTimeCode";
|
||||
this.labelTimeCode.Size = new System.Drawing.Size(89, 13);
|
||||
this.labelTimeCode.TabIndex = 20;
|
||||
@ -207,7 +195,7 @@
|
||||
"999 1000",
|
||||
"1 1",
|
||||
"1000 1001"});
|
||||
this.comboBoxFrameRateMultiplier.Location = new System.Drawing.Point(191, 176);
|
||||
this.comboBoxFrameRateMultiplier.Location = new System.Drawing.Point(191, 81);
|
||||
this.comboBoxFrameRateMultiplier.MaxLength = 32767;
|
||||
this.comboBoxFrameRateMultiplier.Name = "comboBoxFrameRateMultiplier";
|
||||
this.comboBoxFrameRateMultiplier.SelectedIndex = -1;
|
||||
@ -218,76 +206,6 @@
|
||||
this.comboBoxFrameRateMultiplier.TabStop = false;
|
||||
this.comboBoxFrameRateMultiplier.UsePopupWindow = false;
|
||||
//
|
||||
// textBoxDescription
|
||||
//
|
||||
this.textBoxDescription.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.textBoxDescription.CurrentLanguage = "";
|
||||
this.textBoxDescription.CurrentLineIndex = 0;
|
||||
this.textBoxDescription.HideSelection = true;
|
||||
this.textBoxDescription.IsDictionaryDownloaded = true;
|
||||
this.textBoxDescription.IsSpellCheckerInitialized = false;
|
||||
this.textBoxDescription.IsSpellCheckRequested = false;
|
||||
this.textBoxDescription.IsWrongWord = false;
|
||||
this.textBoxDescription.LanguageChanged = false;
|
||||
this.textBoxDescription.Location = new System.Drawing.Point(191, 56);
|
||||
this.textBoxDescription.MaxLength = 32767;
|
||||
this.textBoxDescription.Multiline = true;
|
||||
this.textBoxDescription.Name = "textBoxDescription";
|
||||
this.textBoxDescription.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxDescription.ReadOnly = false;
|
||||
this.textBoxDescription.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
this.textBoxDescription.SelectedText = "";
|
||||
this.textBoxDescription.SelectionLength = 0;
|
||||
this.textBoxDescription.SelectionStart = 0;
|
||||
this.textBoxDescription.Size = new System.Drawing.Size(263, 20);
|
||||
this.textBoxDescription.TabIndex = 1;
|
||||
this.textBoxDescription.TextBoxFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBoxDescription.UseSystemPasswordChar = false;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(6, 58);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(60, 13);
|
||||
this.label7.TabIndex = 17;
|
||||
this.label7.Text = "Description";
|
||||
//
|
||||
// textBoxTitle
|
||||
//
|
||||
this.textBoxTitle.BackColor = System.Drawing.Color.DarkGray;
|
||||
this.textBoxTitle.CurrentLanguage = "";
|
||||
this.textBoxTitle.CurrentLineIndex = 0;
|
||||
this.textBoxTitle.HideSelection = true;
|
||||
this.textBoxTitle.IsDictionaryDownloaded = true;
|
||||
this.textBoxTitle.IsSpellCheckerInitialized = false;
|
||||
this.textBoxTitle.IsSpellCheckRequested = false;
|
||||
this.textBoxTitle.IsWrongWord = false;
|
||||
this.textBoxTitle.LanguageChanged = false;
|
||||
this.textBoxTitle.Location = new System.Drawing.Point(191, 30);
|
||||
this.textBoxTitle.MaxLength = 32767;
|
||||
this.textBoxTitle.Multiline = true;
|
||||
this.textBoxTitle.Name = "textBoxTitle";
|
||||
this.textBoxTitle.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxTitle.ReadOnly = false;
|
||||
this.textBoxTitle.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||
this.textBoxTitle.SelectedText = "";
|
||||
this.textBoxTitle.SelectionLength = 0;
|
||||
this.textBoxTitle.SelectionStart = 0;
|
||||
this.textBoxTitle.Size = new System.Drawing.Size(263, 20);
|
||||
this.textBoxTitle.TabIndex = 0;
|
||||
this.textBoxTitle.TextBoxFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.textBoxTitle.UseSystemPasswordChar = false;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(6, 32);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(27, 13);
|
||||
this.label6.TabIndex = 15;
|
||||
this.label6.Text = "Title";
|
||||
//
|
||||
// comboBoxDefaultRegion
|
||||
//
|
||||
this.comboBoxDefaultRegion.BackColor = System.Drawing.SystemColors.Window;
|
||||
@ -301,7 +219,7 @@
|
||||
this.comboBoxDefaultRegion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxDefaultRegion.DropDownWidth = 263;
|
||||
this.comboBoxDefaultRegion.FormattingEnabled = true;
|
||||
this.comboBoxDefaultRegion.Location = new System.Drawing.Point(191, 270);
|
||||
this.comboBoxDefaultRegion.Location = new System.Drawing.Point(191, 175);
|
||||
this.comboBoxDefaultRegion.MaxLength = 32767;
|
||||
this.comboBoxDefaultRegion.Name = "comboBoxDefaultRegion";
|
||||
this.comboBoxDefaultRegion.SelectedIndex = -1;
|
||||
@ -314,7 +232,7 @@
|
||||
// labelDefaultRegion
|
||||
//
|
||||
this.labelDefaultRegion.AutoSize = true;
|
||||
this.labelDefaultRegion.Location = new System.Drawing.Point(6, 273);
|
||||
this.labelDefaultRegion.Location = new System.Drawing.Point(6, 178);
|
||||
this.labelDefaultRegion.Name = "labelDefaultRegion";
|
||||
this.labelDefaultRegion.Size = new System.Drawing.Size(73, 13);
|
||||
this.labelDefaultRegion.TabIndex = 12;
|
||||
@ -338,7 +256,7 @@
|
||||
"dropNTSC",
|
||||
"dropPAL",
|
||||
"nonDrop"});
|
||||
this.comboBoxDropMode.Location = new System.Drawing.Point(191, 203);
|
||||
this.comboBoxDropMode.Location = new System.Drawing.Point(191, 108);
|
||||
this.comboBoxDropMode.MaxLength = 32767;
|
||||
this.comboBoxDropMode.Name = "comboBoxDropMode";
|
||||
this.comboBoxDropMode.SelectedIndex = -1;
|
||||
@ -351,7 +269,7 @@
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(6, 206);
|
||||
this.label4.Location = new System.Drawing.Point(6, 111);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(59, 13);
|
||||
this.label4.TabIndex = 10;
|
||||
@ -360,7 +278,7 @@
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(6, 179);
|
||||
this.label3.Location = new System.Drawing.Point(6, 84);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(100, 13);
|
||||
this.label3.TabIndex = 8;
|
||||
@ -379,7 +297,7 @@
|
||||
this.comboBoxFrameRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
|
||||
this.comboBoxFrameRate.DropDownWidth = 263;
|
||||
this.comboBoxFrameRate.FormattingEnabled = true;
|
||||
this.comboBoxFrameRate.Location = new System.Drawing.Point(191, 149);
|
||||
this.comboBoxFrameRate.Location = new System.Drawing.Point(191, 54);
|
||||
this.comboBoxFrameRate.MaxLength = 32767;
|
||||
this.comboBoxFrameRate.Name = "comboBoxFrameRate";
|
||||
this.comboBoxFrameRate.SelectedIndex = -1;
|
||||
@ -393,7 +311,7 @@
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(6, 152);
|
||||
this.label2.Location = new System.Drawing.Point(6, 57);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(57, 13);
|
||||
this.label2.TabIndex = 6;
|
||||
@ -417,7 +335,7 @@
|
||||
"media",
|
||||
"smpte",
|
||||
"clock"});
|
||||
this.comboBoxTimeBase.Location = new System.Drawing.Point(191, 122);
|
||||
this.comboBoxTimeBase.Location = new System.Drawing.Point(191, 27);
|
||||
this.comboBoxTimeBase.MaxLength = 32767;
|
||||
this.comboBoxTimeBase.Name = "comboBoxTimeBase";
|
||||
this.comboBoxTimeBase.SelectedIndex = -1;
|
||||
@ -430,45 +348,12 @@
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(6, 125);
|
||||
this.label1.Location = new System.Drawing.Point(6, 30);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(56, 13);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "Time base";
|
||||
//
|
||||
// comboBoxLanguage
|
||||
//
|
||||
this.comboBoxLanguage.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.comboBoxLanguage.BackColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
|
||||
this.comboBoxLanguage.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
|
||||
this.comboBoxLanguage.BorderColorDisabled = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(120)))), ((int)(((byte)(120)))));
|
||||
this.comboBoxLanguage.ButtonForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.comboBoxLanguage.ButtonForeColorDown = System.Drawing.Color.Orange;
|
||||
this.comboBoxLanguage.ButtonForeColorOver = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(120)))), ((int)(((byte)(215)))));
|
||||
this.comboBoxLanguage.DropDownHeight = 400;
|
||||
this.comboBoxLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
|
||||
this.comboBoxLanguage.DropDownWidth = 263;
|
||||
this.comboBoxLanguage.FormattingEnabled = true;
|
||||
this.comboBoxLanguage.Location = new System.Drawing.Point(191, 95);
|
||||
this.comboBoxLanguage.MaxLength = 32767;
|
||||
this.comboBoxLanguage.Name = "comboBoxLanguage";
|
||||
this.comboBoxLanguage.SelectedIndex = -1;
|
||||
this.comboBoxLanguage.SelectedItem = null;
|
||||
this.comboBoxLanguage.SelectedText = "";
|
||||
this.comboBoxLanguage.Size = new System.Drawing.Size(263, 23);
|
||||
this.comboBoxLanguage.TabIndex = 2;
|
||||
this.comboBoxLanguage.TabStop = false;
|
||||
this.comboBoxLanguage.UsePopupWindow = false;
|
||||
//
|
||||
// labelCollision
|
||||
//
|
||||
this.labelCollision.AutoSize = true;
|
||||
this.labelCollision.Location = new System.Drawing.Point(6, 98);
|
||||
this.labelCollision.Name = "labelCollision";
|
||||
this.labelCollision.Size = new System.Drawing.Size(55, 13);
|
||||
this.labelCollision.TabIndex = 3;
|
||||
this.labelCollision.Text = "Language";
|
||||
//
|
||||
// comboBoxDefaultStyle
|
||||
//
|
||||
this.comboBoxDefaultStyle.BackColor = System.Drawing.SystemColors.Window;
|
||||
@ -482,7 +367,7 @@
|
||||
this.comboBoxDefaultStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxDefaultStyle.DropDownWidth = 263;
|
||||
this.comboBoxDefaultStyle.FormattingEnabled = true;
|
||||
this.comboBoxDefaultStyle.Location = new System.Drawing.Point(191, 243);
|
||||
this.comboBoxDefaultStyle.Location = new System.Drawing.Point(191, 148);
|
||||
this.comboBoxDefaultStyle.MaxLength = 32767;
|
||||
this.comboBoxDefaultStyle.Name = "comboBoxDefaultStyle";
|
||||
this.comboBoxDefaultStyle.SelectedIndex = -1;
|
||||
@ -495,17 +380,17 @@
|
||||
// labelWrapStyle
|
||||
//
|
||||
this.labelWrapStyle.AutoSize = true;
|
||||
this.labelWrapStyle.Location = new System.Drawing.Point(6, 246);
|
||||
this.labelWrapStyle.Location = new System.Drawing.Point(6, 151);
|
||||
this.labelWrapStyle.Name = "labelWrapStyle";
|
||||
this.labelWrapStyle.Size = new System.Drawing.Size(65, 13);
|
||||
this.labelWrapStyle.TabIndex = 1;
|
||||
this.labelWrapStyle.Text = "Default style";
|
||||
//
|
||||
// TimedTextProperties
|
||||
// TimedTextPropertiesIms11
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(503, 434);
|
||||
this.ClientSize = new System.Drawing.Size(497, 354);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.groupBoxOptions);
|
||||
@ -513,7 +398,7 @@
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TimedTextProperties";
|
||||
this.Name = "TimedTextPropertiesIms11";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
@ -537,16 +422,10 @@
|
||||
private System.Windows.Forms.Label label2;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxTimeBase;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxLanguage;
|
||||
private System.Windows.Forms.Label labelCollision;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxDefaultStyle;
|
||||
private System.Windows.Forms.Label labelWrapStyle;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxDefaultRegion;
|
||||
private System.Windows.Forms.Label labelDefaultRegion;
|
||||
private Nikse.SubtitleEdit.Controls.SETextBox textBoxDescription;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private Nikse.SubtitleEdit.Controls.SETextBox textBoxTitle;
|
||||
private System.Windows.Forms.Label label6;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxFrameRateMultiplier;
|
||||
private Nikse.SubtitleEdit.Controls.NikseComboBox comboBoxTimeCodeFormat;
|
||||
private System.Windows.Forms.Label labelTimeCode;
|
||||
|
@ -2,7 +2,6 @@
|
||||
using Nikse.SubtitleEdit.Core.SubtitleFormats;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
|
||||
@ -46,29 +45,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_namespaceManager.AddNamespace("tts", TimedText10.TtmlStylingNamespace);
|
||||
_namespaceManager.AddNamespace("ttm", TimedText10.TtmlMetadataNamespace);
|
||||
|
||||
XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:title", _namespaceManager);
|
||||
if (node != null)
|
||||
{
|
||||
textBoxTitle.Text = node.InnerText;
|
||||
}
|
||||
|
||||
node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:desc", _namespaceManager);
|
||||
if (node != null)
|
||||
{
|
||||
textBoxDescription.Text = node.InnerText;
|
||||
}
|
||||
|
||||
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
|
||||
{
|
||||
comboBoxLanguage.Items.Add(ci.Name);
|
||||
}
|
||||
XmlAttribute attr = _xml.DocumentElement.Attributes["xml:lang"];
|
||||
if (attr != null)
|
||||
{
|
||||
comboBoxLanguage.Text = attr.InnerText;
|
||||
}
|
||||
|
||||
attr = _xml.DocumentElement.Attributes["ttp:timeBase"];
|
||||
XmlAttribute attr = _xml.DocumentElement.Attributes["ttp:timeBase"];
|
||||
if (attr != null)
|
||||
{
|
||||
comboBoxTimeBase.Text = attr.InnerText;
|
||||
@ -100,7 +77,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
foreach (string style in TimedText10.GetStylesFromHeader(_subtitle.Header))
|
||||
{
|
||||
comboBoxDefaultStyle.Items.Add(style);
|
||||
node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
if (node?.Attributes?["style"] != null && style == node.Attributes["style"].Value)
|
||||
{
|
||||
comboBoxDefaultStyle.SelectedIndex = comboBoxDefaultStyle.Items.Count - 1;
|
||||
@ -109,7 +86,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
foreach (string region in TimedText10.GetRegionsFromHeader(_subtitle.Header))
|
||||
{
|
||||
comboBoxDefaultRegion.Items.Add(region);
|
||||
node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
if (node?.Attributes?["region"] != null && region == node.Attributes["region"].Value)
|
||||
{
|
||||
comboBoxDefaultRegion.SelectedIndex = comboBoxDefaultRegion.Items.Count - 1;
|
||||
@ -148,82 +125,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:title", _namespaceManager);
|
||||
if (node != null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(textBoxTitle.Text) && string.IsNullOrWhiteSpace(textBoxDescription.Text))
|
||||
{
|
||||
_xml.DocumentElement.SelectSingleNode("ttml:head", _namespaceManager).RemoveChild(_xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata", _namespaceManager));
|
||||
}
|
||||
else
|
||||
{
|
||||
node.InnerText = textBoxTitle.Text;
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(textBoxTitle.Text))
|
||||
{
|
||||
var head = _xml.DocumentElement.SelectSingleNode("ttml:head", _namespaceManager);
|
||||
if (head == null)
|
||||
{
|
||||
head = _xml.CreateElement("ttml", "head", _namespaceManager.LookupNamespace("ttml"));
|
||||
_xml.DocumentElement.PrependChild(head);
|
||||
}
|
||||
|
||||
var metadata = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata", _namespaceManager);
|
||||
if (metadata == null)
|
||||
{
|
||||
metadata = _xml.CreateElement("ttml", "metadata", _namespaceManager.LookupNamespace("ttml"));
|
||||
head.PrependChild(metadata);
|
||||
}
|
||||
|
||||
var title = _xml.CreateElement("ttml", "title", _namespaceManager.LookupNamespace("ttml"));
|
||||
metadata.InnerText = textBoxTitle.Text;
|
||||
metadata.AppendChild(title);
|
||||
}
|
||||
|
||||
node = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata/ttml:desc", _namespaceManager);
|
||||
if (node != null)
|
||||
{
|
||||
node.InnerText = textBoxDescription.Text;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(textBoxDescription.Text))
|
||||
{
|
||||
var head = _xml.DocumentElement.SelectSingleNode("ttml:head", _namespaceManager);
|
||||
if (head == null)
|
||||
{
|
||||
head = _xml.CreateElement("ttml", "head", _namespaceManager.LookupNamespace("ttml"));
|
||||
_xml.DocumentElement.PrependChild(head);
|
||||
}
|
||||
|
||||
var metadata = _xml.DocumentElement.SelectSingleNode("ttml:head/ttml:metadata", _namespaceManager);
|
||||
if (metadata == null)
|
||||
{
|
||||
metadata = _xml.CreateElement("ttml", "metadata", _namespaceManager.LookupNamespace("ttml"));
|
||||
head.PrependChild(metadata);
|
||||
}
|
||||
|
||||
var desc = _xml.CreateElement("ttml", "desc", _namespaceManager.LookupNamespace("ttml"));
|
||||
desc.InnerText = textBoxDescription.Text;
|
||||
metadata.AppendChild(desc);
|
||||
}
|
||||
|
||||
XmlAttribute attr = _xml.DocumentElement.Attributes["xml:lang"];
|
||||
if (attr != null)
|
||||
{
|
||||
attr.Value = comboBoxLanguage.Text;
|
||||
if (attr.Value.Length == 0)
|
||||
{
|
||||
_xml.DocumentElement.Attributes.Remove(attr);
|
||||
}
|
||||
}
|
||||
else if (comboBoxLanguage.Text.Length > 0)
|
||||
{
|
||||
attr = _xml.CreateAttribute("xml", "lang", _namespaceManager.LookupNamespace("xml"));
|
||||
attr.Value = comboBoxLanguage.Text;
|
||||
_xml.DocumentElement.Attributes.Prepend(attr);
|
||||
}
|
||||
|
||||
attr = _xml.DocumentElement.Attributes["ttp:timeBase"];
|
||||
XmlAttribute attr = _xml.DocumentElement.Attributes["ttp:timeBase"];
|
||||
if (attr != null)
|
||||
{
|
||||
attr.InnerText = comboBoxTimeBase.Text;
|
||||
@ -287,7 +189,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
_xml.DocumentElement.Attributes.Append(attr);
|
||||
}
|
||||
|
||||
node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
XmlNode node = _xml.DocumentElement.SelectSingleNode("ttml:body", _namespaceManager);
|
||||
if (node != null && node.Attributes["style"] != null)
|
||||
{
|
||||
node.Attributes["style"].Value = comboBoxDefaultStyle.Text;
|
||||
|
Loading…
Reference in New Issue
Block a user