Working on ebu save dialog

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@390 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-04-09 13:24:04 +00:00
parent 2fde294abf
commit 8d40ca1ef8
3 changed files with 543 additions and 170 deletions

View File

@ -28,207 +28,471 @@
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPageHeader = new System.Windows.Forms.TabPage();
this.numericUpDownDiskSequenceNumber = new System.Windows.Forms.NumericUpDown();
this.numericUpDownTotalNumberOfDiscs = new System.Windows.Forms.NumericUpDown();
this.numericUpDownRevisionNumber = new System.Windows.Forms.NumericUpDown();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.textBoxTranslatorsName = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.textBoxSubtitleListReferenceCode = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.comboBoxCharacterCodeTable = new System.Windows.Forms.ComboBox();
this.buttonImport = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.textBoxTranslatedProgramTitle = new System.Windows.Forms.TextBox();
this.textBoxTranslatedEpisodeTitle = new System.Windows.Forms.TextBox();
this.textBoxOriginalEpisodeTitle = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBoxOriginalProgramTitle = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tabPageTextAndTiming = new System.Windows.Forms.TabPage();
this.comboBoxJustificationCode = new System.Windows.Forms.ComboBox();
this.label13 = new System.Windows.Forms.Label();
this.tabPageErrors = new System.Windows.Forms.TabPage();
this.textBoxErrors = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.numericUpDownMaxCharacters = new System.Windows.Forms.NumericUpDown();
this.label12 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPageHeader.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDiskSequenceNumber)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTotalNumberOfDiscs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownRevisionNumber)).BeginInit();
this.tabPageTextAndTiming.SuspendLayout();
this.tabPageErrors.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxCharacters)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(23, 21);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Original program title";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(164, 18);
this.textBox1.MaxLength = 32;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(219, 20);
this.textBox1.TabIndex = 1;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(23, 47);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(101, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Original episode title";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(23, 73);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(117, 13);
this.label3.TabIndex = 3;
this.label3.Text = "Translated program title";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(23, 99);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(116, 13);
this.label4.TabIndex = 4;
this.label4.Text = "Translated episode title";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(164, 44);
this.textBox2.MaxLength = 32;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(219, 20);
this.textBox2.TabIndex = 5;
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(164, 96);
this.textBox3.MaxLength = 32;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(219, 20);
this.textBox3.TabIndex = 6;
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(164, 70);
this.textBox4.MaxLength = 32;
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(219, 20);
this.textBox4.TabIndex = 7;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(23, 125);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(106, 13);
this.label5.TabIndex = 8;
this.label5.Text = "Character code table";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(24, 179);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(34, 13);
this.label6.TabIndex = 10;
this.label6.Text = "Errors";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(27, 195);
this.textBox6.Multiline = true;
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(577, 148);
this.textBox6.TabIndex = 11;
//
// buttonOK
//
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(448, 349);
this.buttonOK.Location = new System.Drawing.Point(684, 454);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 19;
this.buttonOK.Text = "Save";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// buttonCancel
//
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.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(529, 349);
this.buttonCancel.Location = new System.Drawing.Point(765, 454);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 18;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// button1
//
this.button1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button1.Location = new System.Drawing.Point(512, 13);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(92, 21);
this.button1.TabIndex = 20;
this.button1.Text = "Import...";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(164, 125);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(219, 21);
this.comboBox1.TabIndex = 21;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPageHeader);
this.tabControl1.Controls.Add(this.tabPageTextAndTiming);
this.tabControl1.Controls.Add(this.tabPageErrors);
this.tabControl1.Location = new System.Drawing.Point(12, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(835, 431);
this.tabControl1.TabIndex = 32;
//
// tabPageHeader
//
this.tabPageHeader.Controls.Add(this.numericUpDownMaxCharacters);
this.tabPageHeader.Controls.Add(this.label12);
this.tabPageHeader.Controls.Add(this.numericUpDownDiskSequenceNumber);
this.tabPageHeader.Controls.Add(this.numericUpDownTotalNumberOfDiscs);
this.tabPageHeader.Controls.Add(this.numericUpDownRevisionNumber);
this.tabPageHeader.Controls.Add(this.label11);
this.tabPageHeader.Controls.Add(this.label10);
this.tabPageHeader.Controls.Add(this.label9);
this.tabPageHeader.Controls.Add(this.textBoxTranslatorsName);
this.tabPageHeader.Controls.Add(this.label8);
this.tabPageHeader.Controls.Add(this.textBoxSubtitleListReferenceCode);
this.tabPageHeader.Controls.Add(this.label7);
this.tabPageHeader.Controls.Add(this.comboBoxCharacterCodeTable);
this.tabPageHeader.Controls.Add(this.buttonImport);
this.tabPageHeader.Controls.Add(this.label5);
this.tabPageHeader.Controls.Add(this.textBoxTranslatedProgramTitle);
this.tabPageHeader.Controls.Add(this.textBoxTranslatedEpisodeTitle);
this.tabPageHeader.Controls.Add(this.textBoxOriginalEpisodeTitle);
this.tabPageHeader.Controls.Add(this.label4);
this.tabPageHeader.Controls.Add(this.label3);
this.tabPageHeader.Controls.Add(this.label2);
this.tabPageHeader.Controls.Add(this.textBoxOriginalProgramTitle);
this.tabPageHeader.Controls.Add(this.label1);
this.tabPageHeader.Location = new System.Drawing.Point(4, 22);
this.tabPageHeader.Name = "tabPageHeader";
this.tabPageHeader.Padding = new System.Windows.Forms.Padding(3);
this.tabPageHeader.Size = new System.Drawing.Size(827, 405);
this.tabPageHeader.TabIndex = 0;
this.tabPageHeader.Text = "General subtitle information";
this.tabPageHeader.UseVisualStyleBackColor = true;
//
// numericUpDownDiskSequenceNumber
//
this.numericUpDownDiskSequenceNumber.Location = new System.Drawing.Point(147, 254);
this.numericUpDownDiskSequenceNumber.Maximum = new decimal(new int[] {
9,
0,
0,
0});
this.numericUpDownDiskSequenceNumber.Name = "numericUpDownDiskSequenceNumber";
this.numericUpDownDiskSequenceNumber.Size = new System.Drawing.Size(120, 20);
this.numericUpDownDiskSequenceNumber.TabIndex = 9;
//
// numericUpDownTotalNumberOfDiscs
//
this.numericUpDownTotalNumberOfDiscs.Location = new System.Drawing.Point(147, 280);
this.numericUpDownTotalNumberOfDiscs.Maximum = new decimal(new int[] {
9,
0,
0,
0});
this.numericUpDownTotalNumberOfDiscs.Name = "numericUpDownTotalNumberOfDiscs";
this.numericUpDownTotalNumberOfDiscs.Size = new System.Drawing.Size(120, 20);
this.numericUpDownTotalNumberOfDiscs.TabIndex = 8;
//
// numericUpDownRevisionNumber
//
this.numericUpDownRevisionNumber.Location = new System.Drawing.Point(147, 202);
this.numericUpDownRevisionNumber.Maximum = new decimal(new int[] {
99,
0,
0,
0});
this.numericUpDownRevisionNumber.Name = "numericUpDownRevisionNumber";
this.numericUpDownRevisionNumber.Size = new System.Drawing.Size(120, 20);
this.numericUpDownRevisionNumber.TabIndex = 50;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(7, 256);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(116, 13);
this.label11.TabIndex = 49;
this.label11.Text = "Disk sequence number";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(7, 282);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(108, 13);
this.label10.TabIndex = 48;
this.label10.Text = "Total number of disks";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(7, 204);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(86, 13);
this.label9.TabIndex = 47;
this.label9.Text = "Revision number";
//
// textBoxTranslatorsName
//
this.textBoxTranslatorsName.Location = new System.Drawing.Point(147, 146);
this.textBoxTranslatorsName.MaxLength = 32;
this.textBoxTranslatorsName.Name = "textBoxTranslatorsName";
this.textBoxTranslatorsName.Size = new System.Drawing.Size(219, 20);
this.textBoxTranslatorsName.TabIndex = 6;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(6, 149);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(90, 13);
this.label8.TabIndex = 45;
this.label8.Text = "Translator\'s name";
//
// textBoxSubtitleListReferenceCode
//
this.textBoxSubtitleListReferenceCode.Location = new System.Drawing.Point(147, 176);
this.textBoxSubtitleListReferenceCode.MaxLength = 16;
this.textBoxSubtitleListReferenceCode.Name = "textBoxSubtitleListReferenceCode";
this.textBoxSubtitleListReferenceCode.Size = new System.Drawing.Size(219, 20);
this.textBoxSubtitleListReferenceCode.TabIndex = 7;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(6, 179);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(132, 13);
this.label7.TabIndex = 43;
this.label7.Text = "Subtitle list reference code";
//
// comboBoxCharacterCodeTable
//
this.comboBoxCharacterCodeTable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxCharacterCodeTable.FormattingEnabled = true;
this.comboBoxCharacterCodeTable.Items.AddRange(new object[] {
"Latin",
"Latin/Cyrillic",
"Latin/Arabic",
"Latin/Greek",
"Latin/Hebrew"});
this.comboBoxCharacterCodeTable.Location = new System.Drawing.Point(147, 12);
this.comboBoxCharacterCodeTable.Name = "comboBoxCharacterCodeTable";
this.comboBoxCharacterCodeTable.Size = new System.Drawing.Size(219, 21);
this.comboBoxCharacterCodeTable.TabIndex = 0;
//
// buttonImport
//
this.buttonImport.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonImport.Location = new System.Drawing.Point(411, 14);
this.buttonImport.Name = "buttonImport";
this.buttonImport.Size = new System.Drawing.Size(92, 21);
this.buttonImport.TabIndex = 1;
this.buttonImport.Text = "Import...";
this.buttonImport.UseVisualStyleBackColor = true;
this.buttonImport.Click += new System.EventHandler(this.buttonImport_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 15);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(106, 13);
this.label5.TabIndex = 40;
this.label5.Text = "Character code table";
//
// textBoxTranslatedProgramTitle
//
this.textBoxTranslatedProgramTitle.Location = new System.Drawing.Point(147, 94);
this.textBoxTranslatedProgramTitle.MaxLength = 32;
this.textBoxTranslatedProgramTitle.Name = "textBoxTranslatedProgramTitle";
this.textBoxTranslatedProgramTitle.Size = new System.Drawing.Size(219, 20);
this.textBoxTranslatedProgramTitle.TabIndex = 4;
//
// textBoxTranslatedEpisodeTitle
//
this.textBoxTranslatedEpisodeTitle.Location = new System.Drawing.Point(147, 120);
this.textBoxTranslatedEpisodeTitle.MaxLength = 32;
this.textBoxTranslatedEpisodeTitle.Name = "textBoxTranslatedEpisodeTitle";
this.textBoxTranslatedEpisodeTitle.Size = new System.Drawing.Size(219, 20);
this.textBoxTranslatedEpisodeTitle.TabIndex = 5;
//
// textBoxOriginalEpisodeTitle
//
this.textBoxOriginalEpisodeTitle.Location = new System.Drawing.Point(147, 68);
this.textBoxOriginalEpisodeTitle.MaxLength = 32;
this.textBoxOriginalEpisodeTitle.Name = "textBoxOriginalEpisodeTitle";
this.textBoxOriginalEpisodeTitle.Size = new System.Drawing.Size(219, 20);
this.textBoxOriginalEpisodeTitle.TabIndex = 3;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 123);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(116, 13);
this.label4.TabIndex = 36;
this.label4.Text = "Translated episode title";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 97);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(117, 13);
this.label3.TabIndex = 35;
this.label3.Text = "Translated program title";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 71);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(101, 13);
this.label2.TabIndex = 34;
this.label2.Text = "Original episode title";
//
// textBoxOriginalProgramTitle
//
this.textBoxOriginalProgramTitle.Location = new System.Drawing.Point(147, 42);
this.textBoxOriginalProgramTitle.MaxLength = 32;
this.textBoxOriginalProgramTitle.Name = "textBoxOriginalProgramTitle";
this.textBoxOriginalProgramTitle.Size = new System.Drawing.Size(219, 20);
this.textBoxOriginalProgramTitle.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 45);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(102, 13);
this.label1.TabIndex = 32;
this.label1.Text = "Original program title";
//
// tabPageTextAndTiming
//
this.tabPageTextAndTiming.Controls.Add(this.comboBoxJustificationCode);
this.tabPageTextAndTiming.Controls.Add(this.label13);
this.tabPageTextAndTiming.Location = new System.Drawing.Point(4, 22);
this.tabPageTextAndTiming.Name = "tabPageTextAndTiming";
this.tabPageTextAndTiming.Size = new System.Drawing.Size(827, 405);
this.tabPageTextAndTiming.TabIndex = 2;
this.tabPageTextAndTiming.Text = "Text and timing information";
this.tabPageTextAndTiming.UseVisualStyleBackColor = true;
//
// comboBoxJustificationCode
//
this.comboBoxJustificationCode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxJustificationCode.FormattingEnabled = true;
this.comboBoxJustificationCode.Items.AddRange(new object[] {
"unchanged presentation",
"left-justified text",
"centred text",
"right-justified text"});
this.comboBoxJustificationCode.Location = new System.Drawing.Point(145, 11);
this.comboBoxJustificationCode.Name = "comboBoxJustificationCode";
this.comboBoxJustificationCode.Size = new System.Drawing.Size(219, 21);
this.comboBoxJustificationCode.TabIndex = 43;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(6, 14);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(89, 13);
this.label13.TabIndex = 44;
this.label13.Text = "Justification code";
//
// tabPageErrors
//
this.tabPageErrors.Controls.Add(this.textBoxErrors);
this.tabPageErrors.Controls.Add(this.label6);
this.tabPageErrors.Location = new System.Drawing.Point(4, 22);
this.tabPageErrors.Name = "tabPageErrors";
this.tabPageErrors.Padding = new System.Windows.Forms.Padding(3);
this.tabPageErrors.Size = new System.Drawing.Size(827, 405);
this.tabPageErrors.TabIndex = 1;
this.tabPageErrors.Text = "Errors";
this.tabPageErrors.UseVisualStyleBackColor = true;
//
// textBoxErrors
//
this.textBoxErrors.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.textBoxErrors.Location = new System.Drawing.Point(6, 26);
this.textBoxErrors.Multiline = true;
this.textBoxErrors.Name = "textBoxErrors";
this.textBoxErrors.Size = new System.Drawing.Size(804, 358);
this.textBoxErrors.TabIndex = 13;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 10);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(34, 13);
this.label6.TabIndex = 12;
this.label6.Text = "Errors";
//
// numericUpDownMaxCharacters
//
this.numericUpDownMaxCharacters.Location = new System.Drawing.Point(147, 228);
this.numericUpDownMaxCharacters.Maximum = new decimal(new int[] {
99,
0,
0,
0});
this.numericUpDownMaxCharacters.Name = "numericUpDownMaxCharacters";
this.numericUpDownMaxCharacters.Size = new System.Drawing.Size(120, 20);
this.numericUpDownMaxCharacters.TabIndex = 52;
this.numericUpDownMaxCharacters.ValueChanged += new System.EventHandler(this.numericUpDownMaxCharacters_ValueChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(7, 230);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(133, 13);
this.label12.TabIndex = 51;
this.label12.Text = "Max# of displayable chars ";
//
// EbuSaveOptions
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(629, 378);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button1);
this.ClientSize = new System.Drawing.Size(852, 486);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.textBox6);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Name = "EbuSaveOptions";
this.Text = "EbuSaveOptions";
this.tabControl1.ResumeLayout(false);
this.tabPageHeader.ResumeLayout(false);
this.tabPageHeader.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDiskSequenceNumber)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownTotalNumberOfDiscs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownRevisionNumber)).EndInit();
this.tabPageTextAndTiming.ResumeLayout(false);
this.tabPageTextAndTiming.PerformLayout();
this.tabPageErrors.ResumeLayout(false);
this.tabPageErrors.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxCharacters)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPageHeader;
private System.Windows.Forms.NumericUpDown numericUpDownDiskSequenceNumber;
private System.Windows.Forms.NumericUpDown numericUpDownTotalNumberOfDiscs;
private System.Windows.Forms.NumericUpDown numericUpDownRevisionNumber;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBoxTranslatorsName;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBoxSubtitleListReferenceCode;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox comboBoxCharacterCodeTable;
private System.Windows.Forms.Button buttonImport;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBoxTranslatedProgramTitle;
private System.Windows.Forms.TextBox textBoxTranslatedEpisodeTitle;
private System.Windows.Forms.TextBox textBoxOriginalEpisodeTitle;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBoxOriginalProgramTitle;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TabPage tabPageTextAndTiming;
private System.Windows.Forms.TabPage tabPageErrors;
private System.Windows.Forms.TextBox textBoxErrors;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox comboBoxJustificationCode;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.NumericUpDown numericUpDownMaxCharacters;
private System.Windows.Forms.Label label12;
}
}

View File

@ -1,26 +1,125 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.SubtitleFormats;
using System.Text;
namespace Nikse.SubtitleEdit.Forms
{
public partial class EbuSaveOptions : Form
public sealed partial class EbuSaveOptions : Form
{
Ebu.EbuGeneralSubtitleInformation _header;
Subtitle _subtitle;
public byte JustificationCode { get; private set; }
public EbuSaveOptions()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
internal void Initialize(Ebu.EbuGeneralSubtitleInformation header, byte justificationCode, string fileName, Subtitle subtitle)
{
_header = header;
_subtitle = subtitle;
FillFromHeader(header);
string title = Path.GetFileNameWithoutExtension(fileName);
textBoxOriginalProgramTitle.Text = title;
comboBoxJustificationCode.SelectedIndex = justificationCode;
this.Text = Configuration.Settings.Language.EbuSaveOtpions.Title;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void CheckErrors(Subtitle subtitle)
{
textBoxErrors.Text = string.Empty;
StringBuilder sb = new StringBuilder();
int errorCount = 0;
int i = 1;
foreach (Paragraph p in subtitle.Paragraphs)
{
string[] arr = p.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (string line in arr)
{
if (line.Length > numericUpDownMaxCharacters.Value)
{
sb.AppendLine(string.Format("Line {0} exceeds max length ({1}) by {2}: {3}", i, numericUpDownMaxCharacters.Value, line.Length - numericUpDownMaxCharacters.Value, line));
errorCount++;
}
}
i++;
}
textBoxErrors.Text = sb.ToString();
tabPageErrors.Text = string.Format("Errors: {0}", errorCount);
}
private void FillFromHeader(Ebu.EbuGeneralSubtitleInformation header)
{
comboBoxCharacterCodeTable.SelectedIndex = int.Parse(header.CharacterCodeTableNumber);
textBoxOriginalProgramTitle.Text = header.OriginalProgrammeTitle.TrimEnd();
textBoxOriginalEpisodeTitle.Text = header.OriginalEpisodeTitle.TrimEnd();
textBoxTranslatedProgramTitle.Text = header.TranslatedProgrammeTitle.TrimEnd();
textBoxTranslatedEpisodeTitle.Text = header.TranslatedEpisodeTitle.TrimEnd();
textBoxTranslatorsName.Text = header.TranslatorsName.TrimEnd();
textBoxSubtitleListReferenceCode.Text = header.SubtitleListReferenceCode.TrimEnd();
int number;
if (int.TryParse(header.RevisionNumber, out number))
numericUpDownRevisionNumber.Value = number;
else
numericUpDownRevisionNumber.Value = 1;
numericUpDownMaxCharacters.Value = int.Parse(header.MaximumNumberOfDisplayableCharactersInAnyTextRow);
if (int.TryParse(header.DiskSequenceNumber, out number))
numericUpDownDiskSequenceNumber.Value = number;
else
numericUpDownDiskSequenceNumber.Value = 1;
if (int.TryParse(header.TotalNumberOfDisks, out number))
numericUpDownTotalNumberOfDiscs.Value = number;
else
numericUpDownTotalNumberOfDiscs.Value = 1;
}
private void buttonOK_Click(object sender, EventArgs e)
{
_header.CharacterCodeTableNumber = "0" + comboBoxCharacterCodeTable.SelectedIndex.ToString();
_header.OriginalProgrammeTitle = textBoxOriginalProgramTitle.Text.PadRight(32, ' ');
_header.OriginalEpisodeTitle = textBoxOriginalEpisodeTitle.Text.PadRight(32, ' ');
_header.TranslatedProgrammeTitle = textBoxTranslatedProgramTitle.Text.PadRight(32, ' ');
_header.TranslatedEpisodeTitle = textBoxTranslatedEpisodeTitle.Text.PadRight(32, ' ');
_header.TranslatorsName = textBoxTranslatorsName.Text.PadRight(32, ' ');
_header.SubtitleListReferenceCode = textBoxSubtitleListReferenceCode.Text.PadRight(16, ' ');
_header.RevisionNumber = numericUpDownRevisionNumber.Value.ToString().PadLeft(2, '0');
_header.MaximumNumberOfDisplayableCharactersInAnyTextRow = numericUpDownMaxCharacters.Value.ToString().PadLeft(2, '0');
_header.DiskSequenceNumber = numericUpDownDiskSequenceNumber.Value.ToString();
_header.TotalNumberOfDisks = numericUpDownTotalNumberOfDiscs.Value.ToString();
JustificationCode = (byte)comboBoxJustificationCode.SelectedIndex;
DialogResult = DialogResult.OK;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void buttonImport_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Ebu stl files (*.stl)|*.stl";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
{
Ebu ebu = new Ebu();
Subtitle temp = new Subtitle();
ebu.LoadSubtitle(temp, null, openFileDialog1.FileName);
FillFromHeader(ebu.Header);
}
}
private void numericUpDownMaxCharacters_ValueChanged(object sender, EventArgs e)
{
CheckErrors(_subtitle);
}
}
}

View File

@ -1,8 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Forms;
namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
@ -12,10 +14,12 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public class Ebu : SubtitleFormat
{
internal EbuGeneralSubtitleInformation Header;
/// <summary>
/// GSI block (1024 bytes)
/// </summary>
private class EbuGeneralSubtitleInformation
internal class EbuGeneralSubtitleInformation
{
public string CodePageNumber { get; set; } // 0..2
public string DiskFormatCode { get; set; } // 3..10
@ -404,9 +408,13 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public void Save(string fileName, Subtitle subtitle)
{
FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
EbuGeneralSubtitleInformation header = new EbuGeneralSubtitleInformation();
EbuSaveOptions saveOptions = new EbuSaveOptions();
saveOptions.Initialize(header, 0, fileName, subtitle);
if (saveOptions.ShowDialog() != DialogResult.OK)
return;
FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
header.TotalNumberOfSubtitles = ((subtitle.Paragraphs.Count+1).ToString()).PadLeft(5, '0'); // seems to be 1 higher than actual number of subtitles
header.TotalNumberOfTextAndTimingInformationBlocks = header.TotalNumberOfSubtitles;
@ -436,6 +444,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
tti.VerticalPosition = 0x14;
else
tti.VerticalPosition = 0x16;
tti.JustificationCode = saveOptions.JustificationCode;
tti.SubtitleNumber = (ushort)p.Number;
tti.TextField = p.Text;
tti.TimeCodeInHours = p.StartTime.Hours;
@ -491,6 +500,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
subtitle.Paragraphs.Add(p);
}
subtitle.Renumber(1);
Header = header;
}
private EbuGeneralSubtitleInformation ReadHeader(byte[] buffer)