Some improvements to DCinema (thx Lillian) + new format iss xml

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1282 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2012-07-05 04:39:11 +00:00
parent be1c22c90e
commit 4c44773372
19 changed files with 575 additions and 87 deletions

View File

@ -31,10 +31,11 @@ Subtitle Edit Changelog
* Can now read Ulead format with positions - thx Steve
* FIXED:
* Auto-translate now works for English to Portuguese - thx w.tambley
* Fixed shortcuts with numbers (0-9)
* Fixed reading of Bluray sup with errors in image - thx Simon
* Fixed reading of SAMI files with time codes in quotes - thx Josh
* Fixed reading of Ulead files with position codes - thx Steve
* Shortcuts with numbers (0-9)
* Reading of Bluray sup with errors in image - thx Simon
* Reading of SAMI files with time codes in quotes - thx Josh
* Reading of Ulead files with position codes - thx Steve
* Reading of time codes + adjust with format SCC - thx Marquise
3.2.8 (3rd June 2012)

View File

@ -56,16 +56,19 @@
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.numericUpDownTopBottomMargin = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownReelNumber)).BeginInit();
this.groupBoxFont.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTopBottomMargin)).BeginInit();
this.SuspendLayout();
//
// panelFontEffectColor
//
this.panelFontEffectColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelFontEffectColor.Location = new System.Drawing.Point(224, 128);
this.panelFontEffectColor.Location = new System.Drawing.Point(255, 128);
this.panelFontEffectColor.Name = "panelFontEffectColor";
this.panelFontEffectColor.Size = new System.Drawing.Size(21, 20);
this.panelFontEffectColor.TabIndex = 6;
@ -88,14 +91,14 @@
this.groupBox1.Controls.Add(this.labelSubtitleID);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(444, 338);
this.groupBox1.Size = new System.Drawing.Size(537, 364);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// comboBoxLanguage
//
this.comboBoxLanguage.FormattingEnabled = true;
this.comboBoxLanguage.Location = new System.Drawing.Point(108, 109);
this.comboBoxLanguage.Location = new System.Drawing.Point(139, 109);
this.comboBoxLanguage.Name = "comboBoxLanguage";
this.comboBoxLanguage.Size = new System.Drawing.Size(233, 21);
this.comboBoxLanguage.TabIndex = 4;
@ -111,7 +114,7 @@
//
// numericUpDownReelNumber
//
this.numericUpDownReelNumber.Location = new System.Drawing.Point(108, 83);
this.numericUpDownReelNumber.Location = new System.Drawing.Point(139, 83);
this.numericUpDownReelNumber.Maximum = new decimal(new int[] {
250,
0,
@ -134,7 +137,7 @@
// buttonGenerateID
//
this.buttonGenerateID.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonGenerateID.Location = new System.Drawing.Point(338, 29);
this.buttonGenerateID.Location = new System.Drawing.Point(371, 29);
this.buttonGenerateID.Name = "buttonGenerateID";
this.buttonGenerateID.Size = new System.Drawing.Size(100, 21);
this.buttonGenerateID.TabIndex = 1;
@ -147,6 +150,8 @@
this.groupBoxFont.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxFont.Controls.Add(this.numericUpDownTopBottomMargin);
this.groupBoxFont.Controls.Add(this.label2);
this.groupBoxFont.Controls.Add(this.panelFontEffectColor);
this.groupBoxFont.Controls.Add(this.buttonFontEffectColor);
this.groupBoxFont.Controls.Add(this.panelFontColor);
@ -163,14 +168,14 @@
this.groupBoxFont.Controls.Add(this.labelFontUri);
this.groupBoxFont.Location = new System.Drawing.Point(6, 141);
this.groupBoxFont.Name = "groupBoxFont";
this.groupBoxFont.Size = new System.Drawing.Size(432, 191);
this.groupBoxFont.Size = new System.Drawing.Size(525, 217);
this.groupBoxFont.TabIndex = 5;
this.groupBoxFont.TabStop = false;
this.groupBoxFont.Text = "Font";
//
// buttonFontEffectColor
//
this.buttonFontEffectColor.Location = new System.Drawing.Point(102, 128);
this.buttonFontEffectColor.Location = new System.Drawing.Point(133, 128);
this.buttonFontEffectColor.Name = "buttonFontEffectColor";
this.buttonFontEffectColor.Size = new System.Drawing.Size(112, 21);
this.buttonFontEffectColor.TabIndex = 5;
@ -181,7 +186,7 @@
// panelFontColor
//
this.panelFontColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelFontColor.Location = new System.Drawing.Point(224, 75);
this.panelFontColor.Location = new System.Drawing.Point(255, 75);
this.panelFontColor.Name = "panelFontColor";
this.panelFontColor.Size = new System.Drawing.Size(21, 20);
this.panelFontColor.TabIndex = 3;
@ -189,7 +194,7 @@
//
// buttonFontColor
//
this.buttonFontColor.Location = new System.Drawing.Point(102, 75);
this.buttonFontColor.Location = new System.Drawing.Point(133, 75);
this.buttonFontColor.Name = "buttonFontColor";
this.buttonFontColor.Size = new System.Drawing.Size(112, 21);
this.buttonFontColor.TabIndex = 2;
@ -208,7 +213,7 @@
//
// numericUpDownFontSize
//
this.numericUpDownFontSize.Location = new System.Drawing.Point(102, 155);
this.numericUpDownFontSize.Location = new System.Drawing.Point(133, 155);
this.numericUpDownFontSize.Maximum = new decimal(new int[] {
250,
0,
@ -235,7 +240,7 @@
"None",
"Border",
"Shadow"});
this.comboBoxFontEffect.Location = new System.Drawing.Point(102, 102);
this.comboBoxFontEffect.Location = new System.Drawing.Point(133, 102);
this.comboBoxFontEffect.Name = "comboBoxFontEffect";
this.comboBoxFontEffect.Size = new System.Drawing.Size(112, 21);
this.comboBoxFontEffect.TabIndex = 4;
@ -260,7 +265,7 @@
//
// textBoxFontID
//
this.textBoxFontID.Location = new System.Drawing.Point(102, 24);
this.textBoxFontID.Location = new System.Drawing.Point(133, 24);
this.textBoxFontID.Name = "textBoxFontID";
this.textBoxFontID.Size = new System.Drawing.Size(224, 20);
this.textBoxFontID.TabIndex = 0;
@ -277,7 +282,7 @@
//
// textBoxFontUri
//
this.textBoxFontUri.Location = new System.Drawing.Point(102, 50);
this.textBoxFontUri.Location = new System.Drawing.Point(133, 50);
this.textBoxFontUri.Name = "textBoxFontUri";
this.textBoxFontUri.Size = new System.Drawing.Size(224, 20);
this.textBoxFontUri.TabIndex = 1;
@ -303,7 +308,7 @@
//
// textBoxMovieTitle
//
this.textBoxMovieTitle.Location = new System.Drawing.Point(108, 56);
this.textBoxMovieTitle.Location = new System.Drawing.Point(139, 56);
this.textBoxMovieTitle.Name = "textBoxMovieTitle";
this.textBoxMovieTitle.Size = new System.Drawing.Size(224, 20);
this.textBoxMovieTitle.TabIndex = 2;
@ -320,7 +325,7 @@
//
// textBoxSubtitleID
//
this.textBoxSubtitleID.Location = new System.Drawing.Point(108, 30);
this.textBoxSubtitleID.Location = new System.Drawing.Point(139, 30);
this.textBoxSubtitleID.Name = "textBoxSubtitleID";
this.textBoxSubtitleID.Size = new System.Drawing.Size(224, 20);
this.textBoxSubtitleID.TabIndex = 0;
@ -339,7 +344,7 @@
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(381, 356);
this.buttonCancel.Location = new System.Drawing.Point(474, 382);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 2;
@ -351,7 +356,7 @@
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(300, 356);
this.buttonOK.Location = new System.Drawing.Point(393, 382);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 1;
@ -359,11 +364,42 @@
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// numericUpDownTopBottomMargin
//
this.numericUpDownTopBottomMargin.Location = new System.Drawing.Point(133, 181);
this.numericUpDownTopBottomMargin.Maximum = new decimal(new int[] {
50,
0,
0,
0});
this.numericUpDownTopBottomMargin.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownTopBottomMargin.Name = "numericUpDownTopBottomMargin";
this.numericUpDownTopBottomMargin.Size = new System.Drawing.Size(112, 20);
this.numericUpDownTopBottomMargin.TabIndex = 31;
this.numericUpDownTopBottomMargin.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 184);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(97, 13);
this.label2.TabIndex = 30;
this.label2.Text = "Top/bottom margin";
//
// DCinemaPropertiesInterop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(468, 389);
this.ClientSize = new System.Drawing.Size(561, 415);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
@ -382,6 +418,7 @@
this.groupBoxFont.ResumeLayout(false);
this.groupBoxFont.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTopBottomMargin)).EndInit();
this.ResumeLayout(false);
}
@ -416,5 +453,7 @@
private System.Windows.Forms.NumericUpDown numericUpDownReelNumber;
private System.Windows.Forms.ComboBox comboBoxLanguage;
private System.Windows.Forms.Label labelLanguage;
private System.Windows.Forms.NumericUpDown numericUpDownTopBottomMargin;
private System.Windows.Forms.Label label2;
}
}

View File

@ -64,6 +64,11 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxFontEffect.SelectedIndex = 0;
panelFontEffectColor.BackColor = ss.CurrentDCinemaFontEffectColor;
numericUpDownFontSize.Value = ss.CurrentDCinemaFontSize;
if (numericUpDownTopBottomMargin.Minimum <= Configuration.Settings.SubtitleSettings.DCinemaBottomMargin &&
numericUpDownTopBottomMargin.Maximum >= Configuration.Settings.SubtitleSettings.DCinemaBottomMargin)
numericUpDownTopBottomMargin.Value = Configuration.Settings.SubtitleSettings.DCinemaBottomMargin;
else
numericUpDownTopBottomMargin.Value = 8;
}
FixLargeFonts();
}
@ -124,6 +129,7 @@ namespace Nikse.SubtitleEdit.Forms
ss.CurrentDCinemaFontEffect = string.Empty;
ss.CurrentDCinemaFontEffectColor = panelFontEffectColor.BackColor;
ss.CurrentDCinemaFontSize = (int)numericUpDownFontSize.Value;
Configuration.Settings.SubtitleSettings.DCinemaBottomMargin = (int)numericUpDownTopBottomMargin.Value;
DialogResult = DialogResult.OK;
}

View File

@ -61,10 +61,13 @@
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.label2 = new System.Windows.Forms.Label();
this.numericUpDownTopBottomMargin = new System.Windows.Forms.NumericUpDown();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownReelNumber)).BeginInit();
this.groupBoxFont.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTopBottomMargin)).BeginInit();
this.SuspendLayout();
//
// groupBox1
@ -89,13 +92,13 @@
this.groupBox1.Controls.Add(this.labelSubtitleID);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(511, 401);
this.groupBox1.Size = new System.Drawing.Size(583, 420);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// textBoxEditRate
//
this.textBoxEditRate.Location = new System.Drawing.Point(108, 161);
this.textBoxEditRate.Location = new System.Drawing.Point(181, 161);
this.textBoxEditRate.Name = "textBoxEditRate";
this.textBoxEditRate.Size = new System.Drawing.Size(112, 20);
this.textBoxEditRate.TabIndex = 7;
@ -113,7 +116,7 @@
// buttonToday
//
this.buttonToday.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonToday.Location = new System.Drawing.Point(388, 134);
this.buttonToday.Location = new System.Drawing.Point(461, 134);
this.buttonToday.Name = "buttonToday";
this.buttonToday.Size = new System.Drawing.Size(100, 21);
this.buttonToday.TabIndex = 6;
@ -123,7 +126,7 @@
//
// textBoxIssueDate
//
this.textBoxIssueDate.Location = new System.Drawing.Point(108, 135);
this.textBoxIssueDate.Location = new System.Drawing.Point(181, 135);
this.textBoxIssueDate.Name = "textBoxIssueDate";
this.textBoxIssueDate.Size = new System.Drawing.Size(274, 20);
this.textBoxIssueDate.TabIndex = 5;
@ -141,7 +144,7 @@
// comboBoxLanguage
//
this.comboBoxLanguage.FormattingEnabled = true;
this.comboBoxLanguage.Location = new System.Drawing.Point(108, 108);
this.comboBoxLanguage.Location = new System.Drawing.Point(181, 108);
this.comboBoxLanguage.Name = "comboBoxLanguage";
this.comboBoxLanguage.Size = new System.Drawing.Size(112, 21);
this.comboBoxLanguage.TabIndex = 4;
@ -158,7 +161,7 @@
// buttonGenerateID
//
this.buttonGenerateID.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonGenerateID.Location = new System.Drawing.Point(388, 29);
this.buttonGenerateID.Location = new System.Drawing.Point(461, 29);
this.buttonGenerateID.Name = "buttonGenerateID";
this.buttonGenerateID.Size = new System.Drawing.Size(100, 21);
this.buttonGenerateID.TabIndex = 1;
@ -168,7 +171,7 @@
//
// numericUpDownReelNumber
//
this.numericUpDownReelNumber.Location = new System.Drawing.Point(108, 82);
this.numericUpDownReelNumber.Location = new System.Drawing.Point(181, 82);
this.numericUpDownReelNumber.Maximum = new decimal(new int[] {
250,
0,
@ -193,6 +196,8 @@
this.groupBoxFont.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxFont.Controls.Add(this.numericUpDownTopBottomMargin);
this.groupBoxFont.Controls.Add(this.label2);
this.groupBoxFont.Controls.Add(this.panelFontEffectColor);
this.groupBoxFont.Controls.Add(this.buttonFontEffectColor);
this.groupBoxFont.Controls.Add(this.panelFontColor);
@ -209,7 +214,7 @@
this.groupBoxFont.Controls.Add(this.labelFontUri);
this.groupBoxFont.Location = new System.Drawing.Point(6, 201);
this.groupBoxFont.Name = "groupBoxFont";
this.groupBoxFont.Size = new System.Drawing.Size(499, 194);
this.groupBoxFont.Size = new System.Drawing.Size(571, 213);
this.groupBoxFont.TabIndex = 8;
this.groupBoxFont.TabStop = false;
this.groupBoxFont.Text = "Font";
@ -217,7 +222,7 @@
// panelFontEffectColor
//
this.panelFontEffectColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelFontEffectColor.Location = new System.Drawing.Point(224, 128);
this.panelFontEffectColor.Location = new System.Drawing.Point(297, 123);
this.panelFontEffectColor.Name = "panelFontEffectColor";
this.panelFontEffectColor.Size = new System.Drawing.Size(21, 20);
this.panelFontEffectColor.TabIndex = 6;
@ -225,7 +230,7 @@
//
// buttonFontEffectColor
//
this.buttonFontEffectColor.Location = new System.Drawing.Point(102, 128);
this.buttonFontEffectColor.Location = new System.Drawing.Point(175, 123);
this.buttonFontEffectColor.Name = "buttonFontEffectColor";
this.buttonFontEffectColor.Size = new System.Drawing.Size(112, 21);
this.buttonFontEffectColor.TabIndex = 4;
@ -236,7 +241,7 @@
// panelFontColor
//
this.panelFontColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelFontColor.Location = new System.Drawing.Point(224, 75);
this.panelFontColor.Location = new System.Drawing.Point(297, 70);
this.panelFontColor.Name = "panelFontColor";
this.panelFontColor.Size = new System.Drawing.Size(21, 20);
this.panelFontColor.TabIndex = 3;
@ -244,7 +249,7 @@
//
// buttonFontColor
//
this.buttonFontColor.Location = new System.Drawing.Point(102, 75);
this.buttonFontColor.Location = new System.Drawing.Point(175, 70);
this.buttonFontColor.Name = "buttonFontColor";
this.buttonFontColor.Size = new System.Drawing.Size(112, 21);
this.buttonFontColor.TabIndex = 2;
@ -255,7 +260,7 @@
// labelEffectColor
//
this.labelEffectColor.AutoSize = true;
this.labelEffectColor.Location = new System.Drawing.Point(9, 132);
this.labelEffectColor.Location = new System.Drawing.Point(6, 127);
this.labelEffectColor.Name = "labelEffectColor";
this.labelEffectColor.Size = new System.Drawing.Size(61, 13);
this.labelEffectColor.TabIndex = 27;
@ -263,7 +268,7 @@
//
// numericUpDownFontSize
//
this.numericUpDownFontSize.Location = new System.Drawing.Point(102, 155);
this.numericUpDownFontSize.Location = new System.Drawing.Point(175, 150);
this.numericUpDownFontSize.Maximum = new decimal(new int[] {
250,
0,
@ -276,7 +281,7 @@
// labelFontSize
//
this.labelFontSize.AutoSize = true;
this.labelFontSize.Location = new System.Drawing.Point(9, 162);
this.labelFontSize.Location = new System.Drawing.Point(8, 152);
this.labelFontSize.Name = "labelFontSize";
this.labelFontSize.Size = new System.Drawing.Size(27, 13);
this.labelFontSize.TabIndex = 25;
@ -290,7 +295,7 @@
"None",
"Border",
"Shadow"});
this.comboBoxFontEffect.Location = new System.Drawing.Point(102, 102);
this.comboBoxFontEffect.Location = new System.Drawing.Point(175, 97);
this.comboBoxFontEffect.Name = "comboBoxFontEffect";
this.comboBoxFontEffect.Size = new System.Drawing.Size(112, 21);
this.comboBoxFontEffect.TabIndex = 3;
@ -298,7 +303,7 @@
// labelEffect
//
this.labelEffect.AutoSize = true;
this.labelEffect.Location = new System.Drawing.Point(9, 105);
this.labelEffect.Location = new System.Drawing.Point(9, 100);
this.labelEffect.Name = "labelEffect";
this.labelEffect.Size = new System.Drawing.Size(35, 13);
this.labelEffect.TabIndex = 22;
@ -307,7 +312,7 @@
// labelFontColor
//
this.labelFontColor.AutoSize = true;
this.labelFontColor.Location = new System.Drawing.Point(9, 79);
this.labelFontColor.Location = new System.Drawing.Point(9, 74);
this.labelFontColor.Name = "labelFontColor";
this.labelFontColor.Size = new System.Drawing.Size(31, 13);
this.labelFontColor.TabIndex = 18;
@ -315,7 +320,7 @@
//
// textBoxFontID
//
this.textBoxFontID.Location = new System.Drawing.Point(102, 24);
this.textBoxFontID.Location = new System.Drawing.Point(175, 19);
this.textBoxFontID.Name = "textBoxFontID";
this.textBoxFontID.Size = new System.Drawing.Size(274, 20);
this.textBoxFontID.TabIndex = 0;
@ -324,7 +329,7 @@
// labelFontId
//
this.labelFontId.AutoSize = true;
this.labelFontId.Location = new System.Drawing.Point(9, 27);
this.labelFontId.Location = new System.Drawing.Point(9, 22);
this.labelFontId.Name = "labelFontId";
this.labelFontId.Size = new System.Drawing.Size(18, 13);
this.labelFontId.TabIndex = 16;
@ -332,7 +337,7 @@
//
// textBoxFontUri
//
this.textBoxFontUri.Location = new System.Drawing.Point(102, 50);
this.textBoxFontUri.Location = new System.Drawing.Point(175, 45);
this.textBoxFontUri.Name = "textBoxFontUri";
this.textBoxFontUri.Size = new System.Drawing.Size(274, 20);
this.textBoxFontUri.TabIndex = 1;
@ -341,7 +346,7 @@
// labelFontUri
//
this.labelFontUri.AutoSize = true;
this.labelFontUri.Location = new System.Drawing.Point(9, 53);
this.labelFontUri.Location = new System.Drawing.Point(9, 48);
this.labelFontUri.Name = "labelFontUri";
this.labelFontUri.Size = new System.Drawing.Size(26, 13);
this.labelFontUri.TabIndex = 14;
@ -358,7 +363,7 @@
//
// textBoxMovieTitle
//
this.textBoxMovieTitle.Location = new System.Drawing.Point(108, 56);
this.textBoxMovieTitle.Location = new System.Drawing.Point(181, 56);
this.textBoxMovieTitle.Name = "textBoxMovieTitle";
this.textBoxMovieTitle.Size = new System.Drawing.Size(274, 20);
this.textBoxMovieTitle.TabIndex = 2;
@ -375,7 +380,7 @@
//
// textBoxSubtitleID
//
this.textBoxSubtitleID.Location = new System.Drawing.Point(108, 30);
this.textBoxSubtitleID.Location = new System.Drawing.Point(181, 30);
this.textBoxSubtitleID.Name = "textBoxSubtitleID";
this.textBoxSubtitleID.Size = new System.Drawing.Size(274, 20);
this.textBoxSubtitleID.TabIndex = 0;
@ -394,7 +399,7 @@
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(449, 419);
this.buttonCancel.Location = new System.Drawing.Point(521, 438);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 2;
@ -406,7 +411,7 @@
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(368, 419);
this.buttonOK.Location = new System.Drawing.Point(440, 438);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 1;
@ -414,11 +419,42 @@
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click_1);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 178);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(97, 13);
this.label2.TabIndex = 28;
this.label2.Text = "Top/bottom margin";
//
// numericUpDownTopBottomMargin
//
this.numericUpDownTopBottomMargin.Location = new System.Drawing.Point(175, 176);
this.numericUpDownTopBottomMargin.Maximum = new decimal(new int[] {
50,
0,
0,
0});
this.numericUpDownTopBottomMargin.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownTopBottomMargin.Name = "numericUpDownTopBottomMargin";
this.numericUpDownTopBottomMargin.Size = new System.Drawing.Size(112, 20);
this.numericUpDownTopBottomMargin.TabIndex = 29;
this.numericUpDownTopBottomMargin.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// DCinemaPropertiesSmpte
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(535, 452);
this.ClientSize = new System.Drawing.Size(607, 471);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.groupBox1);
@ -437,6 +473,7 @@
this.groupBoxFont.ResumeLayout(false);
this.groupBoxFont.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTopBottomMargin)).EndInit();
this.ResumeLayout(false);
}
@ -476,5 +513,7 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxEditRate;
private System.Windows.Forms.Label labelEditRate;
private System.Windows.Forms.NumericUpDown numericUpDownTopBottomMargin;
private System.Windows.Forms.Label label2;
}
}

View File

@ -70,6 +70,12 @@ namespace Nikse.SubtitleEdit.Forms
comboBoxFontEffect.SelectedIndex = 0;
panelFontEffectColor.BackColor = ss.CurrentDCinemaFontEffectColor;
numericUpDownFontSize.Value = ss.CurrentDCinemaFontSize;
if (numericUpDownTopBottomMargin.Minimum <= Configuration.Settings.SubtitleSettings.DCinemaBottomMargin &&
numericUpDownTopBottomMargin.Maximum >= Configuration.Settings.SubtitleSettings.DCinemaBottomMargin)
numericUpDownTopBottomMargin.Value = Configuration.Settings.SubtitleSettings.DCinemaBottomMargin;
else
numericUpDownTopBottomMargin.Value = 8;
}
FixLargeFonts();
}
@ -143,6 +149,7 @@ namespace Nikse.SubtitleEdit.Forms
ss.CurrentDCinemaFontEffect = string.Empty;
ss.CurrentDCinemaFontEffectColor = panelFontEffectColor.BackColor;
ss.CurrentDCinemaFontSize = (int)numericUpDownFontSize.Value;
Configuration.Settings.SubtitleSettings.DCinemaBottomMargin = (int)numericUpDownTopBottomMargin.Value;
DialogResult = DialogResult.OK;
}

View File

@ -90,6 +90,7 @@
this.toolStripMenuItemImportTimeCodes = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator22 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItemExport = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemTextTimeCodePair = new System.Windows.Forms.ToolStripMenuItem();
this.adobeEncoreFABImageScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemExportPngXml = new System.Windows.Forms.ToolStripMenuItem();
this.bluraySupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -140,6 +141,7 @@
this.sortTextTotalLengthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sortTextNumberOfLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textCharssecToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textWordsPerMinutewpmToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItemShowOriginalInPreview = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemMakeEmptyFromCurrent = new System.Windows.Forms.ToolStripMenuItem();
@ -984,6 +986,7 @@
// toolStripMenuItemExport
//
this.toolStripMenuItemExport.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItemTextTimeCodePair,
this.adobeEncoreFABImageScriptToolStripMenuItem,
this.toolStripMenuItemExportPngXml,
this.bluraySupToolStripMenuItem,
@ -1001,6 +1004,13 @@
this.toolStripMenuItemExport.Size = new System.Drawing.Size(334, 22);
this.toolStripMenuItemExport.Text = "Export";
//
// toolStripMenuItemTextTimeCodePair
//
this.toolStripMenuItemTextTimeCodePair.Name = "toolStripMenuItemTextTimeCodePair";
this.toolStripMenuItemTextTimeCodePair.Size = new System.Drawing.Size(258, 22);
this.toolStripMenuItemTextTimeCodePair.Text = "Korean ATS file pair...";
this.toolStripMenuItemTextTimeCodePair.Click += new System.EventHandler(this.toolStripMenuItemTextTimeCodePair_Click);
//
// adobeEncoreFABImageScriptToolStripMenuItem
//
this.adobeEncoreFABImageScriptToolStripMenuItem.Name = "adobeEncoreFABImageScriptToolStripMenuItem";
@ -1328,7 +1338,8 @@
this.sortTextMaxLineLengthToolStripMenuItem,
this.sortTextTotalLengthToolStripMenuItem,
this.sortTextNumberOfLinesToolStripMenuItem,
this.textCharssecToolStripMenuItem});
this.textCharssecToolStripMenuItem,
this.textWordsPerMinutewpmToolStripMenuItem});
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(346, 22);
this.toolStripMenuItem1.Text = "Sort by";
@ -1336,66 +1347,73 @@
// sortNumberToolStripMenuItem
//
this.sortNumberToolStripMenuItem.Name = "sortNumberToolStripMenuItem";
this.sortNumberToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortNumberToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortNumberToolStripMenuItem.Text = "Number";
this.sortNumberToolStripMenuItem.Click += new System.EventHandler(this.SortNumberToolStripMenuItemClick);
//
// sortStartTimeToolStripMenuItem
//
this.sortStartTimeToolStripMenuItem.Name = "sortStartTimeToolStripMenuItem";
this.sortStartTimeToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortStartTimeToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortStartTimeToolStripMenuItem.Text = "Start time";
this.sortStartTimeToolStripMenuItem.Click += new System.EventHandler(this.SortStartTimeToolStripMenuItemClick);
//
// sortEndTimeToolStripMenuItem
//
this.sortEndTimeToolStripMenuItem.Name = "sortEndTimeToolStripMenuItem";
this.sortEndTimeToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortEndTimeToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortEndTimeToolStripMenuItem.Text = "End time";
this.sortEndTimeToolStripMenuItem.Click += new System.EventHandler(this.SortEndTimeToolStripMenuItemClick);
//
// sortDisplayTimeToolStripMenuItem
//
this.sortDisplayTimeToolStripMenuItem.Name = "sortDisplayTimeToolStripMenuItem";
this.sortDisplayTimeToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortDisplayTimeToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortDisplayTimeToolStripMenuItem.Text = "Duration";
this.sortDisplayTimeToolStripMenuItem.Click += new System.EventHandler(this.SortDisplayTimeToolStripMenuItemClick);
//
// sortTextAlphabeticallytoolStripMenuItem
//
this.sortTextAlphabeticallytoolStripMenuItem.Name = "sortTextAlphabeticallytoolStripMenuItem";
this.sortTextAlphabeticallytoolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortTextAlphabeticallytoolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortTextAlphabeticallytoolStripMenuItem.Text = "Text - alphabetically";
this.sortTextAlphabeticallytoolStripMenuItem.Click += new System.EventHandler(this.SortTextAlphabeticallytoolStripMenuItemClick);
//
// sortTextMaxLineLengthToolStripMenuItem
//
this.sortTextMaxLineLengthToolStripMenuItem.Name = "sortTextMaxLineLengthToolStripMenuItem";
this.sortTextMaxLineLengthToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortTextMaxLineLengthToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortTextMaxLineLengthToolStripMenuItem.Text = "Text - single line max. length";
this.sortTextMaxLineLengthToolStripMenuItem.Click += new System.EventHandler(this.SortTextMaxLineLengthToolStripMenuItemClick);
//
// sortTextTotalLengthToolStripMenuItem
//
this.sortTextTotalLengthToolStripMenuItem.Name = "sortTextTotalLengthToolStripMenuItem";
this.sortTextTotalLengthToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortTextTotalLengthToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortTextTotalLengthToolStripMenuItem.Text = "Text - total length";
this.sortTextTotalLengthToolStripMenuItem.Click += new System.EventHandler(this.SortTextTotalLengthToolStripMenuItemClick);
//
// sortTextNumberOfLinesToolStripMenuItem
//
this.sortTextNumberOfLinesToolStripMenuItem.Name = "sortTextNumberOfLinesToolStripMenuItem";
this.sortTextNumberOfLinesToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.sortTextNumberOfLinesToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.sortTextNumberOfLinesToolStripMenuItem.Text = "Text - number of lines";
this.sortTextNumberOfLinesToolStripMenuItem.Click += new System.EventHandler(this.SortTextNumberOfLinesToolStripMenuItemClick);
//
// textCharssecToolStripMenuItem
//
this.textCharssecToolStripMenuItem.Name = "textCharssecToolStripMenuItem";
this.textCharssecToolStripMenuItem.Size = new System.Drawing.Size(233, 22);
this.textCharssecToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.textCharssecToolStripMenuItem.Text = "Text - chars/sec";
this.textCharssecToolStripMenuItem.Click += new System.EventHandler(this.textCharssecToolStripMenuItem_Click);
//
// textWordsPerMinutewpmToolStripMenuItem
//
this.textWordsPerMinutewpmToolStripMenuItem.Name = "textWordsPerMinutewpmToolStripMenuItem";
this.textWordsPerMinutewpmToolStripMenuItem.Size = new System.Drawing.Size(250, 22);
this.textWordsPerMinutewpmToolStripMenuItem.Text = "Text - words per minute (wpm)";
this.textWordsPerMinutewpmToolStripMenuItem.Click += new System.EventHandler(this.textWordsPerMinutewpmToolStripMenuItem_Click);
//
// toolStripSeparator23
//
this.toolStripSeparator23.Name = "toolStripSeparator23";
@ -4206,6 +4224,8 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemRestoreAutoBackup;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemStatistics;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemDCinemaProperties;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemTextTimeCodePair;
private System.Windows.Forms.ToolStripMenuItem textWordsPerMinutewpmToolStripMenuItem;
}
}

View File

@ -1232,6 +1232,7 @@ namespace Nikse.SubtitleEdit.Forms
sortTextTotalLengthToolStripMenuItem.Text = _language.Menu.Tools.TextTotalLength;
sortTextNumberOfLinesToolStripMenuItem.Text = _language.Menu.Tools.TextNumberOfLines;
textCharssecToolStripMenuItem.Text = _language.Menu.Tools.TextNumberOfCharactersPerSeconds;
textWordsPerMinutewpmToolStripMenuItem.Text = _language.Menu.Tools.WordsPerMinute;
toolStripMenuItemShowOriginalInPreview.Text = _language.Menu.Tools.ShowOriginalTextInAudioAndVideoPreview;
toolStripMenuItemMakeEmptyFromCurrent.Text = _language.Menu.Tools.MakeNewEmptyTranslationFromCurrentSubtitle;
@ -14431,5 +14432,44 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void toolStripMenuItemTextTimeCodePair_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog(this) == DialogResult.OK)
{
saveFileDialog1.Filter = "Text files|*.txt";
saveFileDialog1.Title = _language.SaveSubtitleAs;
saveFileDialog1.DefaultExt = "*.txt";
saveFileDialog1.AddExtension = true;
string fname = saveFileDialog1.FileName;
if (string.IsNullOrEmpty(fname))
fname = "ATS";
if (!fname.EndsWith(".txt"))
fname += ".txt";
string fileNameTimeCode = fname.Insert(fname.Length - 4, "_timecode");
string fileNameText = fname.Insert(fname.Length - 4, "_text");
var timeCodeLines = new StringBuilder();
var textLines = new StringBuilder();
foreach (Paragraph p in _subtitle.Paragraphs)
{
timeCodeLines.AppendLine(string.Format("{0:00}:{1:00}:{2:00}:{3:00}", p.StartTime.Hours, p.StartTime.Minutes, p.StartTime.Seconds, SubtitleFormat.MillisecondsToFrames(p.StartTime.Milliseconds)));
timeCodeLines.AppendLine(string.Format("{0:00}:{1:00}:{2:00}:{3:00}", p.EndTime.Hours, p.EndTime.Minutes, p.EndTime.Seconds, SubtitleFormat.MillisecondsToFrames(p.EndTime.Milliseconds)));
textLines.AppendLine(Utilities.RemoveHtmlTags(p.Text).Replace(Environment.NewLine, "|"));
textLines.AppendLine();
}
File.WriteAllText(fileNameTimeCode, timeCodeLines.ToString(), Encoding.UTF8);
File.WriteAllText(fileNameText, textLines.ToString(), Encoding.UTF8);
}
}
private void textWordsPerMinutewpmToolStripMenuItem_Click(object sender, EventArgs e)
{
SortSubtitle(SubtitleSortCriteria.WordsPerMinute, (sender as ToolStripItem).Text);
}
}
}

View File

@ -681,7 +681,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
CAAAAk1TRnQBSQFMAgEBAgEAAdABFAHQARQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAARABFQEQARUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -729,7 +729,7 @@
<value>150, 95</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>130</value>
<value>25</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -12,5 +12,6 @@ namespace Nikse.SubtitleEdit.Logic.Enums
TextTotalLength,
TextNumberOfLines,
TextCharactersPerSeconds,
WordsPerMinute,
}
}

View File

@ -897,10 +897,10 @@ namespace Nikse.SubtitleEdit.Logic
TextTotalLength = "Text - total length",
TextNumberOfLines = "Text - number of lines",
TextNumberOfCharactersPerSeconds = "Text - number of chars/sec",
WordsPerMinute = "Text - words per minute (wpm)",
ShowOriginalTextInAudioAndVideoPreview = "Show original text in audio/video previews",
MakeNewEmptyTranslationFromCurrentSubtitle = "Make new empty translation from current subtitle",
SplitSubtitle = "Split subtitle...",
AppendSubtitle = "Append subtitle...",
},
Video = new LanguageStructure.Main.MainMenu.VideoMenu

View File

@ -833,6 +833,7 @@
public string TextTotalLength { get; set; }
public string TextNumberOfLines { get; set; }
public string TextNumberOfCharactersPerSeconds { get; set; }
public string WordsPerMinute { get; set; }
public string ShowOriginalTextInAudioAndVideoPreview { get; set; }
public string MakeNewEmptyTranslationFromCurrentSubtitle { get; set; }
public string SplitSubtitle { get; set; }

View File

@ -110,5 +110,16 @@ namespace Nikse.SubtitleEdit.Logic
return Text.Length - Text.Replace(Environment.NewLine, string.Empty).Length;
}
}
public double WordsPerMinute
{
get
{
if (string.IsNullOrEmpty(Text))
return 0;
int wordCount = Utilities.RemoveHtmlTags(Text).Split((" ,.!?;:()[]" + Environment.NewLine).ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;
return (60.0 / Duration.TotalSeconds) * wordCount;
}
}
}
}

View File

@ -446,6 +446,12 @@ namespace Nikse.SubtitleEdit.Logic
return Utilities.GetCharactersPerSecond(p1).CompareTo(Utilities.GetCharactersPerSecond(p2));
});
break;
case SubtitleSortCriteria.WordsPerMinute:
_paragraphs.Sort(delegate(Paragraph p1, Paragraph p2)
{
return p1.WordsPerMinute.CompareTo(p2.WordsPerMinute);
});
break;
default:
break;
}

View File

@ -436,28 +436,62 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
lastVPosition = vPosition;
}
}
bool alignLeft = false;
bool alignRight = false;
bool alignVTop = false;
bool alignVCenter = false;
if (innerNode.Attributes["HAlign"] != null)
{
string hAlign = innerNode.Attributes["HAlign"].InnerText;
if (hAlign == "left")
{
if (!pText.ToString().StartsWith("{\\an"))
{
string temp = "{\\an1}" + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
}
}
alignLeft = true;
else if (hAlign == "right")
alignRight = true;
}
if (innerNode.Attributes["VAlign"] != null)
{
string hAlign = innerNode.Attributes["VAlign"].InnerText;
if (hAlign == "top")
alignVTop = true;
else if (hAlign == "center")
alignVCenter = true;
}
if (alignLeft || alignRight || alignVCenter || alignVTop)
{
if (!pText.ToString().StartsWith("{\\an"))
{
if (!pText.ToString().StartsWith("{\\an"))
string pre = string.Empty;
if (alignVTop)
{
string temp = "{\\an3}" + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
if (alignLeft)
pre = "{\\an7}";
else if (alignRight)
pre = "{\\an9}";
else
pre = "{\\an8}";
}
else if (alignVCenter)
{
if (alignLeft)
pre = "{\\an4}";
else if (alignRight)
pre = "{\\an6}";
else
pre = "{\\an5}";
}
else
{
if (alignLeft)
pre = "{\\an1}";
else if (alignRight)
pre = "{\\an3}";
}
string temp = pre + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
}
}
if (innerNode.ChildNodes.Count == 0)
{
pText.Append(innerNode.InnerText);

View File

@ -446,7 +446,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
switch (innerNode.Name.ToString())
{
case "Text":
case "Text":
if (innerNode.Attributes["VPosition"] != null)
{
string vPosition = innerNode.Attributes["VPosition"].InnerText;
@ -457,28 +457,62 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
lastVPosition = vPosition;
}
}
bool alignLeft = false;
bool alignRight = false;
bool alignVTop = false;
bool alignVCenter = false;
if (innerNode.Attributes["HAlign"] != null)
{
string hAlign = innerNode.Attributes["HAlign"].InnerText;
if (hAlign == "left")
{
if (!pText.ToString().StartsWith("{\\an"))
{
string temp = "{\\an1}" + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
}
}
alignLeft = true;
else if (hAlign == "right")
alignRight = true;
}
if (innerNode.Attributes["VAlign"] != null)
{
string hAlign = innerNode.Attributes["VAlign"].InnerText;
if (hAlign == "top")
alignVTop = true;
else if (hAlign == "center")
alignVCenter = true;
}
if (alignLeft || alignRight || alignVCenter || alignVTop)
{
if (!pText.ToString().StartsWith("{\\an"))
{
if (!pText.ToString().StartsWith("{\\an"))
string pre = string.Empty;
if (alignVTop)
{
string temp = "{\\an3}" + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
if (alignLeft)
pre = "{\\an7}";
else if (alignRight)
pre = "{\\an9}";
else
pre = "{\\an8}";
}
else if (alignVCenter)
{
if (alignLeft)
pre = "{\\an4}";
else if (alignRight)
pre = "{\\an6}";
else
pre = "{\\an5}";
}
else
{
if (alignLeft)
pre = "{\\an1}";
else if (alignRight)
pre = "{\\an3}";
}
string temp = pre + pText.ToString();
pText = new StringBuilder();
pText.Append(temp);
}
}
if (innerNode.ChildNodes.Count == 0)
{
pText.Append(innerNode.InnerText);

View File

@ -0,0 +1,228 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
class IssXml : SubtitleFormat
{
static Regex regexTimeCodes = new Regex(@"^\d\d:\d\d:\d\d:\d\d$", RegexOptions.Compiled); //00:02:56:02
public override string Extension
{
get { return ".ats"; }
}
public override string Name
{
get { return "ATS ISS"; }
}
public override bool HasLineNumber
{
get { return true; }
}
public override bool IsTimeBased
{
get { return true; }
}
public override bool IsMine(List<string> lines, string fileName)
{
var subtitle = new Subtitle();
LoadSubtitle(subtitle, lines, fileName);
return subtitle.Paragraphs.Count > 0;
}
public override string ToText(Subtitle subtitle, string title)
{
int duration = 0;
if (subtitle.Paragraphs.Count > 0)
duration = (int)Math.Round(subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].EndTime.TotalSeconds * Configuration.Settings.General.CurrentFrameRate);
string xmlStructure =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + Environment.NewLine +
"<ISS>" + Environment.NewLine +
" <Project ScreenHeight=\"480\" ScreenWidth=\"720\" OffsetTc=\"0\" TcMemo=\"\" TcEnd=\"\" TcStart=\"\" TcUser=\"\" TransMemo=\"\" TransEnd=\"\" TransStart=\"\" TransUser=\"\" CreateMemo=\"\" CreateDate=\"2012-06-30\" CreateUser=\"\" MovieFile=\"C:\\Documents and Settings\\Imac\\My Documents\\밀레니엄3부_1.5.mpg\" Title=\"프로젝트명\"/>" + Environment.NewLine +
" <StyleList CurStyle=\"\">" + Environment.NewLine +
" <Style Name=\"해설자\">" + Environment.NewLine +
" <FontAttr BoxGradientType=\"0\" BoxGradient=\"0\" BoxOpacity2=\"100\" BoxColor2=\"0,0,0\" BoxOpacity=\"100\" BoxColor=\"0,255,0\" BoxMargin=\"(0,0)\" Box=\"0\" ShadowDepth=\"(2,2)\" ShadowOpacity=\"10\" ShadowAntiAlias=\"1\" ShadowColor=\"128,128,128\" Shadow=\"0\" OutlineHardness2=\"50\" OutlineWidth2=\"3\" OutlineAntiAlias2=\"1\" OutlineColor2=\"0,0,0\" Outline2=\"0\" OutlineHardness=\"50\" OutlineWidth=\"2\" OutlineAntiAlias=\"1\" OutlineColor=\"0,0,0\" Outline=\"0\" GradientType=\"0\" Gradient=\"0\" Opacity2=\"100\" AntiAlias2=\"1\" Color2=\"255,255,255\" Opacity=\"100\" AntiAlias=\"1\" Color=\"255,0,255\" StrikeOut=\"0\" Underline=\"0\" Italic=\"0\" Bold=\"1\" CharSet=\"129\" Width=\"12\" Height=\"14\" FaceName=\"굴림\"/>" + Environment.NewLine +
" <ParaAttr ORDER=\"LEFT\" ALIGN=\"MIDDLE\" JUSTIFY=\"CENTER\"/>" + Environment.NewLine +
" </Style>" + Environment.NewLine +
" <Style Name=\"보통\">" + Environment.NewLine +
" <FontAttr BoxGradientType=\"0\" BoxGradient=\"0\" BoxOpacity2=\"100\" BoxColor2=\"0,0,0\" BoxOpacity=\"100\" BoxColor=\"0,255,0\" BoxMargin=\"(0,0)\" Box=\"0\" ShadowDepth=\"(2,2)\" ShadowOpacity=\"10\" ShadowAntiAlias=\"1\" ShadowColor=\"128,128,128\" Shadow=\"0\" OutlineHardness2=\"50\" OutlineWidth2=\"3\" OutlineAntiAlias2=\"1\" OutlineColor2=\"0,0,0\" Outline2=\"0\" OutlineHardness=\"50\" OutlineWidth=\"2\" OutlineAntiAlias=\"1\" OutlineColor=\"0,0,0\" Outline=\"1\" GradientType=\"0\" Gradient=\"0\" Opacity2=\"100\" AntiAlias2=\"1\" Color2=\"255,255,255\" Opacity=\"100\" AntiAlias=\"1\" Color=\"255,255,255\" StrikeOut=\"0\" Underline=\"0\" Italic=\"0\" Bold=\"0\" CharSet=\"129\" Width=\"12\" Height=\"12\" FaceName=\"굴림체\"/>" + Environment.NewLine +
" <ParaAttr ORDER=\"CENTER\" ALIGN=\"MIDDLE\" JUSTIFY=\"CENTER\"/>" + Environment.NewLine +
" </Style>" + Environment.NewLine +
" </StyleList>" + Environment.NewLine +
" <Environment DefaultStyle=\"해설자\"/>" + Environment.NewLine +
" <VoiceCheckInOut VoiceOutCheckFrame=\"3\" VoiceOutCheckPoint=\"4\" VoiceInCheckFrame=\"3\" VoiceInCheckPoint=\"8\"/><MoveUserTcFrame Value=\"3\"/>" + Environment.NewLine +
" <AutoSave DurationMin=\"10\" Use=\"1\"/>" + Environment.NewLine +
" <AutoMoveByEnter Use=\"1\"/>" + Environment.NewLine +
" <AutoMoveByCharCount Use=\"0\"/>" + Environment.NewLine +
" <TrackList>" + Environment.NewLine +
" <Track Name=\"기본 트랙\" DisplayChannel=\"0\" Display=\"1\" RowCount=\"280\" Bottom=\"470\" Right=\"710\" Top=\"320\" Left=\"10\" StyleName=\"해설자\">" + Environment.NewLine +
" <FcpProperty Use2997DropFrame=\"1\" LineColor=\"0,0,0\" UseLineColor=\"0\" TextColor=\"255,255,255\" UseTextColor=\"0\" CenterY=\"0\" CenterX=\"0\" UseCenter=\"0\" TextOpacity=\"100\" LineWidth=\"50\" UseLineWidth=\"0\" Aspect=\"1.000000\" FontSize=\"26\" UseFontSize=\"0\" Alignment=\"2\" UseAlignment=\"0\" Style=\"1\" UseStyle=\"0\" FontName=\"Stone Sans ITC TT\" UseFontName=\"0\" Tracking=\"0.800000\" LineSoftness=\"15\" Leading=\"-10.000000\"/>" + Environment.NewLine +
" <ChannelDefineList>" + Environment.NewLine +
" <ChannelDefine Name=\"기본 채널\" Bottom=\"470\" Right=\"710\" Top=\"320\" Left=\"10\" StyleName=\"해설자\"/>" + Environment.NewLine +
" <ChannelDefine Name=\"영어\" Bottom=\"470\" Right=\"710\" Top=\"320\" Left=\"10\" StyleName=\"해설자\"/>" + Environment.NewLine +
" <ChannelDefine Name=\"시간\" Bottom=\"470\" Right=\"710\" Top=\"320\" Left=\"10\" StyleName=\"해설자\"/>" + Environment.NewLine +
" </ChannelDefineList>" + Environment.NewLine +
" <StItemList />" + Environment.NewLine +
" </Track>" + Environment.NewLine +
" </TrackList>" + Environment.NewLine +
"</ISS>";
string xmlTrackStructure =
"<StTextList>" + Environment.NewLine +
" <StText StyleName=\"해설자\" Mark=\"0\"></StText>" + Environment.NewLine +
" <StText StyleName=\"해설자\" Mark=\"0\"/>" + Environment.NewLine +
" <StText StyleName=\"해설자\" Mark=\"0\">00:03:57:16</StText>" + Environment.NewLine +
"</StTextList>";
if (string.IsNullOrEmpty(title))
title = "Subtitle Edit subtitle";
var xml = new XmlDocument();
xml.LoadXml(xmlStructure);
//TODO: set variables...
XmlNode trackNode = xml.DocumentElement.SelectSingleNode("TrackList/Track/StItemList");
int number = 1;
foreach (Paragraph p in subtitle.Paragraphs)
{
// starttime + text
XmlNode stItem = xml.CreateElement("StItem");
stItem.InnerXml = xmlTrackStructure;
XmlAttribute memo = xml.CreateAttribute("Memo");
memo.InnerText = string.Empty;
stItem.Attributes.Append(memo);
XmlAttribute tc = xml.CreateAttribute("TC");
tc.InnerText = p.StartTime.TotalMilliseconds.ToString();
stItem.Attributes.Append(tc);
XmlAttribute row = xml.CreateAttribute("Row");
row.InnerText = number.ToString();
stItem.Attributes.Append(row);
XmlNodeList list = stItem.SelectNodes("StTextList/StText");
list[0].InnerText = p.Text;
list[2].InnerText = p.StartTime.ToHHMMSSFF();
trackNode.AppendChild(stItem);
number++;
// endtime
stItem = xml.CreateElement("StItem");
stItem.InnerXml = xmlTrackStructure;
memo = xml.CreateAttribute("Memo");
memo.InnerText = string.Empty;
stItem.Attributes.Append(memo);
tc = xml.CreateAttribute("TC");
tc.InnerText = p.EndTime.TotalMilliseconds.ToString();
stItem.Attributes.Append(tc);
row = xml.CreateAttribute("Row");
row.InnerText = number.ToString();
stItem.Attributes.Append(row);
list = stItem.SelectNodes("StTextList/StText");
list[0].InnerText = string.Empty;
list[2].InnerText = p.EndTime.ToString();
trackNode.AppendChild(stItem);
number++;
}
var ms = new MemoryStream();
var writer = new XmlTextWriter(ms, Encoding.UTF8) { Formatting = Formatting.Indented };
xml.Save(writer);
string xmlAsText = Encoding.UTF8.GetString(ms.ToArray()).Trim();
// fix...?
return xmlAsText;
}
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
{
_errorCount = 0;
var sb = new StringBuilder();
lines.ForEach(line => sb.AppendLine(line));
if (!sb.ToString().Contains("<StTextList"))
{
_errorCount++;
return;
}
var xml = new XmlDocument();
try
{
xml.LoadXml(sb.ToString());
XmlNode use2997DropFrame = xml.DocumentElement.SelectSingleNode("TrackList/Track/FcpProperty");
if (use2997DropFrame != null && use2997DropFrame.Attributes["Use2997DropFrame"] != null && use2997DropFrame.Attributes["Use2997DropFrame"].InnerText == "1")
Configuration.Settings.General.CurrentFrameRate = 29.97;
foreach (XmlNode node in xml.SelectNodes("//StItem"))
{
Paragraph p = new Paragraph();
p.StartTime = new TimeCode(TimeSpan.FromMilliseconds(long.Parse(node.Attributes["TC"].InnerText)));
//p.StartFrame = int.Parse(node.Attributes["TC"].InnerText);
//p.CalculateTimeCodesFromFrameNumbers(Configuration.Settings.General.CurrentFrameRate);
try
{
string text = string.Empty;
XmlNodeList list = node.SelectNodes("StTextList/StText");
if (list.Count == 3 && regexTimeCodes.IsMatch(list[2].InnerText))
p.StartTime.TotalMilliseconds = TimeCode.ParseHHMMSSFFToMilliseconds(list[2].InnerText);
if (list.Count > 1)
{
text = (list[0].InnerText + Environment.NewLine + list[1].InnerText).Trim();
}
else if (list.Count == 1)
{
text = list[0].InnerText.Trim();
}
p.Text = text;
subtitle.Paragraphs.Add(p);
}
catch
{
_errorCount++;
}
}
subtitle.Renumber(1);
}
catch
{
_errorCount = 1;
return;
}
int i = 0;
foreach (Paragraph p in subtitle.Paragraphs)
{
i++;
var next = subtitle.GetParagraphOrDefault(i);
if (next != null)
p.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds;
}
subtitle.RemoveEmptyLines();
}
}
}

View File

@ -45,6 +45,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
new FinalCutProTestXml(),
new FlashXml(),
new GpacTtxt(),
new IssXml(),
new Json(),
new JsonType2(),
new JsonType3(),

View File

@ -1,4 +1,5 @@
using System;
using Nikse.SubtitleEdit.Logic.SubtitleFormats;
namespace Nikse.SubtitleEdit.Logic
{
@ -24,6 +25,24 @@ namespace Nikse.SubtitleEdit.Logic
return 0;
}
public static double ParseHHMMSSFFToMilliseconds(string text)
{
string[] parts = text.Split(":,.".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 4)
{
int hours;
int minutes;
int seconds;
int frames;
if (int.TryParse(parts[0], out hours) && int.TryParse(parts[1], out minutes) && int.TryParse(parts[2], out seconds) && int.TryParse(parts[3], out frames))
{
TimeSpan ts = new TimeSpan(0, hours, minutes, seconds, SubtitleFormat.FramesToMilliseconds(frames));
return ts.TotalMilliseconds;
}
}
return 0;
}
public TimeCode(TimeSpan timeSpan)
{
TimeSpan = timeSpan;

View File

@ -686,6 +686,7 @@
<Compile Include="Logic\SubtitleFormats\FlashXml.cs" />
<Compile Include="Logic\SubtitleFormats\GpacTtxt.cs" />
<Compile Include="Logic\SubtitleFormats\HtmlSamiArray.cs" />
<Compile Include="Logic\SubtitleFormats\IssXml.cs" />
<Compile Include="Logic\SubtitleFormats\JsonType3.cs" />
<Compile Include="Logic\SubtitleFormats\NciCaption.cs" />
<Compile Include="Logic\SubtitleFormats\RhozetHarmonic.cs" />