Initial version

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@10 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-10-12 11:17:56 +00:00
parent a9eb01ca30
commit 7da9101e25
135 changed files with 45608 additions and 0 deletions

149
src/Forms/About.Designer.cs generated Normal file
View File

@ -0,0 +1,149 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class About
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
this.okButton = new System.Windows.Forms.Button();
this.labelProduct = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.richTextBoxAbout1 = new System.Windows.Forms.RichTextBox();
this.labelFindHeight = new System.Windows.Forms.Label();
this.buttonDonate = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.okButton.Location = new System.Drawing.Point(355, 342);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(83, 21);
this.okButton.TabIndex = 0;
this.okButton.Text = "&OK";
this.okButton.Click += new System.EventHandler(this.OkButtonClick);
//
// labelProduct
//
this.labelProduct.AutoSize = true;
this.labelProduct.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelProduct.Location = new System.Drawing.Point(11, 16);
this.labelProduct.Name = "labelProduct";
this.labelProduct.Size = new System.Drawing.Size(138, 20);
this.labelProduct.TabIndex = 26;
this.labelProduct.Text = "Subtitle Edit 3.0";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(368, 14);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(70, 64);
this.pictureBox1.TabIndex = 27;
this.pictureBox1.TabStop = false;
//
// richTextBoxAbout1
//
this.richTextBoxAbout1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBoxAbout1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBoxAbout1.Location = new System.Drawing.Point(16, 43);
this.richTextBoxAbout1.Name = "richTextBoxAbout1";
this.richTextBoxAbout1.ReadOnly = true;
this.richTextBoxAbout1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
this.richTextBoxAbout1.Size = new System.Drawing.Size(429, 243);
this.richTextBoxAbout1.TabIndex = 40;
this.richTextBoxAbout1.TabStop = false;
this.richTextBoxAbout1.Text = "About...";
this.richTextBoxAbout1.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RichTextBoxAbout1LinkClicked);
//
// labelFindHeight
//
this.labelFindHeight.AutoSize = true;
this.labelFindHeight.Location = new System.Drawing.Point(187, 24);
this.labelFindHeight.Name = "labelFindHeight";
this.labelFindHeight.Size = new System.Drawing.Size(80, 13);
this.labelFindHeight.TabIndex = 41;
this.labelFindHeight.Text = "labelFindHeight";
this.labelFindHeight.Visible = false;
//
// buttonDonate
//
this.buttonDonate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonDonate.AutoSize = true;
this.buttonDonate.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.buttonDonate.FlatAppearance.BorderSize = 0;
this.buttonDonate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonDonate.ForeColor = System.Drawing.Color.Transparent;
this.buttonDonate.Image = global::Nikse.SubtitleEdit.Properties.Resources.Donate;
this.buttonDonate.Location = new System.Drawing.Point(16, 328);
this.buttonDonate.Name = "buttonDonate";
this.buttonDonate.Size = new System.Drawing.Size(98, 32);
this.buttonDonate.TabIndex = 42;
this.buttonDonate.UseVisualStyleBackColor = false;
this.buttonDonate.Click += new System.EventHandler(this.buttonDonate_Click);
//
// About
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(457, 372);
this.Controls.Add(this.buttonDonate);
this.Controls.Add(this.labelFindHeight);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.richTextBoxAbout1);
this.Controls.Add(this.labelProduct);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "About";
this.Padding = new System.Windows.Forms.Padding(9);
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "About Subtitle Edit";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.About_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Label labelProduct;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.RichTextBox richTextBoxAbout1;
private System.Windows.Forms.Label labelFindHeight;
private System.Windows.Forms.Button buttonDonate;
}
}

56
src/Forms/About.cs Normal file
View File

@ -0,0 +1,56 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
partial class About : Form
{
LanguageStructure.About _language = Configuration.Settings.Language.About;
LanguageStructure.General _languageGeneral = Configuration.Settings.Language.General;
public About()
{
InitializeComponent();
base.Text = _language.Title;
string[] versionInfo = Utilities.AssemblyVersion.Split('.');
string minorMinorVersion = string.Empty;
if (versionInfo.Length >= 3 && versionInfo[2] != "0")
minorMinorVersion = "." + versionInfo[2];
labelProduct.Text = String.Format("{0} {1}.{2}{3}, build {4}", _languageGeneral.Title, versionInfo[0], versionInfo[1], minorMinorVersion, versionInfo[3]);
richTextBoxAbout1.Text = _language.AboutText1.TrimEnd() + Environment.NewLine +
Environment.NewLine +
_languageGeneral.TranslatedBy;
okButton.Text = _languageGeneral.OK;
// Autosize height
labelFindHeight.AutoSize = true;
labelFindHeight.Text = richTextBoxAbout1.Text;
richTextBoxAbout1.Height = labelFindHeight.Height + 15;
Height = richTextBoxAbout1.Top + richTextBoxAbout1.Height + 105;
}
private void OkButtonClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void About_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void RichTextBoxAbout1LinkClicked(object sender, LinkClickedEventArgs e)
{
Process.Start(e.LinkText);
}
private void buttonDonate_Click(object sender, EventArgs e)
{
Process.Start("http://www.nikse.dk/Donate.aspx");
}
}
}

194
src/Forms/About.resx Normal file
View File

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAO
wg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ooTWJN+qgT1BfkVifhyXwMroLIiOMFLtbrq+v8LS74ITCio
2dqLjNP5bCcCrx6B/wFoD4EpAyFndgAAAABJRU5ErkJggg==
</value>
</data>
</root>

94
src/Forms/AddToNames.Designer.cs generated Normal file
View File

@ -0,0 +1,94 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class AddToNamesList
{
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.textBoxAddName = new System.Windows.Forms.TextBox();
this.labelDescription = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(80, 56);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 17;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(161, 56);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 16;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// textBoxAddName
//
this.textBoxAddName.Location = new System.Drawing.Point(15, 26);
this.textBoxAddName.Name = "textBoxAddName";
this.textBoxAddName.Size = new System.Drawing.Size(221, 20);
this.textBoxAddName.TabIndex = 15;
//
// labelDescription
//
this.labelDescription.AutoSize = true;
this.labelDescription.Location = new System.Drawing.Point(12, 9);
this.labelDescription.Name = "labelDescription";
this.labelDescription.Size = new System.Drawing.Size(193, 13);
this.labelDescription.TabIndex = 14;
this.labelDescription.Text = "Add to names/noise list (case sensitive)";
//
// FormAddToNamesList
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(248, 84);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.textBoxAddName);
this.Controls.Add(this.labelDescription);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormAddToNamesList";
this.Text = "Add to Names List";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.TextBox textBoxAddName;
private System.Windows.Forms.Label labelDescription;
}
}

79
src/Forms/AddToNames.cs Normal file
View File

@ -0,0 +1,79 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class AddToNamesList : Form
{
LanguageStructure.Main _language;
Subtitle _subtitle;
public string NewName { get; private set; }
public AddToNamesList()
{
InitializeComponent();
Text = Configuration.Settings.Language.AddToNames.Title;
labelDescription.Text = Configuration.Settings.Language.AddToNames.Description;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
buttonOK.Text = Configuration.Settings.Language.General.OK;
}
public void Initialize(Subtitle subtitle, string text)
{
_subtitle = subtitle;
if (!string.IsNullOrEmpty(text))
{
textBoxAddName.Text = text.Trim().TrimEnd('.').TrimEnd('!').TrimEnd('?');
if (textBoxAddName.Text.Length > 1)
textBoxAddName.Text = textBoxAddName.Text.Substring(0, 1).ToUpper() + textBoxAddName.Text.Substring(1);
}
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (textBoxAddName.Text.Trim().Length > 0)
{
NewName = textBoxAddName.Text.Trim();
string languageName = null;
_language = Configuration.Settings.Language.Main;
if (!string.IsNullOrEmpty(Configuration.Settings.General.SpellCheckLanguage))
{
languageName = Configuration.Settings.General.SpellCheckLanguage;
}
else
{
List<string> list = Utilities.GetDictionaryLanguages();
if (list.Count > 0)
{
string name = list[0];
int start = name.LastIndexOf("[");
int end = name.LastIndexOf("]");
if (start > 0 && end > start)
{
start++;
name = name.Substring(start, end - start);
languageName = name;
}
else
{
MessageBox.Show(string.Format(_language.InvalidLanguageNameX, name));
return;
}
}
}
languageName = Utilities.AutoDetectLanguageName(languageName, _subtitle);
if (string.IsNullOrEmpty(languageName))
languageName = "en_US";
if (Utilities.AddWordToLocalNamesEtcList(textBoxAddName.Text, languageName))
DialogResult = DialogResult.OK;
else
DialogResult = DialogResult.Cancel;
}
}
}
}

120
src/Forms/AddToNames.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

145
src/Forms/AddWareForm.Designer.cs generated Normal file
View File

@ -0,0 +1,145 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class AddWareForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.labelPleaseWait = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.buttonRipWave = new System.Windows.Forms.Button();
this.labelProgress = new System.Windows.Forms.Label();
this.labelSourcevideoFile = new System.Windows.Forms.Label();
this.labelVideoFileName = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// labelPleaseWait
//
this.labelPleaseWait.AutoSize = true;
this.labelPleaseWait.Location = new System.Drawing.Point(176, 59);
this.labelPleaseWait.Name = "labelPleaseWait";
this.labelPleaseWait.Size = new System.Drawing.Size(203, 13);
this.labelPleaseWait.TabIndex = 14;
this.labelPleaseWait.Text = "This may take a few minutes - please wait";
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(12, 80);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(522, 23);
this.progressBar1.TabIndex = 12;
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// buttonRipWave
//
this.buttonRipWave.Location = new System.Drawing.Point(12, 54);
this.buttonRipWave.Name = "buttonRipWave";
this.buttonRipWave.Size = new System.Drawing.Size(158, 23);
this.buttonRipWave.TabIndex = 13;
this.buttonRipWave.Text = "Generate wave form data";
this.buttonRipWave.UseVisualStyleBackColor = true;
this.buttonRipWave.Click += new System.EventHandler(this.buttonRipWave_Click);
//
// labelProgress
//
this.labelProgress.AutoSize = true;
this.labelProgress.Location = new System.Drawing.Point(12, 106);
this.labelProgress.Name = "labelProgress";
this.labelProgress.Size = new System.Drawing.Size(70, 13);
this.labelProgress.TabIndex = 9;
this.labelProgress.Text = "labelProgress";
//
// labelSourcevideoFile
//
this.labelSourcevideoFile.AutoSize = true;
this.labelSourcevideoFile.Location = new System.Drawing.Point(14, 9);
this.labelSourcevideoFile.Name = "labelSourcevideoFile";
this.labelSourcevideoFile.Size = new System.Drawing.Size(89, 13);
this.labelSourcevideoFile.TabIndex = 15;
this.labelSourcevideoFile.Text = "Source video file:";
//
// labelVideoFileName
//
this.labelVideoFileName.AutoSize = true;
this.labelVideoFileName.Location = new System.Drawing.Point(12, 26);
this.labelVideoFileName.Name = "labelVideoFileName";
this.labelVideoFileName.Size = new System.Drawing.Size(100, 13);
this.labelVideoFileName.TabIndex = 16;
this.labelVideoFileName.Text = "labelVideoFileName";
//
// buttonCancel
//
this.buttonCancel.Location = new System.Drawing.Point(442, 109);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(92, 23);
this.buttonCancel.TabIndex = 17;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// AddWareForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(550, 138);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.labelVideoFileName);
this.Controls.Add(this.labelSourcevideoFile);
this.Controls.Add(this.labelPleaseWait);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.buttonRipWave);
this.Controls.Add(this.labelProgress);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AddWareForm";
this.ShowIcon = false;
this.Text = "Generate wave form data";
this.Shown += new System.EventHandler(this.AddWareForm_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AddWareForm_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelPleaseWait;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button buttonRipWave;
private System.Windows.Forms.Label labelProgress;
private System.Windows.Forms.Label labelSourcevideoFile;
private System.Windows.Forms.Label labelVideoFileName;
private System.Windows.Forms.Button buttonCancel;
}
}

142
src/Forms/AddWareForm.cs Normal file
View File

@ -0,0 +1,142 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class AddWareForm : Form
{
public string SourceVideoFileName { get; private set; }
private bool _cancel = false;
public AddWareForm()
{
InitializeComponent();
labelProgress.Text = string.Empty;
buttonCancel.Visible = false;
}
public WavePeakGenerator WavePeak { get; private set; }
public void Initialize(string videoFile)
{
Text = Configuration.Settings.Language.AddWaveForm.Title;
buttonRipWave.Text = Configuration.Settings.Language.AddWaveForm.GenerateWaveFormData;
labelPleaseWait.Text = Configuration.Settings.Language.AddWaveForm.PleaseWait;
labelVideoFileName.Text = videoFile;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void buttonRipWave_Click(object sender, EventArgs e)
{
buttonRipWave.Enabled = false;
_cancel = false;
string vlcPath = Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic.GetVlcPath("vlc.exe");
if (!System.IO.File.Exists(vlcPath))
{
if (MessageBox.Show(Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFound + Environment.NewLine +
Environment.NewLine +
Configuration.Settings.Language.AddWaveForm.GoToVlcMediaPlayerHomePage,
Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFoundTitle , MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
{
System.Diagnostics.Process.Start("http://www.videolan.org/");
}
buttonRipWave.Enabled = true;
return;
}
labelPleaseWait.Visible = true;
SourceVideoFileName = labelVideoFileName.Text;
string targetFile = Path.GetTempFileName() + ".wav";
string parameters = "-I dummy -vvv \"" + SourceVideoFileName + "\" --sout=#transcode{vcodec=none,acodec=s16l}:file{dst=\"" + targetFile + "\"} vlc://quit";
//string parameters = "-I dummy -vvv \"" + _wavFileName + "\" --sout=#transcode{vcodec=none,acodec=s24l}:file{dst=\"" + _targetFile + "\"} vlc://quit";
//string parameters = "-I dummy -vvv \"" + _wavFileName + "\" --sout=#transcode{vcodec=none,acodec=s32l}:file{dst=\"" + _targetFile + "\"} vlc://quit";
Process process = new Process();
process.StartInfo = new ProcessStartInfo(vlcPath, parameters);
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.Visible = true;
double seconds = 0;
buttonCancel.Visible = true;
while (!process.HasExited)
{
Application.DoEvents();
System.Threading.Thread.Sleep(100);
seconds += 0.1;
if (seconds < 60)
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingSeconds, seconds);
else
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingMinutes, (int)(seconds / 60), (int)(seconds % 60));
this.Refresh();
if (_cancel)
{
process.Kill();
progressBar1.Visible = false;
labelPleaseWait.Visible = false;
buttonRipWave.Enabled = true;
targetFile = null;
buttonCancel.Visible = false;
DialogResult = DialogResult.Cancel;
return;
}
}
buttonCancel.Visible = false;
progressBar1.Visible = false;
progressBar1.Style = ProgressBarStyle.Blocks;
if (!File.Exists(targetFile))
{
MessageBox.Show("Could not find extracted wave file! This feature requires VLC media player 1.1.x or newer." + Environment.NewLine
+ Environment.NewLine +
"Command line: " + vlcPath + " " + parameters);
labelPleaseWait.Visible = false;
labelProgress.Text = string.Empty;
buttonRipWave.Enabled = true;
return;
}
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingPeakFile;
this.Refresh();
labelPleaseWait.Visible = false;
ReadWaveFile(targetFile);
labelProgress.Text = string.Empty;
File.Delete(targetFile);
this.DialogResult = DialogResult.OK;
}
private void ReadWaveFile(string targetFile)
{
WavePeakGenerator waveFile = new WavePeakGenerator(targetFile);
waveFile.GeneratePeakSamples(128); // samples per second - SampleRate
WavePeak = waveFile;
waveFile.Close();
}
private void AddWareForm_Shown(object sender, EventArgs e)
{
if (labelVideoFileName.Text.Length > 1 && File.Exists(labelVideoFileName.Text))
buttonRipWave_Click(null, null);
}
private void AddWareForm_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
_cancel = true;
}
}
}

123
src/Forms/AddWareForm.resx Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,243 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class AdjustDisplayDuration
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdjustDisplayDuration));
this.radioButtonPercent = new System.Windows.Forms.RadioButton();
this.radioButtonSeconds = new System.Windows.Forms.RadioButton();
this.groupBoxAdjustVia = new System.Windows.Forms.GroupBox();
this.comboBoxPercent = new System.Windows.Forms.ComboBox();
this.comboBoxSeconds = new System.Windows.Forms.ComboBox();
this.labelNote = new System.Windows.Forms.Label();
this.labelAddInPercent = new System.Windows.Forms.Label();
this.labelAddSeconds = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.groupBoxAdjustVia.SuspendLayout();
this.SuspendLayout();
//
// radioButtonPercent
//
this.radioButtonPercent.AutoSize = true;
this.radioButtonPercent.Location = new System.Drawing.Point(171, 22);
this.radioButtonPercent.Name = "radioButtonPercent";
this.radioButtonPercent.Size = new System.Drawing.Size(62, 17);
this.radioButtonPercent.TabIndex = 0;
this.radioButtonPercent.Text = "Percent";
this.radioButtonPercent.UseVisualStyleBackColor = true;
this.radioButtonPercent.CheckedChanged += new System.EventHandler(this.RadioButtonPercentCheckedChanged);
//
// radioButtonSeconds
//
this.radioButtonSeconds.AutoSize = true;
this.radioButtonSeconds.Checked = true;
this.radioButtonSeconds.Location = new System.Drawing.Point(11, 22);
this.radioButtonSeconds.Name = "radioButtonSeconds";
this.radioButtonSeconds.Size = new System.Drawing.Size(67, 17);
this.radioButtonSeconds.TabIndex = 1;
this.radioButtonSeconds.TabStop = true;
this.radioButtonSeconds.Text = "Seconds";
this.radioButtonSeconds.UseVisualStyleBackColor = true;
this.radioButtonSeconds.CheckedChanged += new System.EventHandler(this.RadioButtonSecondsCheckedChanged);
//
// groupBoxAdjustVia
//
this.groupBoxAdjustVia.Controls.Add(this.radioButtonPercent);
this.groupBoxAdjustVia.Controls.Add(this.radioButtonSeconds);
this.groupBoxAdjustVia.Location = new System.Drawing.Point(13, 13);
this.groupBoxAdjustVia.Name = "groupBoxAdjustVia";
this.groupBoxAdjustVia.Size = new System.Drawing.Size(351, 45);
this.groupBoxAdjustVia.TabIndex = 2;
this.groupBoxAdjustVia.TabStop = false;
this.groupBoxAdjustVia.Text = "Adjust via";
//
// comboBoxPercent
//
this.comboBoxPercent.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxPercent.Enabled = false;
this.comboBoxPercent.FormattingEnabled = true;
this.comboBoxPercent.Items.AddRange(new object[] {
"- Please choose -",
"90",
"91",
"92",
"93",
"94",
"95",
"96",
"97",
"98",
"99",
"101",
"102",
"103",
"104",
"105",
"106",
"107",
"108",
"109",
"110",
"111",
"112",
"113",
"114",
"115",
"116",
"117",
"118",
"119",
"120",
"121",
"122",
"123",
"124",
"125"});
this.comboBoxPercent.Location = new System.Drawing.Point(182, 85);
this.comboBoxPercent.Name = "comboBoxPercent";
this.comboBoxPercent.Size = new System.Drawing.Size(141, 21);
this.comboBoxPercent.TabIndex = 3;
//
// comboBoxSeconds
//
this.comboBoxSeconds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxSeconds.FormattingEnabled = true;
this.comboBoxSeconds.Items.AddRange(new object[] {
"- Please choose -",
"-0.5",
"-0.4",
"-0.3",
"-0.2",
"-0.1",
"+0.1",
"+0.2",
"+0.3",
"+0.4",
"+0.5",
"+0.6",
"+0.7",
"+0.8",
"+0.9",
"+1.0"});
this.comboBoxSeconds.Location = new System.Drawing.Point(13, 85);
this.comboBoxSeconds.Name = "comboBoxSeconds";
this.comboBoxSeconds.Size = new System.Drawing.Size(141, 21);
this.comboBoxSeconds.TabIndex = 4;
//
// labelNote
//
this.labelNote.AutoSize = true;
this.labelNote.Location = new System.Drawing.Point(10, 135);
this.labelNote.Name = "labelNote";
this.labelNote.Size = new System.Drawing.Size(265, 13);
this.labelNote.TabIndex = 5;
this.labelNote.Text = "Note: Display time will not overlap start time of next text";
//
// labelAddInPercent
//
this.labelAddInPercent.AutoSize = true;
this.labelAddInPercent.Location = new System.Drawing.Point(179, 69);
this.labelAddInPercent.Name = "labelAddInPercent";
this.labelAddInPercent.Size = new System.Drawing.Size(86, 13);
this.labelAddInPercent.TabIndex = 6;
this.labelAddInPercent.Text = "Adjust in percent";
//
// labelAddSeconds
//
this.labelAddSeconds.AutoSize = true;
this.labelAddSeconds.Location = new System.Drawing.Point(10, 69);
this.labelAddSeconds.Name = "labelAddSeconds";
this.labelAddSeconds.Size = new System.Drawing.Size(69, 13);
this.labelAddSeconds.TabIndex = 7;
this.labelAddSeconds.Text = "Add seconds";
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(294, 169);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 9;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(213, 169);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 8;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// AdjustDisplayDuration
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(381, 199);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelAddSeconds);
this.Controls.Add(this.labelAddInPercent);
this.Controls.Add(this.labelNote);
this.Controls.Add(this.comboBoxSeconds);
this.Controls.Add(this.comboBoxPercent);
this.Controls.Add(this.groupBoxAdjustVia);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AdjustDisplayDuration";
this.Text = "Adjust display time";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormAdjustDisplayTime_KeyDown);
this.groupBoxAdjustVia.ResumeLayout(false);
this.groupBoxAdjustVia.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RadioButton radioButtonPercent;
private System.Windows.Forms.RadioButton radioButtonSeconds;
private System.Windows.Forms.GroupBox groupBoxAdjustVia;
private System.Windows.Forms.ComboBox comboBoxPercent;
private System.Windows.Forms.ComboBox comboBoxSeconds;
private System.Windows.Forms.Label labelNote;
private System.Windows.Forms.Label labelAddInPercent;
private System.Windows.Forms.Label labelAddSeconds;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
}
}

View File

@ -0,0 +1,104 @@
using System;
using System.Globalization;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class AdjustDisplayDuration : Form
{
public string AdjustValue
{
get
{
if (radioButtonPercent.Checked)
return comboBoxPercent.Text;
return comboBoxSeconds.Text;
}
}
public bool AdjustUsingPercent
{
get
{
return radioButtonPercent.Checked;
}
}
public AdjustDisplayDuration()
{
InitializeComponent();
comboBoxPercent.SelectedIndex = 0;
comboBoxSeconds.SelectedIndex = 0;
for (int i=0; i<comboBoxSeconds.Items.Count; i++)
{
string s = comboBoxSeconds.Items[i].ToString();
s = s.Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
comboBoxSeconds.Items[i] = s;
}
LanguageStructure.AdjustDisplayDuration language = Configuration.Settings.Language.AdjustDisplayDuration;
Text = language.Title;
groupBoxAdjustVia.Text = language.AdjustVia;
radioButtonSeconds.Text = language.Seconds;
radioButtonPercent.Text = language.Percent;
labelAddSeconds.Text = language.AddSeconds;
labelAddInPercent.Text = language.SetAsPercent;
labelNote.Text = language.Note;
comboBoxSeconds.Items[0] = language.PleaseChoose;
comboBoxPercent.Items[0] = language.PleaseChoose;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void FormAdjustDisplayTime_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void RadioButtonPercentCheckedChanged(object sender, EventArgs e)
{
if (radioButtonPercent.Checked)
{
comboBoxPercent.Enabled = true;
}
else
{
comboBoxPercent.Enabled = false;
}
}
private void RadioButtonSecondsCheckedChanged(object sender, EventArgs e)
{
if (radioButtonSeconds.Checked)
{
comboBoxSeconds.Enabled = true;
}
else
{
comboBoxSeconds.Enabled = false;
}
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (radioButtonSeconds.Checked && comboBoxSeconds.SelectedIndex < 1)
{
MessageBox.Show(Configuration.Settings.Language.AdjustDisplayDuration.PleaseSelectAValueFromTheDropDownList);
comboBoxSeconds.Focus();
}
else if (radioButtonPercent.Checked && comboBoxPercent.SelectedIndex < 1)
{
MessageBox.Show(Configuration.Settings.Language.AdjustDisplayDuration.PleaseSelectAValueFromTheDropDownList);
comboBoxPercent.Focus();
}
else
{
DialogResult = DialogResult.OK;
}
}
}
}

View File

@ -0,0 +1,546 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAkAMDAQAAEABABoBgAAlgAAACAgEAABAAQA6AIAAP4GAAAQEBAAAQAEACgBAADmCQAAMDAAAAEA
CACoDgAADgsAACAgAAABAAgAqAgAALYZAAAQEAAAAQAIAGgFAABeIgAAMDAAAAEAIACoJQAAxicAACAg
AAABACAAqBAAAG5NAAAQEAAAAQAgAGgEAAAWXgAAKAAAADAAAABgAAAAAQAEAAAAAACABAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDAAAAA/wAA/wAAAP//AP8A
AAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAHd3AAAAAAAAAAAAAAAAAAAAAAAAAAAAB4d3d3d3cAAAAAAAAAAAAAAAAAAAAHd3d3d3iI
iIiHh4cAAAAAAAAAAAAAAAd3d3d3d3d4eIiIh4eHd4AAAAAAAAAAAHd3eHd3d3d3d3d3iIiIiHcAAAAA
AAAAB3d4iPiIiIeHd3d4d3eHh3cAAAAAAAAAB3eIiIiIiIiIiIh3eHd3d3d3cAAAAAAAd3iHd3eIiI+P
+PiIh4d3d3d3d3AAAAAHd3d3AHcHd3d4iIj4+I+IiHh3d3cAAAAHd3dwBwBwcHB3d4iIi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3l5ef9lZWX/SkpK/ycnJ/8xMTH/ODg4/zs7O/88PDz/PT09/z8/P/9BQUH/RERE/0ZG
Rv9HR0f/SUlJ/4eHh///////xMTE/1BQUP9QUFD/UVFR////////////UlJS/1JSUv9SUlL/UlJS/1JS
Uv9RUVH/UVFR/1FRUf9RUVH/UFBQ/1BQUP9LS0v/U1NT/2hoaP+tra3/srKy/3h4eP94eHj/b29v+V9f
X+8jIyN8BQUFQzQ0NE1hYWHDeHh4/3l5ef9lZWX/SUlJ/ycnJ/8xMTH/ODg4/zs7O/88PDz/PT09/z8/
P/9BQUH/RERE/8HBwf////////////////9MTEz/Tk5O/1BQUP9QUFD/UVFR////////////UlJS/1JS
Uv9SUlL/UlJS/1JSUv9RUVH/UVFR/1FRUf9RUVH/UFBQ/1BQUP9LS0v/U1NT/2hoaP+tra3/srKy/3h4
eP94eHj/cHBw+WBgYO8jIyN8BQUFQzU1NU5iYmLEeHh4/3l5ef9lZWX/SUlJ/yYmJv8xMTH/ODg4/zs7
O/9mZmb/fX19/39/f/+AgID/gYGB/8HBwf/BwcH/wsLC/8LCwv9MTEz/TU1N/09PT/9QUFD/UVFR////
////////i4uL/4uLi/+Li4v/i4uL/4uLi/+Li4v/i4uL/4uLi/9kZGT/UFBQ/09PT/9LS0v/U1NT/2ho
aP+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzc3N1BiYmLEeHh4/3l5ef9lZWX/SEhI/yUl
Jf8wMDD/Nzc3/zo6Ov++vr7//////////////////////8HBwf9HR0f/SEhI/0lJSf9LS0v/TU1N/05O
Tv9PT0//UFBQ//////////////////////////////////////////////////////+Kior/T09P/05O
Tv9KSkr/UlJS/2dnZ/+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzg4OFJiYmLFeHh4/3l5
ef9kZGT/SEhI/yQkJP8vLy//YmJi/729vf+9vb3/fX19/35+fv9/f3//gYGB/21tbf9GRkb/R0dH/0lJ
Sf9LS0v/TExM/05OTv9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+Pj7/Pz8//z8/P/8/Pz//QUFB/2FhYf+GhobxQUFBSYuL
ixSenp63sbGx+a2trf6tra3+rq6u/q6urv6urq7+ra2t/q2trf6srKz+q6ur/qqqqv6wsLDxeXl5kJCQ
kAUAAAAApKSkD5qaml+cnJyDmZmZhJmZmYSZmZmEmZmZhJmZmYSZmZmEmZmZhJqamoWlpaWEf39/SJKS
kgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAMAfAACABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAgAEAAP//AAA=
</value>
</data>
</root>

View File

@ -0,0 +1,175 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class AutoBreakUnbreakLines
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.comboBoxConditions = new System.Windows.Forms.ComboBox();
this.labelCondition = new System.Windows.Forms.Label();
this.groupBoxLinesFound.SuspendLayout();
this.SuspendLayout();
//
// listViewFixes
//
this.listViewFixes.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.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader7,
this.columnHeader8});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.Location = new System.Drawing.Point(6, 19);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(754, 324);
this.listViewFixes.TabIndex = 9;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 61;
//
// columnHeader7
//
this.columnHeader7.Text = "Before";
this.columnHeader7.Width = 292;
//
// columnHeader8
//
this.columnHeader8.Text = "After";
this.columnHeader8.Width = 292;
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.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.groupBoxLinesFound.Controls.Add(this.listViewFixes);
this.groupBoxLinesFound.Location = new System.Drawing.Point(2, 70);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(766, 349);
this.groupBoxLinesFound.TabIndex = 7;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Lines found: {0}";
//
// 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(606, 425);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 5;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// 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.Location = new System.Drawing.Point(687, 425);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// comboBoxConditions
//
this.comboBoxConditions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxConditions.FormattingEnabled = true;
this.comboBoxConditions.Location = new System.Drawing.Point(12, 29);
this.comboBoxConditions.Name = "comboBoxConditions";
this.comboBoxConditions.Size = new System.Drawing.Size(150, 21);
this.comboBoxConditions.TabIndex = 8;
this.comboBoxConditions.SelectedIndexChanged += new System.EventHandler(this.comboBoxConditions_SelectedIndexChanged);
//
// labelCondition
//
this.labelCondition.AutoSize = true;
this.labelCondition.Location = new System.Drawing.Point(13, 13);
this.labelCondition.Name = "labelCondition";
this.labelCondition.Size = new System.Drawing.Size(138, 13);
this.labelCondition.TabIndex = 9;
this.labelCondition.Text = "Only break lines longer than";
//
// AutoBreakUnbreakLines
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(774, 454);
this.Controls.Add(this.labelCondition);
this.Controls.Add(this.comboBoxConditions);
this.Controls.Add(this.groupBoxLinesFound);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(700, 350);
this.Name = "AutoBreakUnbreakLines";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "AutoBreakUnbreakLines";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AutoBreakUnbreakLines_KeyDown);
this.groupBoxLinesFound.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.ComboBox comboBoxConditions;
private System.Windows.Forms.Label labelCondition;
}
}

View File

@ -0,0 +1,161 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class AutoBreakUnbreakLines : Form
{
List<Paragraph> _paragraphs;
int _changes;
bool _modeAutoBalance = false;
public List<Paragraph> FixedParagraphs
{
get
{
return _paragraphs;
}
}
public AutoBreakUnbreakLines()
{
InitializeComponent();
groupBoxLinesFound.Text = string.Empty;
listViewFixes.Columns[2].Width = 290;
listViewFixes.Columns[3].Width = 290;
listViewFixes.Columns[0].Text = Configuration.Settings.Language.General.Apply;
listViewFixes.Columns[1].Text = Configuration.Settings.Language.AutoBreakUnbreakLines.LineNumber;
listViewFixes.Columns[2].Text = Configuration.Settings.Language.AutoBreakUnbreakLines.Before;
listViewFixes.Columns[3].Text = Configuration.Settings.Language.AutoBreakUnbreakLines.After;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public void Initialize(Subtitle subtitle, bool autoBalance)
{
_modeAutoBalance = autoBalance;
_paragraphs = new List<Paragraph>();
foreach (Paragraph p in subtitle.Paragraphs)
_paragraphs.Add(p);
if (autoBalance)
{
labelCondition.Text = Configuration.Settings.Language.AutoBreakUnbreakLines.OnlyBreakLinesLongerThan;
for (int i = 10; i < 61; i++)
comboBoxConditions.Items.Add(i.ToString());
comboBoxConditions.SelectedIndex = 32;
AutuBalance();
}
else
{
labelCondition.Text = Configuration.Settings.Language.AutoBreakUnbreakLines.OnlyUnbreakLinesShorterThan;
for (int i = 5; i < 51; i++)
comboBoxConditions.Items.Add(i.ToString());
comboBoxConditions.SelectedIndex = 5;
Unbreak();
}
}
private void AutuBalance()
{
int minLength = int.Parse(comboBoxConditions.Items[comboBoxConditions.SelectedIndex].ToString());
Text = Configuration.Settings.Language.AutoBreakUnbreakLines.TitleAutoBreak;
listViewFixes.BeginUpdate();
listViewFixes.Items.Clear();
foreach (Paragraph p in _paragraphs)
{
if (p.Text.Length > minLength || p.Text.Contains(Environment.NewLine))
{
string text = Utilities.AutoBreakLine(p.Text);
if (text != p.Text)
{
AddToListView(p, text);
_changes++;
}
}
}
listViewFixes.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.AutoBreakUnbreakLines.LinesFoundX, listViewFixes.Items.Count);
}
private void Unbreak()
{
int minLength = int.Parse(comboBoxConditions.Items[comboBoxConditions.SelectedIndex].ToString());
Text = Configuration.Settings.Language.AutoBreakUnbreakLines.TitleUnbreak;
listViewFixes.BeginUpdate();
listViewFixes.Items.Clear();
foreach (Paragraph p in _paragraphs)
{
if (p.Text != null && p.Text.Contains(Environment.NewLine) && p.Text.Length > minLength)
{
string text = p.Text.Replace(Environment.NewLine, " ");
while (text.Contains(" "))
text = text.Replace(" ", " ");
if (text != p.Text)
{
AddToListView(p, text);
_changes++;
}
}
}
listViewFixes.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.AutoBreakUnbreakLines.LinesFoundX, listViewFixes.Items.Count);
}
private void AutoBreakUnbreakLines_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void AddToListView(Paragraph p, string newText)
{
var item = new ListViewItem(string.Empty) {Tag = p, Checked = true};
var subItem = new ListViewItem.ListViewSubItem(item, p.Number.ToString());
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, p.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
private bool IsFixAllowed(Paragraph p)
{
foreach (ListViewItem item in listViewFixes.Items)
{
if (item.Tag.ToString() == p.ToString())
return item.Checked;
}
return false;
}
private void ButtonOkClick(object sender, EventArgs e)
{
for (int i = _paragraphs.Count - 1; i > 0; i--)
{
Paragraph p = _paragraphs[i];
if (!IsFixAllowed(p))
_paragraphs.Remove(p);
}
DialogResult = DialogResult.OK;
}
private void comboBoxConditions_SelectedIndexChanged(object sender, EventArgs e)
{
if (_modeAutoBalance)
AutuBalance();
else
Unbreak();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

177
src/Forms/ChangeCasing.Designer.cs generated Normal file
View File

@ -0,0 +1,177 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ChangeCasing
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.groupBoxChangeCasing = new System.Windows.Forms.GroupBox();
this.radioButtonFixOnlyNames = new System.Windows.Forms.RadioButton();
this.checkBoxFixNames = new System.Windows.Forms.CheckBox();
this.checkBoxOnlyAllUpper = new System.Windows.Forms.CheckBox();
this.radioButtonLowercase = new System.Windows.Forms.RadioButton();
this.radioButtonUppercase = new System.Windows.Forms.RadioButton();
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
this.groupBoxChangeCasing.SuspendLayout();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(291, 199);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 14;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(210, 199);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 12;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// groupBoxChangeCasing
//
this.groupBoxChangeCasing.Controls.Add(this.radioButtonFixOnlyNames);
this.groupBoxChangeCasing.Controls.Add(this.checkBoxFixNames);
this.groupBoxChangeCasing.Controls.Add(this.checkBoxOnlyAllUpper);
this.groupBoxChangeCasing.Controls.Add(this.radioButtonLowercase);
this.groupBoxChangeCasing.Controls.Add(this.radioButtonUppercase);
this.groupBoxChangeCasing.Controls.Add(this.radioButtonNormal);
this.groupBoxChangeCasing.Location = new System.Drawing.Point(12, 12);
this.groupBoxChangeCasing.Name = "groupBoxChangeCasing";
this.groupBoxChangeCasing.Size = new System.Drawing.Size(354, 172);
this.groupBoxChangeCasing.TabIndex = 12;
this.groupBoxChangeCasing.TabStop = false;
this.groupBoxChangeCasing.Text = "Change casing to";
//
// radioButtonFixOnlyNames
//
this.radioButtonFixOnlyNames.AutoSize = true;
this.radioButtonFixOnlyNames.Location = new System.Drawing.Point(11, 88);
this.radioButtonFixOnlyNames.Name = "radioButtonFixOnlyNames";
this.radioButtonFixOnlyNames.Size = new System.Drawing.Size(281, 17);
this.radioButtonFixOnlyNames.TabIndex = 6;
this.radioButtonFixOnlyNames.Text = "Fix only names casing (via Dictionaries\\NamesEtc.xml)";
this.radioButtonFixOnlyNames.UseVisualStyleBackColor = true;
//
// checkBoxFixNames
//
this.checkBoxFixNames.AutoSize = true;
this.checkBoxFixNames.Checked = true;
this.checkBoxFixNames.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxFixNames.Location = new System.Drawing.Point(23, 39);
this.checkBoxFixNames.Name = "checkBoxFixNames";
this.checkBoxFixNames.Size = new System.Drawing.Size(260, 17);
this.checkBoxFixNames.TabIndex = 2;
this.checkBoxFixNames.Text = "Fix names casing (via Dictionaries\\NamesEtc.xml)";
this.checkBoxFixNames.UseVisualStyleBackColor = true;
//
// checkBoxOnlyAllUpper
//
this.checkBoxOnlyAllUpper.AutoSize = true;
this.checkBoxOnlyAllUpper.Location = new System.Drawing.Point(23, 62);
this.checkBoxOnlyAllUpper.Name = "checkBoxOnlyAllUpper";
this.checkBoxOnlyAllUpper.Size = new System.Drawing.Size(182, 17);
this.checkBoxOnlyAllUpper.TabIndex = 4;
this.checkBoxOnlyAllUpper.Text = "Only change all upper case lines.";
this.checkBoxOnlyAllUpper.UseVisualStyleBackColor = true;
//
// radioButtonLowercase
//
this.radioButtonLowercase.AutoSize = true;
this.radioButtonLowercase.Location = new System.Drawing.Point(11, 142);
this.radioButtonLowercase.Name = "radioButtonLowercase";
this.radioButtonLowercase.Size = new System.Drawing.Size(86, 17);
this.radioButtonLowercase.TabIndex = 10;
this.radioButtonLowercase.Text = "all lowercase";
this.radioButtonLowercase.UseVisualStyleBackColor = true;
//
// radioButtonUppercase
//
this.radioButtonUppercase.AutoSize = true;
this.radioButtonUppercase.Location = new System.Drawing.Point(11, 116);
this.radioButtonUppercase.Name = "radioButtonUppercase";
this.radioButtonUppercase.Size = new System.Drawing.Size(112, 17);
this.radioButtonUppercase.TabIndex = 8;
this.radioButtonUppercase.Text = "ALL UPPERCASE";
this.radioButtonUppercase.UseVisualStyleBackColor = true;
//
// radioButtonNormal
//
this.radioButtonNormal.AutoSize = true;
this.radioButtonNormal.Checked = true;
this.radioButtonNormal.Location = new System.Drawing.Point(11, 18);
this.radioButtonNormal.Name = "radioButtonNormal";
this.radioButtonNormal.Size = new System.Drawing.Size(282, 17);
this.radioButtonNormal.TabIndex = 0;
this.radioButtonNormal.TabStop = true;
this.radioButtonNormal.Text = "Normal casing. Sentences begin with uppercase letter.";
this.radioButtonNormal.UseVisualStyleBackColor = true;
//
// ChangeCasing
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(378, 228);
this.Controls.Add(this.groupBoxChangeCasing);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChangeCasing";
this.Text = "Change casing";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormChangeCasing_KeyDown);
this.groupBoxChangeCasing.ResumeLayout(false);
this.groupBoxChangeCasing.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.GroupBox groupBoxChangeCasing;
private System.Windows.Forms.RadioButton radioButtonUppercase;
private System.Windows.Forms.RadioButton radioButtonNormal;
private System.Windows.Forms.RadioButton radioButtonLowercase;
private System.Windows.Forms.CheckBox checkBoxOnlyAllUpper;
private System.Windows.Forms.CheckBox checkBoxFixNames;
private System.Windows.Forms.RadioButton radioButtonFixOnlyNames;
}
}

138
src/Forms/ChangeCasing.cs Normal file
View File

@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Text.RegularExpressions;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ChangeCasing : Form
{
private int _noOfLinesChanged;
public ChangeCasing()
{
InitializeComponent();
LanguageStructure.ChangeCasing language = Configuration.Settings.Language.ChangeCasing;
Text = language.Title;
groupBoxChangeCasing.Text = language.ChangeCasingTo;
radioButtonNormal.Text = language.NormalCasing;
checkBoxFixNames.Text = language.FixNamesCasing;
radioButtonFixOnlyNames.Text = language.FixOnlyNamesCasing;
checkBoxOnlyAllUpper.Text = language.OnlyChangeAllUppercaseLines;
radioButtonUppercase.Text = language.AllUppercase;
radioButtonLowercase.Text = language.AllLowercase;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public int LinesChanged
{
get
{
return _noOfLinesChanged;
}
}
public bool ChangeNamesToo
{
get
{
return radioButtonFixOnlyNames.Checked ||
(radioButtonNormal.Checked && checkBoxFixNames.Checked);
}
}
internal void FixCasing(Subtitle subtitle, string language)
{
var namesEtc = new List<string>();
var tmp = new List<string>();
Utilities.LoadNamesEtcWordLists(tmp, tmp, Utilities.AutoDetectGoogleLanguage(subtitle));
foreach (var s in tmp)
{
if (s.Contains("."))
namesEtc.Add(s);
}
// Longer names must be first
namesEtc.Sort((s1, s2) => s2.Length.CompareTo(s1.Length));
var aloneI = new Regex(@"\bi\b", RegexOptions.Compiled);
string lastLine = string.Empty;
foreach (Paragraph p in subtitle.Paragraphs)
{
p.Text = FixCasing(p.Text, lastLine, namesEtc);
// fix casing of English alone i to I
if (radioButtonNormal.Checked && language == "en" && p.Text.Contains("i"))
{
Match match = aloneI.Match(p.Text);
while (match.Success)
{
if (p.Text[match.Index] == 'i')
{
string prev = string.Empty;
string next = string.Empty;
if (match.Index > 0)
prev = p.Text[match.Index - 1].ToString();
if (match.Index + 1 < p.Text.Length)
next = p.Text[match.Index + 1].ToString();
if (prev != ">" && next != ">")
{
string oldText = p.Text;
p.Text = p.Text.Substring(0, match.Index) + "I";
if (match.Index + 1 < oldText.Length)
p.Text += oldText.Substring(match.Index + 1);
}
}
match = match.NextMatch();
}
}
lastLine = p.Text;
}
}
private string FixCasing(string text, string lastLine, List<string> namesEtc)
{
string original = text;
if (radioButtonNormal.Checked)
{
if (checkBoxOnlyAllUpper.Checked && text != text.ToUpper())
return text;
if (text.Length > 1)
{
// first all to lower
text = text.ToLower().Trim();
while (text.Contains(" "))
text = text.Replace(" ", " ");
text = text.Replace(" " + Environment.NewLine, Environment.NewLine);
text = text.Replace(Environment.NewLine + " ", Environment.NewLine);
var st = new StripableText(text);
st.FixCasing(namesEtc, false, true, true, lastLine); // fix all casing but names (that's a seperate option)
text = st.MergedString;
}
}
else if (radioButtonUppercase.Checked)
{
text = text.ToUpper();
}
else if (radioButtonLowercase.Checked)
{
text = text.ToLower();
}
if (original != text)
_noOfLinesChanged++;
return text;
}
private void FormChangeCasing_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
}
}

120
src/Forms/ChangeCasing.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

201
src/Forms/ChangeCasingNames.Designer.cs generated Normal file
View File

@ -0,0 +1,201 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class ChangeCasingNames
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.groupBoxNames = new System.Windows.Forms.GroupBox();
this.listViewNames = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBoxNames.SuspendLayout();
this.groupBoxLinesFound.SuspendLayout();
this.SuspendLayout();
//
// 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(570, 559);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 14;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// 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.Location = new System.Drawing.Point(651, 559);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 15;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// groupBoxNames
//
this.groupBoxNames.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxNames.Controls.Add(this.listViewNames);
this.groupBoxNames.Location = new System.Drawing.Point(5, 9);
this.groupBoxNames.Name = "groupBoxNames";
this.groupBoxNames.Size = new System.Drawing.Size(726, 268);
this.groupBoxNames.TabIndex = 12;
this.groupBoxNames.TabStop = false;
this.groupBoxNames.Text = "Names found in subtitle";
//
// listViewNames
//
this.listViewNames.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewNames.CheckBoxes = true;
this.listViewNames.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listViewNames.FullRowSelect = true;
this.listViewNames.HideSelection = false;
this.listViewNames.Location = new System.Drawing.Point(6, 19);
this.listViewNames.MultiSelect = false;
this.listViewNames.Name = "listViewNames";
this.listViewNames.Size = new System.Drawing.Size(714, 243);
this.listViewNames.TabIndex = 7;
this.listViewNames.UseCompatibleStateImageBehavior = false;
this.listViewNames.View = System.Windows.Forms.View.Details;
this.listViewNames.SelectedIndexChanged += new System.EventHandler(this.ListViewNamesSelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "Enabled";
this.columnHeader1.Width = 70;
//
// columnHeader2
//
this.columnHeader2.Text = "Name";
this.columnHeader2.Width = 620;
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.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.groupBoxLinesFound.Controls.Add(this.listViewFixes);
this.groupBoxLinesFound.Location = new System.Drawing.Point(5, 283);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(726, 268);
this.groupBoxLinesFound.TabIndex = 13;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Lines found: {0}";
//
// listViewFixes
//
this.listViewFixes.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.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader7,
this.columnHeader8});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.HideSelection = false;
this.listViewFixes.Location = new System.Drawing.Point(6, 13);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(714, 249);
this.listViewFixes.TabIndex = 9;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 61;
//
// columnHeader7
//
this.columnHeader7.Text = "Before";
this.columnHeader7.Width = 292;
//
// columnHeader8
//
this.columnHeader8.Text = "After";
this.columnHeader8.Width = 292;
//
// ChangeCasingNames
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(736, 589);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.groupBoxNames);
this.Controls.Add(this.groupBoxLinesFound);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChangeCasingNames";
this.ShowIcon = false;
this.Text = "Change casing - Names";
this.Shown += new System.EventHandler(this.ChangeCasingNames_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ChangeCasingNames_KeyDown);
this.groupBoxNames.ResumeLayout(false);
this.groupBoxLinesFound.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.GroupBox groupBoxNames;
private System.Windows.Forms.ListView listViewNames;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
}
}

View File

@ -0,0 +1,233 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class ChangeCasingNames : Form
{
readonly List<string> _usedNames = new List<string>();
Subtitle _subtitle;
int _noOfLinesChanged;
public ChangeCasingNames()
{
InitializeComponent();
groupBoxNames.Text = string.Empty;
listViewNames.Columns[0].Text = Configuration.Settings.Language.ChangeCasingNames.Enabled;
listViewNames.Columns[1].Text = Configuration.Settings.Language.ChangeCasingNames.Name;
groupBoxLinesFound.Text = string.Empty;
listViewFixes.Columns[0].Text = Configuration.Settings.Language.General.Apply;
listViewFixes.Columns[1].Text = Configuration.Settings.Language.ChangeCasingNames.LineNumber;
listViewFixes.Columns[2].Text = Configuration.Settings.Language.ChangeCasingNames.Before;
listViewFixes.Columns[3].Text = Configuration.Settings.Language.ChangeCasingNames.After;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void ChangeCasingNames_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void AddToListViewNames(string name)
{
var item = new ListViewItem(string.Empty) {Checked = true};
var subItem = new ListViewItem.ListViewSubItem(item, name);
item.SubItems.Add(subItem);
listViewNames.Items.Add(item);
}
public void Initialize(Subtitle subtitle)
{
_subtitle = subtitle;
FindAllNames();
GeneratePreview();
}
private void GeneratePreview()
{
Cursor = Cursors.WaitCursor;
listViewFixes.BeginUpdate();
listViewFixes.Items.Clear();
foreach (Paragraph p in _subtitle.Paragraphs)
{
string text = p.Text;
foreach (ListViewItem item in listViewNames.Items)
{
string name = item.SubItems[1].Text;
if (item.Checked && text != null && text.ToLower().Contains(name.ToLower()) && name.Length > 2 && name != name.ToLower())
{
var st = new StripableText(text);
st.FixCasing(new List<string> {name}, true, false, false, string.Empty);
text = st.MergedString;
}
}
if (text != p.Text)
AddToPreviewListView(p, text);
}
listViewFixes.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.ChangeCasingNames.LinesFoundX, listViewFixes.Items.Count);
Cursor = Cursors.Default;
}
private void AddToPreviewListView(Paragraph p, string newText)
{
var item = new ListViewItem(string.Empty) {Tag = p, Checked = true};
var subItem = new ListViewItem.ListViewSubItem(item, p.Number.ToString());
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, p.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
private void FindAllNames()
{
var namesEtcList = new List<string>();
// Will contains both one word names and multi names
string languageCode = Utilities.AutoDetectGoogleLanguage(_subtitle);
Utilities.LoadNamesEtcWordLists(namesEtcList, namesEtcList, languageCode);
if (languageCode == "en")
{
if (namesEtcList.Contains("Black"))
namesEtcList.Remove("Black");
if (namesEtcList.Contains("Bill"))
namesEtcList.Remove("Bill");
if (namesEtcList.Contains("Long"))
namesEtcList.Remove("Long");
if (namesEtcList.Contains("Don"))
namesEtcList.Remove("Don");
}
var sb = new StringBuilder();
foreach (Paragraph p in _subtitle.Paragraphs)
sb.AppendLine(p.Text);
string text = Utilities.RemoveHtmlTags(sb.ToString());
string textToLower = text.ToLower();
foreach (string name in namesEtcList)
{
int startIndex = textToLower.IndexOf(name.ToLower());
while (startIndex >= 0 && startIndex < text.Length &&
textToLower.Substring(startIndex).Contains(name.ToLower()) && name.Length > 2 && name != name.ToLower())
{
bool startOk = (startIndex == 0) || (text[startIndex - 1] == ' ') || (text[startIndex - 1] == '-') ||
(text[startIndex - 1] == '"') || (text[startIndex - 1] == '\'') || (text[startIndex - 1] == '>') ||
(Environment.NewLine.EndsWith(text[startIndex - 1].ToString()));
if (startOk)
{
int end = startIndex + name.Length;
bool endOk = end <= text.Length;
if (endOk)
endOk = (end == text.Length) || ((" ,.!?:;')-<\"" + Environment.NewLine).Contains(text[end].ToString()));
if (endOk && text.Substring(startIndex, name.Length) != name) // do not add names where casing already is correct
{
if (!_usedNames.Contains(name))
{
_usedNames.Add(name);
AddToListViewNames(name);
break; // break while
}
}
}
startIndex = textToLower.IndexOf(name.ToLower(), startIndex + 2);
}
}
groupBoxNames.Text = string.Format(Configuration.Settings.Language.ChangeCasingNames.NamesFoundInSubtitleX, listViewNames.Items.Count);
}
private void ListViewNamesSelectedIndexChanged(object sender, EventArgs e)
{
if (listViewNames.SelectedItems.Count != 1)
return;
string name = listViewNames.SelectedItems[0].SubItems[1].Text;
listViewFixes.BeginUpdate();
foreach (ListViewItem item in listViewFixes.Items)
{
item.Selected = false;
string text = item.SubItems[2].Text.Replace(Configuration.Settings.General.ListViewLineSeparatorString, Environment.NewLine);
string lower = text.ToLower();
if (lower.Contains(name.ToLower()) && name.Length > 2 && name != name.ToLower())
{
int start = lower.IndexOf(name.ToLower());
if (start >= 0)
{
bool startOk = (start == 0) || (lower[start - 1] == ' ') || (lower[start - 1] == '-') || (lower[start - 1] == '"') ||
(lower[start - 1] == '\'') || (lower[start - 1] == '>') || (Environment.NewLine.EndsWith(lower[start - 1].ToString()));
if (startOk)
{
int end = start + name.Length;
bool endOk = end <= lower.Length;
if (endOk)
endOk = end == lower.Length || (" ,.!?:;')<-\"" + Environment.NewLine).Contains(lower[end].ToString());
item.Selected = endOk;
}
}
}
}
listViewFixes.EndUpdate();
if (listViewFixes.SelectedItems.Count > 0)
listViewFixes.EnsureVisible(listViewFixes.SelectedItems[0].Index);
}
private void ListViewNamesItemChecked(object sender, ItemCheckedEventArgs e)
{
GeneratePreview();
}
private void ChangeCasingNames_Shown(object sender, EventArgs e)
{
listViewNames.ItemChecked += ListViewNamesItemChecked;
}
internal void FixCasing()
{
foreach (ListViewItem item in listViewFixes.Items)
{
if (item.Checked)
{
_noOfLinesChanged++;
var p = item.Tag as Paragraph;
if (p != null)
p.Text = item.SubItems[3].Text.Replace(Configuration.Settings.General.ListViewLineSeparatorString, Environment.NewLine);
}
}
}
public int LinesChanged
{
get
{
return _noOfLinesChanged;
}
}
private void ButtonOkClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

172
src/Forms/ChangeFrameRate.Designer.cs generated Normal file
View File

@ -0,0 +1,172 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ChangeFrameRate
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.labelInfo = new System.Windows.Forms.Label();
this.comboBoxFrameRateFrom = new System.Windows.Forms.ComboBox();
this.labelFromFrameRate = new System.Windows.Forms.Label();
this.comboBoxFrameRateTo = new System.Windows.Forms.ComboBox();
this.labelToFrameRate = new System.Windows.Forms.Label();
this.buttonGetFrameRateFrom = new System.Windows.Forms.Button();
this.buttonGetFrameRateTo = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(195, 115);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(114, 115);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 4;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// labelInfo
//
this.labelInfo.AutoSize = true;
this.labelInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.labelInfo.Location = new System.Drawing.Point(37, 9);
this.labelInfo.Name = "labelInfo";
this.labelInfo.Size = new System.Drawing.Size(142, 13);
this.labelInfo.TabIndex = 3;
this.labelInfo.Text = "Convert frame rate of subtitle";
//
// comboBoxFrameRateFrom
//
this.comboBoxFrameRateFrom.FormattingEnabled = true;
this.comboBoxFrameRateFrom.Location = new System.Drawing.Point(119, 46);
this.comboBoxFrameRateFrom.Name = "comboBoxFrameRateFrom";
this.comboBoxFrameRateFrom.Size = new System.Drawing.Size(121, 21);
this.comboBoxFrameRateFrom.TabIndex = 7;
//
// labelFromFrameRate
//
this.labelFromFrameRate.Location = new System.Drawing.Point(4, 49);
this.labelFromFrameRate.Name = "labelFromFrameRate";
this.labelFromFrameRate.Size = new System.Drawing.Size(112, 13);
this.labelFromFrameRate.TabIndex = 6;
this.labelFromFrameRate.Text = "From frame rate";
this.labelFromFrameRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// comboBoxFrameRateTo
//
this.comboBoxFrameRateTo.FormattingEnabled = true;
this.comboBoxFrameRateTo.Location = new System.Drawing.Point(119, 74);
this.comboBoxFrameRateTo.Name = "comboBoxFrameRateTo";
this.comboBoxFrameRateTo.Size = new System.Drawing.Size(121, 21);
this.comboBoxFrameRateTo.TabIndex = 9;
//
// labelToFrameRate
//
this.labelToFrameRate.Location = new System.Drawing.Point(4, 77);
this.labelToFrameRate.Name = "labelToFrameRate";
this.labelToFrameRate.Size = new System.Drawing.Size(109, 13);
this.labelToFrameRate.TabIndex = 8;
this.labelToFrameRate.Text = "To frame rate";
this.labelToFrameRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// buttonGetFrameRateFrom
//
this.buttonGetFrameRateFrom.Location = new System.Drawing.Point(246, 46);
this.buttonGetFrameRateFrom.Name = "buttonGetFrameRateFrom";
this.buttonGetFrameRateFrom.Size = new System.Drawing.Size(24, 22);
this.buttonGetFrameRateFrom.TabIndex = 10;
this.buttonGetFrameRateFrom.Text = "...";
this.buttonGetFrameRateFrom.UseVisualStyleBackColor = true;
this.buttonGetFrameRateFrom.Click += new System.EventHandler(this.ButtonGetFrameRateFromClick);
//
// buttonGetFrameRateTo
//
this.buttonGetFrameRateTo.Location = new System.Drawing.Point(246, 72);
this.buttonGetFrameRateTo.Name = "buttonGetFrameRateTo";
this.buttonGetFrameRateTo.Size = new System.Drawing.Size(24, 22);
this.buttonGetFrameRateTo.TabIndex = 11;
this.buttonGetFrameRateTo.Text = "...";
this.buttonGetFrameRateTo.UseVisualStyleBackColor = true;
this.buttonGetFrameRateTo.Click += new System.EventHandler(this.ButtonGetFrameRateToClick);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// ChangeFrameRate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(295, 148);
this.Controls.Add(this.buttonGetFrameRateTo);
this.Controls.Add(this.buttonGetFrameRateFrom);
this.Controls.Add(this.comboBoxFrameRateTo);
this.Controls.Add(this.labelToFrameRate);
this.Controls.Add(this.comboBoxFrameRateFrom);
this.Controls.Add(this.labelFromFrameRate);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelInfo);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChangeFrameRate";
this.Text = "Change frame rate";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormChangeFrameRate_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Label labelInfo;
private System.Windows.Forms.ComboBox comboBoxFrameRateFrom;
private System.Windows.Forms.Label labelFromFrameRate;
private System.Windows.Forms.ComboBox comboBoxFrameRateTo;
private System.Windows.Forms.Label labelToFrameRate;
private System.Windows.Forms.Button buttonGetFrameRateFrom;
private System.Windows.Forms.Button buttonGetFrameRateTo;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}

View File

@ -0,0 +1,105 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ChangeFrameRate : Form
{
public ChangeFrameRate()
{
InitializeComponent();
comboBoxFrameRateFrom.Items.Add((23.976).ToString());
comboBoxFrameRateFrom.Items.Add((24.0).ToString());
comboBoxFrameRateFrom.Items.Add((25.0).ToString());
comboBoxFrameRateFrom.Items.Add((29.97).ToString());
comboBoxFrameRateTo.Items.Add((23.976).ToString());
comboBoxFrameRateTo.Items.Add((24.0).ToString());
comboBoxFrameRateTo.Items.Add((25.0).ToString());
comboBoxFrameRateTo.Items.Add((29.97).ToString());
LanguageStructure.ChangeFrameRate language = Configuration.Settings.Language.ChangeFrameRate;
Text = language.Title;
labelInfo.Text = language.ConvertFrameRateOfSubtitle;
labelFromFrameRate.Text = language.FromFrameRate;
labelToFrameRate.Text = language.ToFrameRate;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void FormChangeFrameRate_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
public void Initialize(string fromFrameRate)
{
comboBoxFrameRateFrom.Text = fromFrameRate;
}
private string GetFrameRateFromVideoFile(string oldFrameRate)
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFile;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
VideoInfo info = Utilities.GetVideoInfo(openFileDialog1.FileName, delegate { Application.DoEvents(); });
if (info != null && info.Success)
{
return info.FramesPerSecond.ToString();
}
}
return oldFrameRate;
}
private void ButtonGetFrameRateFromClick(object sender, EventArgs e)
{
comboBoxFrameRateFrom.Text = GetFrameRateFromVideoFile(comboBoxFrameRateFrom.Text);
}
private void ButtonGetFrameRateToClick(object sender, EventArgs e)
{
comboBoxFrameRateTo.Text = GetFrameRateFromVideoFile(comboBoxFrameRateTo.Text);
}
private void ButtonOkClick(object sender, EventArgs e)
{
double d;
if (double.TryParse(comboBoxFrameRateFrom.Text, out d) &&
double.TryParse(comboBoxFrameRateTo.Text, out d))
{
DialogResult = DialogResult.OK;
}
else if (comboBoxFrameRateFrom.Text.Trim() == comboBoxFrameRateTo.Text.Trim())
{
MessageBox.Show("Frame rate is the same - nothing to convert");
}
else
{
MessageBox.Show("Frame rate not entered correctly");
}
}
public double OldFrameRate
{
get
{
return double.Parse(comboBoxFrameRateFrom.Text);
}
}
public double NewFrameRate
{
get
{
return double.Parse(comboBoxFrameRateTo.Text);
}
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

153
src/Forms/ChooseEncoding.Designer.cs generated Normal file
View File

@ -0,0 +1,153 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ChooseEncoding
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.textBoxPreview = new System.Windows.Forms.TextBox();
this.LabelPreview = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// 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.Location = new System.Drawing.Point(542, 473);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 7;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// 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(461, 473);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 6;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// listView1
//
this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3});
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.HideSelection = false;
this.listView1.Location = new System.Drawing.Point(12, 12);
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(605, 254);
this.listView1.TabIndex = 8;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick);
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "Codepage";
this.columnHeader1.Width = 75;
//
// columnHeader2
//
this.columnHeader2.Text = "Name";
this.columnHeader2.Width = 124;
//
// columnHeader3
//
this.columnHeader3.Text = "DisplayName";
this.columnHeader3.Width = 384;
//
// textBoxPreview
//
this.textBoxPreview.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.textBoxPreview.Location = new System.Drawing.Point(13, 301);
this.textBoxPreview.Multiline = true;
this.textBoxPreview.Name = "textBoxPreview";
this.textBoxPreview.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBoxPreview.Size = new System.Drawing.Size(604, 156);
this.textBoxPreview.TabIndex = 9;
//
// LabelPreview
//
this.LabelPreview.AutoSize = true;
this.LabelPreview.Location = new System.Drawing.Point(12, 285);
this.LabelPreview.Name = "LabelPreview";
this.LabelPreview.Size = new System.Drawing.Size(45, 13);
this.LabelPreview.TabIndex = 10;
this.LabelPreview.Text = "Preview";
//
// ChooseEncoding
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(629, 503);
this.Controls.Add(this.LabelPreview);
this.Controls.Add(this.textBoxPreview);
this.Controls.Add(this.listView1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.KeyPreview = true;
this.MinimizeBox = false;
this.Name = "ChooseEncoding";
this.ShowIcon = false;
this.Text = "Choose encoding";
this.Load += new System.EventHandler(this.ChooseEncoding_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormChooseEncoding_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.TextBox textBoxPreview;
private System.Windows.Forms.Label LabelPreview;
}
}

153
src/Forms/ChooseEncoding.cs Normal file
View File

@ -0,0 +1,153 @@
using System;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.IO;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ChooseEncoding : Form
{
class ListViewSorter : System.Collections.IComparer
{
public int Compare(object o1, object o2)
{
var lvi1 = o1 as ListViewItem;
var lvi2 = o2 as ListViewItem;
if (lvi1 == null || lvi2 == null)
return 0;
if (Descending)
{
ListViewItem temp = lvi1;
lvi1 = lvi2;
lvi2 = temp;
}
if (IsNumber)
{
int i1 = int.Parse(lvi1.SubItems[ColumnNumber].Text);
int i2 = int.Parse(lvi2.SubItems[ColumnNumber].Text);
if (i1 > i2)
return 1;
if (i1 == i2)
return 0;
return -1;
}
return string.Compare(lvi2.SubItems[ColumnNumber].Text, lvi1.SubItems[ColumnNumber].Text);
}
public int ColumnNumber { get; set; }
public bool IsNumber { get; set; }
public bool Descending { get; set; }
}
private Encoding _encoding;
private byte[] _fileBuffer;
public ChooseEncoding()
{
InitializeComponent();
LanguageStructure.ChooseEncoding language = Configuration.Settings.Language.ChooseEncoding;
Text = language.Title;
LabelPreview.Text = Configuration.Settings.Language.General.Preview;
listView1.Columns[0].Text = language.CodePage;
listView1.Columns[1].Text = Configuration.Settings.Language.General.Name;
listView1.Columns[2].Text = language.DisplayName;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public void Initialize(string fileName)
{
try
{
var file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
int length = (int)file.Length;
if (length > 100000)
length = 100000;
file.Position = 0;
_fileBuffer = new byte[length];
file.Read(_fileBuffer, 0, length);
file.Close();
file.Dispose();
}
catch
{
_fileBuffer = new byte[0];
}
Encoding encoding = Utilities.DetectAnsiEncoding(_fileBuffer);
foreach (EncodingInfo ei in Encoding.GetEncodings())
{
var item = new ListViewItem(new[] { ei.CodePage.ToString(), ei.Name, ei.DisplayName });
listView1.Items.Add(item);
if (ei.CodePage == encoding.CodePage)
item.Selected = true;
}
listView1.ListViewItemSorter = new ListViewSorter { ColumnNumber = 0, IsNumber = true };
}
private void FormChooseEncoding_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
internal Encoding GetEncoding()
{
return _encoding;
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count == 0)
MessageBox.Show(Configuration.Settings.Language.ChooseEncoding.PleaseSelectAnEncoding);
else
{
_encoding = Encoding.GetEncoding(int.Parse(listView1.SelectedItems[0].Text));
DialogResult = DialogResult.OK;
}
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
Encoding encoding = Encoding.GetEncoding(int.Parse(listView1.SelectedItems[0].Text));
textBoxPreview.Text = encoding.GetString(_fileBuffer);
LabelPreview.Text = Configuration.Settings.Language.General.Preview + " - " + encoding.EncodingName;
}
}
private void ChooseEncoding_Load(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count >= 1)
listView1.EnsureVisible(listView1.SelectedItems[0].Index);
}
private void listView1_ColumnClick(object sender, ColumnClickEventArgs e)
{
ListViewSorter sorter = (ListViewSorter)listView1.ListViewItemSorter;
if (e.Column == sorter.ColumnNumber)
{
sorter.Descending = !sorter.Descending; // inverse sort direction
}
else
{
sorter.ColumnNumber = e.Column;
sorter.Descending = false;
sorter.IsNumber = e.Column == 0; // only index 1 is numeric
}
listView1.Sort();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

106
src/Forms/ChooseLanguage.Designer.cs generated Normal file
View File

@ -0,0 +1,106 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ChooseLanguage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.labelLanguage = new System.Windows.Forms.Label();
this.comboBoxLanguages = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(203, 72);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 2;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(122, 72);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 1;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// labelLanguage
//
this.labelLanguage.AutoSize = true;
this.labelLanguage.Location = new System.Drawing.Point(12, 15);
this.labelLanguage.Name = "labelLanguage";
this.labelLanguage.Size = new System.Drawing.Size(55, 13);
this.labelLanguage.TabIndex = 15;
this.labelLanguage.Text = "Language";
//
// comboBoxLanguages
//
this.comboBoxLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxLanguages.FormattingEnabled = true;
this.comboBoxLanguages.Location = new System.Drawing.Point(12, 31);
this.comboBoxLanguages.Name = "comboBoxLanguages";
this.comboBoxLanguages.Size = new System.Drawing.Size(266, 21);
this.comboBoxLanguages.TabIndex = 0;
//
// ChooseLanguage
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(290, 105);
this.Controls.Add(this.labelLanguage);
this.Controls.Add(this.comboBoxLanguages);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ChooseLanguage";
this.Text = "Choose language";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ChangeLanguage_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Label labelLanguage;
private System.Windows.Forms.ComboBox comboBoxLanguages;
}
}

117
src/Forms/ChooseLanguage.cs Normal file
View File

@ -0,0 +1,117 @@
using System;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ChooseLanguage : Form
{
private const string CustomLanguageFileName = "Language.xml";
public class CultureListItem
{
CultureInfo _cultureInfo;
public CultureListItem(CultureInfo cultureInfo)
{
_cultureInfo = cultureInfo;
}
public override string ToString()
{
return _cultureInfo.NativeName;
}
public string Name
{
get { return _cultureInfo.Name; }
}
}
public string CultureName
{
get
{
int index = comboBoxLanguages.SelectedIndex;
if (index == -1)
return "en-US";
else if (comboBoxLanguages.Items[index].ToString() == CustomLanguageFileName)
return CustomLanguageFileName;
else
return (comboBoxLanguages.Items[index] as CultureListItem).Name;
}
}
public ChooseLanguage()
{
InitializeComponent();
List<string> list = new List<string>();
foreach (string name in System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames())
{
string prefix = "Nikse.SubtitleEdit.Resources.";
string postfix = ".xml.zip";
if (name.StartsWith(prefix) && name.EndsWith(postfix))
{
string cultureName = name.Substring(prefix.Length, name.Length - prefix.Length - postfix.Length);
list.Add(cultureName);
}
}
list.Sort();
comboBoxLanguages.Items.Add(new CultureListItem(CultureInfo.CreateSpecificCulture("en-US")));
foreach (string cultureName in list)
{
try
{
comboBoxLanguages.Items.Add(new CultureListItem(CultureInfo.CreateSpecificCulture(cultureName)));
}
catch (ArgumentException)
{
System.Diagnostics.Debug.WriteLine(cultureName + " is not a valid culture");
}
}
int index = 0;
for (int i=0; i< comboBoxLanguages.Items.Count; i++)
{
var item = (CultureListItem)comboBoxLanguages.Items[i];
if (item.Name == Configuration.Settings.Language.General.CultureName)
index = i;
}
comboBoxLanguages.SelectedIndex = index;
string customLanguageFile = Path.Combine(Configuration.BaseDirectory, CustomLanguageFileName);
if (File.Exists(customLanguageFile))
{
comboBoxLanguages.Items.Add(CustomLanguageFileName);
}
Text = Configuration.Settings.Language.ChooseLanguage.Title;
labelLanguage.Text = Configuration.Settings.Language.ChooseLanguage.Language;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void ChangeLanguage_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.L)
{
Configuration.Settings.Language.Save();
Configuration.Settings.Language.SaveAndCompress();
}
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.C)
CompareTags();
}
private static void CompareTags()
{
Configuration.Settings.Language.CompareWithEnglish();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

271
src/Forms/Compare.Designer.cs generated Normal file
View File

@ -0,0 +1,271 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class Compare
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.buttonOK = new System.Windows.Forms.Button();
this.labelSubtitle2 = new System.Windows.Forms.Label();
this.labelSubtitle1 = new System.Windows.Forms.Label();
this.buttonOpenSubtitle1 = new System.Windows.Forms.Button();
this.buttonOpenSubtitle2 = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.buttonNextDifference = new System.Windows.Forms.Button();
this.buttonPreviousDifference = new System.Windows.Forms.Button();
this.labelStatus = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.checkBoxShowOnlyDifferences = new System.Windows.Forms.CheckBox();
this.checkBoxOnlyListDifferencesInText = new System.Windows.Forms.CheckBox();
this.subtitleListView2 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.SuspendLayout();
//
// 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(884, 539);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(84, 21);
this.buttonOK.TabIndex = 12;
this.buttonOK.Text = "&Close";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// labelSubtitle2
//
this.labelSubtitle2.AutoSize = true;
this.labelSubtitle2.Location = new System.Drawing.Point(492, 32);
this.labelSubtitle2.Name = "labelSubtitle2";
this.labelSubtitle2.Size = new System.Drawing.Size(30, 13);
this.labelSubtitle2.TabIndex = 10;
this.labelSubtitle2.Text = "sub2";
//
// labelSubtitle1
//
this.labelSubtitle1.AutoSize = true;
this.labelSubtitle1.Location = new System.Drawing.Point(9, 32);
this.labelSubtitle1.Name = "labelSubtitle1";
this.labelSubtitle1.Size = new System.Drawing.Size(30, 13);
this.labelSubtitle1.TabIndex = 8;
this.labelSubtitle1.Text = "sub1";
//
// buttonOpenSubtitle1
//
this.buttonOpenSubtitle1.Location = new System.Drawing.Point(9, 8);
this.buttonOpenSubtitle1.Name = "buttonOpenSubtitle1";
this.buttonOpenSubtitle1.Size = new System.Drawing.Size(24, 21);
this.buttonOpenSubtitle1.TabIndex = 13;
this.buttonOpenSubtitle1.Text = "...";
this.buttonOpenSubtitle1.UseVisualStyleBackColor = true;
this.buttonOpenSubtitle1.Click += new System.EventHandler(this.ButtonOpenSubtitle1Click);
//
// buttonOpenSubtitle2
//
this.buttonOpenSubtitle2.Location = new System.Drawing.Point(491, 8);
this.buttonOpenSubtitle2.Name = "buttonOpenSubtitle2";
this.buttonOpenSubtitle2.Size = new System.Drawing.Size(24, 21);
this.buttonOpenSubtitle2.TabIndex = 14;
this.buttonOpenSubtitle2.Text = "...";
this.buttonOpenSubtitle2.UseVisualStyleBackColor = true;
this.buttonOpenSubtitle2.Click += new System.EventHandler(this.ButtonOpenSubtitle2Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// buttonNextDifference
//
this.buttonNextDifference.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonNextDifference.Enabled = false;
this.buttonNextDifference.Location = new System.Drawing.Point(167, 539);
this.buttonNextDifference.Name = "buttonNextDifference";
this.buttonNextDifference.Size = new System.Drawing.Size(156, 21);
this.buttonNextDifference.TabIndex = 15;
this.buttonNextDifference.Text = "&Next difference";
this.buttonNextDifference.UseVisualStyleBackColor = true;
this.buttonNextDifference.Click += new System.EventHandler(this.ButtonNextDifferenceClick);
//
// buttonPreviousDifference
//
this.buttonPreviousDifference.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonPreviousDifference.Enabled = false;
this.buttonPreviousDifference.Location = new System.Drawing.Point(5, 539);
this.buttonPreviousDifference.Name = "buttonPreviousDifference";
this.buttonPreviousDifference.Size = new System.Drawing.Size(156, 21);
this.buttonPreviousDifference.TabIndex = 16;
this.buttonPreviousDifference.Text = "&Previous difference";
this.buttonPreviousDifference.UseVisualStyleBackColor = true;
this.buttonPreviousDifference.Click += new System.EventHandler(this.ButtonPreviousDifferenceClick);
//
// labelStatus
//
this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelStatus.AutoSize = true;
this.labelStatus.Location = new System.Drawing.Point(4, 560);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(35, 13);
this.labelStatus.TabIndex = 17;
this.labelStatus.Text = "status";
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.Timer1Tick);
//
// richTextBox1
//
this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.richTextBox1.BackColor = System.Drawing.SystemColors.Control;
this.richTextBox1.Location = new System.Drawing.Point(8, 490);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(476, 43);
this.richTextBox1.TabIndex = 18;
this.richTextBox1.Text = "";
//
// richTextBox2
//
this.richTextBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.richTextBox2.BackColor = System.Drawing.SystemColors.Control;
this.richTextBox2.Location = new System.Drawing.Point(490, 489);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.ReadOnly = true;
this.richTextBox2.Size = new System.Drawing.Size(478, 43);
this.richTextBox2.TabIndex = 19;
this.richTextBox2.Text = "";
//
// checkBoxShowOnlyDifferences
//
this.checkBoxShowOnlyDifferences.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxShowOnlyDifferences.AutoSize = true;
this.checkBoxShowOnlyDifferences.Location = new System.Drawing.Point(330, 542);
this.checkBoxShowOnlyDifferences.Name = "checkBoxShowOnlyDifferences";
this.checkBoxShowOnlyDifferences.Size = new System.Drawing.Size(130, 17);
this.checkBoxShowOnlyDifferences.TabIndex = 20;
this.checkBoxShowOnlyDifferences.Text = "Show only differences";
this.checkBoxShowOnlyDifferences.UseVisualStyleBackColor = true;
this.checkBoxShowOnlyDifferences.CheckedChanged += new System.EventHandler(this.checkBoxShowOnlyDifferences_CheckedChanged);
//
// checkBoxOnlyListDifferencesInText
//
this.checkBoxOnlyListDifferencesInText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxOnlyListDifferencesInText.AutoSize = true;
this.checkBoxOnlyListDifferencesInText.Location = new System.Drawing.Point(330, 560);
this.checkBoxOnlyListDifferencesInText.Name = "checkBoxOnlyListDifferencesInText";
this.checkBoxOnlyListDifferencesInText.Size = new System.Drawing.Size(189, 17);
this.checkBoxOnlyListDifferencesInText.TabIndex = 21;
this.checkBoxOnlyListDifferencesInText.Text = "Only look for differences in the text";
this.checkBoxOnlyListDifferencesInText.UseVisualStyleBackColor = true;
this.checkBoxOnlyListDifferencesInText.CheckedChanged += new System.EventHandler(this.checkBoxOnlyListDifferencesInText_CheckedChanged);
//
// subtitleListView2
//
this.subtitleListView2.FirstVisibleIndex = -1;
this.subtitleListView2.FullRowSelect = true;
this.subtitleListView2.GridLines = true;
this.subtitleListView2.HideSelection = false;
this.subtitleListView2.Location = new System.Drawing.Point(490, 48);
this.subtitleListView2.Name = "subtitleListView2";
this.subtitleListView2.Size = new System.Drawing.Size(478, 430);
this.subtitleListView2.TabIndex = 9;
this.subtitleListView2.UseCompatibleStateImageBehavior = false;
this.subtitleListView2.View = System.Windows.Forms.View.Details;
this.subtitleListView2.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView2SelectedIndexChanged);
this.subtitleListView2.Enter += new System.EventHandler(this.SubtitleListView2Enter);
this.subtitleListView2.Leave += new System.EventHandler(this.SubtitleListView2Leave);
//
// subtitleListView1
//
this.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(8, 48);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.Size = new System.Drawing.Size(476, 430);
this.subtitleListView1.TabIndex = 7;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView1SelectedIndexChanged);
//
// Compare
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(974, 582);
this.Controls.Add(this.checkBoxOnlyListDifferencesInText);
this.Controls.Add(this.checkBoxShowOnlyDifferences);
this.Controls.Add(this.richTextBox2);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.buttonPreviousDifference);
this.Controls.Add(this.buttonNextDifference);
this.Controls.Add(this.buttonOpenSubtitle2);
this.Controls.Add(this.buttonOpenSubtitle1);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelSubtitle2);
this.Controls.Add(this.subtitleListView2);
this.Controls.Add(this.subtitleListView1);
this.Controls.Add(this.labelSubtitle1);
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(800, 400);
this.Name = "Compare";
this.ShowIcon = false;
this.Text = "Compare subtitles";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Compare_FormClosing);
this.Shown += new System.EventHandler(this.Compare_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Compare_KeyDown);
this.Resize += new System.EventHandler(this.Compare_Resize);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Label labelSubtitle2;
private SubtitleListView subtitleListView2;
private SubtitleListView subtitleListView1;
private System.Windows.Forms.Label labelSubtitle1;
private System.Windows.Forms.Button buttonOpenSubtitle1;
private System.Windows.Forms.Button buttonOpenSubtitle2;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button buttonNextDifference;
private System.Windows.Forms.Button buttonPreviousDifference;
private System.Windows.Forms.Label labelStatus;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.CheckBox checkBoxShowOnlyDifferences;
private System.Windows.Forms.CheckBox checkBoxOnlyListDifferencesInText;
}
}

638
src/Forms/Compare.cs Normal file
View File

@ -0,0 +1,638 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.SubtitleFormats;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class Compare : Form
{
Subtitle _subtitle1;
Subtitle _subtitle2;
List<int> _differences;
bool _listView2Focused;
public Compare()
{
InitializeComponent();
labelSubtitle2.Text = string.Empty;
Text = Configuration.Settings.Language.CompareSubtitles.Title;
buttonPreviousDifference.Text = Configuration.Settings.Language.CompareSubtitles.PreviousDifference;
buttonNextDifference.Text = Configuration.Settings.Language.CompareSubtitles.NextDifference;
checkBoxShowOnlyDifferences.Text = Configuration.Settings.Language.CompareSubtitles.ShowOnlyDifferences;
if (!string.IsNullOrEmpty(Configuration.Settings.Language.CompareSubtitles.OnlyLookForDifferencesInText))
checkBoxOnlyListDifferencesInText.Text = Configuration.Settings.Language.CompareSubtitles.OnlyLookForDifferencesInText;
else
checkBoxOnlyListDifferencesInText.Visible = false;
buttonOK.Text = Configuration.Settings.Language.General.OK;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
subtitleListView2.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
public void Initialize(Subtitle subtitle1, string subtitleFileName1, string title)
{
Compare_Resize(null, null);
labelStatus.Text = string.Empty;
_subtitle1 = subtitle1;
labelSubtitle1.Text = subtitleFileName1;
if (!string.IsNullOrEmpty(title))
labelSubtitle1.Text = title;
subtitleListView1.Fill(subtitle1);
if (!string.IsNullOrEmpty(subtitleFileName1))
{
try
{
openFileDialog1.InitialDirectory = Path.GetDirectoryName(subtitleFileName1);
}
catch
{
}
}
openFileDialog1.Filter = Utilities.GetOpenDialogFiler();
}
public void Initialize(Subtitle subtitle1, string subtitleFileName1, Subtitle subtitle2, string subtitleFileName2)
{
Compare_Resize(null, null);
labelStatus.Text = string.Empty;
_subtitle1 = subtitle1;
labelSubtitle1.Text = subtitleFileName1;
_subtitle2 = subtitle2;
labelSubtitle2.Text = subtitleFileName2;
CompareSubtitles();
if (string.IsNullOrEmpty(subtitleFileName1))
openFileDialog1.InitialDirectory = Path.GetDirectoryName(subtitleFileName1);
openFileDialog1.Filter = Utilities.GetOpenDialogFiler();
}
private void ButtonOpenSubtitle1Click(object sender, EventArgs e)
{
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
_subtitle1 = new Subtitle();
Encoding encoding;
_subtitle1.LoadSubtitle(openFileDialog1.FileName, out encoding, null);
subtitleListView1.Fill(_subtitle1);
labelSubtitle1.Text = openFileDialog1.FileName;
CompareSubtitles();
}
}
private void ButtonOpenSubtitle2Click(object sender, EventArgs e)
{
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
_subtitle2 = new Subtitle();
Encoding encoding;
_subtitle2.LoadSubtitle(openFileDialog1.FileName, out encoding, null);
subtitleListView2.Fill(_subtitle2);
labelSubtitle2.Text = openFileDialog1.FileName;
CompareSubtitles();
}
}
private void CompareSubtitles()
{
timer1.Stop();
var sub1 = new Subtitle(_subtitle1);
var sub2 = new Subtitle(_subtitle2);
int index = 0;
Paragraph p1 = sub1.GetParagraphOrDefault(index);
Paragraph p2 = sub2.GetParagraphOrDefault(index);
int max = sub1.Paragraphs.Count;
if (max < sub2.Paragraphs.Count)
max = sub2.Paragraphs.Count;
while (index < max)
{
if (p1 != null && p2 != null)
{
if (p1.ToString() == p2.ToString())
{
}
else
{
if (GetColumnsEqualExceptNumber(p1, p2) == 0)
{
int oldIndex = index;
for (int i = 1; oldIndex + i < max; i++)
{
if (GetColumnsEqualExceptNumber(sub1.GetParagraphOrDefault(index + i), p2) > 1)
{
for (int j = 0; j < i; j++)
{
sub2.Paragraphs.Insert(index, new Paragraph());
index++;
}
break;
}
else if (GetColumnsEqualExceptNumber(p1, sub2.GetParagraphOrDefault(index + i)) > 1)
{
for (int j = 0; j < i; j++)
{
sub1.Paragraphs.Insert(index, new Paragraph());
index++;
}
break;
}
}
}
}
}
index++;
p1 = sub1.GetParagraphOrDefault(index);
p2 = sub2.GetParagraphOrDefault(index);
}
subtitleListView1.Fill(sub1);
subtitleListView2.Fill(sub2);
// coloring + differences index list
_differences = new List<int>();
index = 0;
p1 = sub1.GetParagraphOrDefault(index);
p2 = sub2.GetParagraphOrDefault(index);
if (checkBoxOnlyListDifferencesInText.Checked)
{
while (index < sub1.Paragraphs.Count || index < sub2.Paragraphs.Count)
{
if (p1 != null && p2 != null)
{
if (p1.ToString() == p2.ToString() && p1.Number == p2.Number)
{ // no differences
}
else if (p1.ToString() == new Paragraph().ToString())
{
_differences.Add(index);
subtitleListView1.ColorOut(index, Color.Salmon);
}
else if (p2.ToString() == new Paragraph().ToString())
{
_differences.Add(index);
subtitleListView2.ColorOut(index, Color.Salmon);
}
else if (p1.Text != p2.Text)
{
_differences.Add(index);
subtitleListView1.SetBackgroundColor(index, Color.LightGreen, SubtitleListView.ColumnIndexText);
}
}
else
{
_differences.Add(index);
}
index++;
p1 = sub1.GetParagraphOrDefault(index);
p2 = sub2.GetParagraphOrDefault(index);
}
}
else
{
while (index < sub1.Paragraphs.Count || index < sub2.Paragraphs.Count)
{
if (p1 != null && p2 != null)
{
if (p1.ToString() != p2.ToString())
_differences.Add(index);
if (p1.ToString() == p2.ToString() && p1.Number == p2.Number)
{ // no differences
}
else if (p1.ToString() == new Paragraph().ToString())
{
subtitleListView1.ColorOut(index, Color.Salmon);
}
else if (p2.ToString() == new Paragraph().ToString())
{
subtitleListView2.ColorOut(index, Color.Salmon);
}
else
{
int columnsAlike = GetColumnsEqualExceptNumber(p1, p2);
if (columnsAlike > 0)
{
if (p1.StartTime.TotalMilliseconds != p2.StartTime.TotalMilliseconds)
{
subtitleListView1.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexStart);
subtitleListView2.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexStart);
}
if (p1.EndTime.TotalMilliseconds != p2.EndTime.TotalMilliseconds)
{
subtitleListView1.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexEnd);
subtitleListView2.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexEnd);
}
if (p1.Duration.TotalMilliseconds != p2.Duration.TotalMilliseconds)
{
subtitleListView1.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexDuration);
subtitleListView2.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexDuration);
}
if (p1.Text.Trim() != p2.Text.Trim())
{
subtitleListView1.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexText);
subtitleListView2.SetBackgroundColor(index, Color.LightGreen,
SubtitleListView.ColumnIndexText);
}
if (p1.Number != p2.Number)
{
subtitleListView1.SetBackgroundColor(index, Color.LightYellow,
SubtitleListView.ColumnIndexNumber);
subtitleListView2.SetBackgroundColor(index, Color.LightYellow,
SubtitleListView.ColumnIndexNumber);
}
}
}
}
else
{
_differences.Add(index);
}
index++;
p1 = sub1.GetParagraphOrDefault(index);
p2 = sub2.GetParagraphOrDefault(index);
}
}
UpdatePreviousAndNextButtons();
if (max == _differences.Count)
{
labelStatus.Text = Configuration.Settings.Language.CompareSubtitles.SubtitlesNotAlike;
labelStatus.Font = new Font(labelStatus.Font.FontFamily, labelStatus.Font.Size, FontStyle.Bold);
}
else
{
labelStatus.Text = string.Format(Configuration.Settings.Language.CompareSubtitles.XNumberOfDifference, _differences.Count);
labelStatus.Font = new Font(labelStatus.Font.FontFamily, labelStatus.Font.Size);
}
if (checkBoxShowOnlyDifferences.Checked)
{ // Remove all lines with no difference
subtitleListView1.BeginUpdate();
subtitleListView2.BeginUpdate();
if (max != _differences.Count)
{
for (index = Math.Max(subtitleListView1.Items.Count, subtitleListView2.Items.Count); index >= 0; index--)
{
if (!_differences.Contains(index))
{
if (subtitleListView1.Items.Count > index)
subtitleListView1.Items.RemoveAt(index);
if (subtitleListView2.Items.Count > index)
subtitleListView2.Items.RemoveAt(index);
}
}
}
subtitleListView1.EndUpdate();
subtitleListView2.EndUpdate();
_differences = new List<int>();
for (index = 0; index < Math.Max(subtitleListView1.Items.Count, subtitleListView2.Items.Count); index++)
_differences.Add(index);
}
timer1.Start();
subtitleListView1.FirstVisibleIndex = -1;
subtitleListView1.SelectIndexAndEnsureVisible(0);
}
private static int GetColumnsEqualExceptNumber(Paragraph p1, Paragraph p2)
{
if (p1 == null || p2 == null)
return 0;
int columnsEqual = 0;
if (p1.StartTime.TotalMilliseconds == p2.StartTime.TotalMilliseconds)
columnsEqual++;
if (p1.EndTime.TotalMilliseconds == p2.EndTime.TotalMilliseconds)
columnsEqual++;
if (p1.Duration.TotalMilliseconds == p2.Duration.TotalMilliseconds)
columnsEqual++;
if (p1.Text.Trim() == p2.Text.Trim())
columnsEqual++;
return columnsEqual;
}
private void ButtonOkClick(object sender, EventArgs e)
{
Close();
}
private void Compare_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
Close();
else if (e.KeyCode == Keys.Enter && buttonNextDifference.Enabled)
ButtonNextDifferenceClick(null, null);
else if (e.KeyCode == Keys.Right && buttonNextDifference.Enabled)
ButtonNextDifferenceClick(null, null);
else if (e.KeyCode == Keys.Left && buttonPreviousDifference.Enabled)
ButtonPreviousDifferenceClick(null, null);
}
private void SubtitleListView1SelectedIndexChanged(object sender, EventArgs e)
{
UpdatePreviousAndNextButtons();
ShowText();
}
private void ShowText()
{
string text1 = string.Empty;
string text2 = string.Empty;
if (subtitleListView1.SelectedItems.Count == 1)
{
text1 = subtitleListView1.GetText(subtitleListView1.SelectedItems[0].Index);
if (subtitleListView2.Items.Count > subtitleListView1.SelectedItems[0].Index)
text2 = subtitleListView2.GetText(subtitleListView1.SelectedItems[0].Index);
}
richTextBox1.Text = text1;
richTextBox2.Text = text2;
//showdiff
if (text1 == text2)
return;
if (text1.Trim().Length == 0 || text2.Trim().Length == 0)
return;
ShowTextDifference();
}
private void ShowTextDifference()
{
// from start
int minLength = Math.Min(richTextBox1.Text.Length, richTextBox2.Text.Length);
int startCharactersOk = 0;
for (int i=0; i < minLength; i++)
{
if (richTextBox1.Text[i] == richTextBox2.Text[i])
{
startCharactersOk++;
}
else
{
if (richTextBox1.Text.Length > i+4 && richTextBox2.Text.Length > i+4 &&
richTextBox1.Text[i + 1] == richTextBox2.Text[i + 1] &&
richTextBox1.Text[i + 2] == richTextBox2.Text[i + 2] &&
richTextBox1.Text[i + 3] == richTextBox2.Text[i + 3] &&
richTextBox1.Text[i + 4] == richTextBox2.Text[i + 4])
{
startCharactersOk++;
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = 1;
richTextBox1.SelectionColor = Color.Red;
richTextBox2.SelectionStart = i;
richTextBox2.SelectionLength = 1;
richTextBox2.SelectionColor = Color.Red;
}
else
{
break;
}
}
}
int maxLength = Math.Max(richTextBox1.Text.Length, richTextBox2.Text.Length);
for (int i = startCharactersOk; i <= maxLength; i++)
{
if (i < richTextBox1.Text.Length)
{
richTextBox1.SelectionStart = i;
richTextBox1.SelectionLength = 1;
richTextBox1.SelectionColor = Color.Red;
}
if (i < richTextBox2.Text.Length)
{
richTextBox2.SelectionStart = i;
richTextBox2.SelectionLength = 1;
richTextBox2.SelectionColor = Color.Red;
}
}
// from end
for (int i = 1; i < minLength; i++)
{
if (richTextBox1.Text[richTextBox1.Text.Length - i] == richTextBox2.Text[richTextBox2.Text.Length - i])
{
richTextBox1.SelectionStart = richTextBox1.Text.Length - i;
richTextBox1.SelectionLength = 1;
richTextBox1.SelectionColor = Color.Black;
richTextBox2.SelectionStart = richTextBox2.Text.Length - i;
richTextBox2.SelectionLength = 1;
richTextBox2.SelectionColor = Color.Black;
}
else
{
if (i == 0 && i > 4 &&
richTextBox1.Text[richTextBox1.Text.Length - (i + 1)] == richTextBox2.Text[richTextBox2.Text.Length - (i + 1)] &&
richTextBox1.Text[richTextBox1.Text.Length - (i + 2)] == richTextBox2.Text[richTextBox2.Text.Length - (i + 2)] &&
richTextBox1.Text[richTextBox1.Text.Length - (i + 3)] == richTextBox2.Text[richTextBox2.Text.Length - (i + 3)] &&
richTextBox1.Text[richTextBox1.Text.Length - (i + 4)] == richTextBox2.Text[richTextBox2.Text.Length - (i + 4)])
{
}
else
{
break;
}
}
}
}
private void UpdatePreviousAndNextButtons()
{
if (subtitleListView1.Items.Count > 0 && subtitleListView2.Items.Count > 0 &&
_differences != null && _differences.Count > 0)
{
if (subtitleListView1.SelectedItems.Count == 0)
{
buttonPreviousDifference.Enabled = false;
buttonNextDifference.Enabled = true;
}
else
{
int index = subtitleListView1.SelectedItems[0].Index;
buttonPreviousDifference.Enabled = _differences[0] < index;
buttonNextDifference.Enabled = _differences[_differences.Count-1] > index;
}
}
else
{
buttonPreviousDifference.Enabled = false;
buttonNextDifference.Enabled = false;
}
}
private void SubtitleListView2SelectedIndexChanged(object sender, EventArgs e)
{
UpdatePreviousAndNextButtons();
}
private void Compare_Shown(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(labelSubtitle2.Text))
ButtonOpenSubtitle2Click(null, null);
}
private void Compare_Resize(object sender, EventArgs e)
{
subtitleListView1.Width = (Width / 2) - 20;
subtitleListView2.Left = (Width / 2) - 3;
subtitleListView2.Width = (Width / 2) - 20;
labelSubtitle2.Left = subtitleListView2.Left;
buttonOpenSubtitle2.Left = subtitleListView2.Left;
subtitleListView1.Height = Height - (subtitleListView1.Top + 140);
subtitleListView2.Height = Height - (subtitleListView2.Top + 140);
richTextBox1.Width = subtitleListView1.Width;
richTextBox2.Width = subtitleListView2.Width;
richTextBox2.Left = subtitleListView2.Left;
}
private void ButtonPreviousDifferenceClick(object sender, EventArgs e)
{
if (_differences != null && _differences.Count > 0)
{
if (subtitleListView1.SelectedItems.Count == 0)
{
subtitleListView1.SelectIndexAndEnsureVisible(_differences[0]);
}
else
{
for (int i = subtitleListView1.SelectedItems[0].Index-1; i >= 0; i--)
{
if (_differences.Contains(i))
{
subtitleListView1.SelectIndexAndEnsureVisible(i - 2);
subtitleListView1.SelectIndexAndEnsureVisible(i + 2);
subtitleListView1.SelectIndexAndEnsureVisible(i);
break;
}
}
}
}
}
private void ButtonNextDifferenceClick(object sender, EventArgs e)
{
if (_differences != null && _differences.Count > 0)
{
if (subtitleListView1.SelectedItems.Count == 0)
{
subtitleListView1.SelectIndexAndEnsureVisible(_differences[0]);
}
else
{
for (int i = subtitleListView1.SelectedItems[0].Index + 1; i < subtitleListView1.Items.Count; i++)
{
if (_differences.Contains(i))
{
subtitleListView1.SelectIndexAndEnsureVisible(i - 2);
subtitleListView1.SelectIndexAndEnsureVisible(i + 2);
subtitleListView1.SelectIndexAndEnsureVisible(i);
subtitleListView1.Focus();
break;
}
}
}
}
}
private void Timer1Tick(object sender, EventArgs e)
{
if (subtitleListView1.SelectedItems.Count > 0 && _listView2Focused == false)
{
if (subtitleListView2.SelectedItems.Count > 0 &&
subtitleListView1.SelectedItems[0].Index == subtitleListView2.SelectedItems[0].Index)
{
if (subtitleListView1.TopItem.Index != subtitleListView2.TopItem.Index &&
subtitleListView2.Items.Count > subtitleListView1.TopItem.Index)
subtitleListView2.TopItem = subtitleListView2.Items[subtitleListView1.TopItem.Index];
return;
}
subtitleListView2.SelectedIndexChanged -= SubtitleListView2SelectedIndexChanged;
subtitleListView2.SelectIndexAndEnsureVisible(subtitleListView1.SelectedItems[0].Index);
if (subtitleListView1.TopItem.Index != subtitleListView2.TopItem.Index &&
subtitleListView2.Items.Count > subtitleListView1.TopItem.Index)
subtitleListView2.TopItem = subtitleListView2.Items[subtitleListView1.TopItem.Index];
subtitleListView2.SelectedIndexChanged += SubtitleListView2SelectedIndexChanged;
}
else if (subtitleListView2.SelectedItems.Count > 0 && _listView2Focused)
{
if (subtitleListView1.SelectedItems.Count > 0 &&
subtitleListView2.SelectedItems[0].Index == subtitleListView1.SelectedItems[0].Index)
{
if (subtitleListView2.TopItem.Index != subtitleListView1.TopItem.Index &&
subtitleListView1.Items.Count > subtitleListView2.TopItem.Index)
subtitleListView1.TopItem = subtitleListView1.Items[subtitleListView2.TopItem.Index];
return;
}
subtitleListView1.SelectIndexAndEnsureVisible(subtitleListView2.SelectedItems[0].Index);
if (subtitleListView2.TopItem.Index != subtitleListView1.TopItem.Index &&
subtitleListView1.Items.Count > subtitleListView2.TopItem.Index)
subtitleListView1.TopItem = subtitleListView1.Items[subtitleListView2.TopItem.Index];
}
}
private void SubtitleListView2Enter(object sender, EventArgs e)
{
_listView2Focused = true;
}
private void SubtitleListView2Leave(object sender, EventArgs e)
{
_listView2Focused = false;
}
private void Compare_FormClosing(object sender, FormClosingEventArgs e)
{
timer1.Stop();
}
private void checkBoxShowOnlyDifferences_CheckedChanged(object sender, EventArgs e)
{
CompareSubtitles();
}
private void checkBoxOnlyListDifferencesInText_CheckedChanged(object sender, EventArgs e)
{
CompareSubtitles();
}
}
}

126
src/Forms/Compare.resx Normal file
View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>147, 17</value>
</metadata>
</root>

312
src/Forms/DvdSubRip.Designer.cs generated Normal file
View File

@ -0,0 +1,312 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class DvdSubRip
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOpenIfo = new System.Windows.Forms.Button();
this.textBoxIfoFileName = new System.Windows.Forms.TextBox();
this.labelIfoFile = new System.Windows.Forms.Label();
this.groupBoxDvd = new System.Windows.Forms.GroupBox();
this.buttonClear = new System.Windows.Forms.Button();
this.groupBoxLanguages = new System.Windows.Forms.GroupBox();
this.comboBoxLanguages = new System.Windows.Forms.ComboBox();
this.groupBoxPalNtsc = new System.Windows.Forms.GroupBox();
this.radioButtonNtsc = new System.Windows.Forms.RadioButton();
this.radioButtonPal = new System.Windows.Forms.RadioButton();
this.ButtonRemoveVob = new System.Windows.Forms.Button();
this.ButtonMoveVobDown = new System.Windows.Forms.Button();
this.ButtonMoveVobUp = new System.Windows.Forms.Button();
this.buttonAddVobFile = new System.Windows.Forms.Button();
this.labelVobFiles = new System.Windows.Forms.Label();
this.listBoxVobFiles = new System.Windows.Forms.ListBox();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.progressBarRip = new System.Windows.Forms.ProgressBar();
this.labelStatus = new System.Windows.Forms.Label();
this.buttonStartRipping = new System.Windows.Forms.Button();
this.groupBoxDvd.SuspendLayout();
this.groupBoxLanguages.SuspendLayout();
this.groupBoxPalNtsc.SuspendLayout();
this.SuspendLayout();
//
// buttonOpenIfo
//
this.buttonOpenIfo.Location = new System.Drawing.Point(447, 32);
this.buttonOpenIfo.Name = "buttonOpenIfo";
this.buttonOpenIfo.Size = new System.Drawing.Size(25, 23);
this.buttonOpenIfo.TabIndex = 1;
this.buttonOpenIfo.Text = "...";
this.buttonOpenIfo.UseVisualStyleBackColor = true;
this.buttonOpenIfo.Click += new System.EventHandler(this.ButtonOpenIfoClick);
//
// textBoxIfoFileName
//
this.textBoxIfoFileName.AllowDrop = true;
this.textBoxIfoFileName.Location = new System.Drawing.Point(6, 34);
this.textBoxIfoFileName.Name = "textBoxIfoFileName";
this.textBoxIfoFileName.ReadOnly = true;
this.textBoxIfoFileName.Size = new System.Drawing.Size(435, 20);
this.textBoxIfoFileName.TabIndex = 0;
this.textBoxIfoFileName.DragDrop += new System.Windows.Forms.DragEventHandler(this.TextBoxIfoFileNameDragDrop);
this.textBoxIfoFileName.DragEnter += new System.Windows.Forms.DragEventHandler(this.TextBoxIfoFileNameDragEnter);
//
// labelIfoFile
//
this.labelIfoFile.AutoSize = true;
this.labelIfoFile.Location = new System.Drawing.Point(6, 18);
this.labelIfoFile.Name = "labelIfoFile";
this.labelIfoFile.Size = new System.Drawing.Size(40, 13);
this.labelIfoFile.TabIndex = 2;
this.labelIfoFile.Text = "IFO file";
//
// groupBoxDvd
//
this.groupBoxDvd.Controls.Add(this.buttonClear);
this.groupBoxDvd.Controls.Add(this.groupBoxLanguages);
this.groupBoxDvd.Controls.Add(this.groupBoxPalNtsc);
this.groupBoxDvd.Controls.Add(this.ButtonRemoveVob);
this.groupBoxDvd.Controls.Add(this.ButtonMoveVobDown);
this.groupBoxDvd.Controls.Add(this.ButtonMoveVobUp);
this.groupBoxDvd.Controls.Add(this.buttonAddVobFile);
this.groupBoxDvd.Controls.Add(this.labelVobFiles);
this.groupBoxDvd.Controls.Add(this.listBoxVobFiles);
this.groupBoxDvd.Controls.Add(this.labelIfoFile);
this.groupBoxDvd.Controls.Add(this.buttonOpenIfo);
this.groupBoxDvd.Controls.Add(this.textBoxIfoFileName);
this.groupBoxDvd.Location = new System.Drawing.Point(4, 4);
this.groupBoxDvd.Name = "groupBoxDvd";
this.groupBoxDvd.Size = new System.Drawing.Size(527, 264);
this.groupBoxDvd.TabIndex = 3;
this.groupBoxDvd.TabStop = false;
this.groupBoxDvd.Text = "DVD files/info";
//
// buttonClear
//
this.buttonClear.Location = new System.Drawing.Point(446, 131);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(74, 21);
this.buttonClear.TabIndex = 9;
this.buttonClear.Text = "Clear";
this.buttonClear.UseVisualStyleBackColor = true;
this.buttonClear.Click += new System.EventHandler(this.ButtonClearClick);
//
// groupBoxLanguages
//
this.groupBoxLanguages.Controls.Add(this.comboBoxLanguages);
this.groupBoxLanguages.Location = new System.Drawing.Point(6, 217);
this.groupBoxLanguages.Name = "groupBoxLanguages";
this.groupBoxLanguages.Size = new System.Drawing.Size(242, 41);
this.groupBoxLanguages.TabIndex = 14;
this.groupBoxLanguages.TabStop = false;
this.groupBoxLanguages.Text = "Languages";
//
// comboBoxLanguages
//
this.comboBoxLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxLanguages.FormattingEnabled = true;
this.comboBoxLanguages.Location = new System.Drawing.Point(6, 14);
this.comboBoxLanguages.Name = "comboBoxLanguages";
this.comboBoxLanguages.Size = new System.Drawing.Size(230, 21);
this.comboBoxLanguages.TabIndex = 14;
//
// groupBoxPalNtsc
//
this.groupBoxPalNtsc.Controls.Add(this.radioButtonNtsc);
this.groupBoxPalNtsc.Controls.Add(this.radioButtonPal);
this.groupBoxPalNtsc.Location = new System.Drawing.Point(254, 217);
this.groupBoxPalNtsc.Name = "groupBoxPalNtsc";
this.groupBoxPalNtsc.Size = new System.Drawing.Size(266, 41);
this.groupBoxPalNtsc.TabIndex = 20;
this.groupBoxPalNtsc.TabStop = false;
this.groupBoxPalNtsc.Text = "PAL/NTSC";
//
// radioButtonNtsc
//
this.radioButtonNtsc.AutoSize = true;
this.radioButtonNtsc.Location = new System.Drawing.Point(104, 18);
this.radioButtonNtsc.Name = "radioButtonNtsc";
this.radioButtonNtsc.Size = new System.Drawing.Size(89, 17);
this.radioButtonNtsc.TabIndex = 1;
this.radioButtonNtsc.TabStop = true;
this.radioButtonNtsc.Text = "NTSC (30fps)";
this.radioButtonNtsc.UseVisualStyleBackColor = true;
//
// radioButtonPal
//
this.radioButtonPal.AutoSize = true;
this.radioButtonPal.Checked = true;
this.radioButtonPal.Location = new System.Drawing.Point(6, 19);
this.radioButtonPal.Name = "radioButtonPal";
this.radioButtonPal.Size = new System.Drawing.Size(80, 17);
this.radioButtonPal.TabIndex = 0;
this.radioButtonPal.TabStop = true;
this.radioButtonPal.Text = "PAL (25fps)";
this.radioButtonPal.UseVisualStyleBackColor = true;
//
// ButtonRemoveVob
//
this.ButtonRemoveVob.Location = new System.Drawing.Point(447, 104);
this.ButtonRemoveVob.Name = "ButtonRemoveVob";
this.ButtonRemoveVob.Size = new System.Drawing.Size(74, 21);
this.ButtonRemoveVob.TabIndex = 8;
this.ButtonRemoveVob.Text = "Remove";
this.ButtonRemoveVob.UseVisualStyleBackColor = true;
this.ButtonRemoveVob.Click += new System.EventHandler(this.ButtonRemoveVob_Click);
//
// ButtonMoveVobDown
//
this.ButtonMoveVobDown.Location = new System.Drawing.Point(446, 185);
this.ButtonMoveVobDown.Name = "ButtonMoveVobDown";
this.ButtonMoveVobDown.Size = new System.Drawing.Size(74, 21);
this.ButtonMoveVobDown.TabIndex = 12;
this.ButtonMoveVobDown.Text = "Move down";
this.ButtonMoveVobDown.UseVisualStyleBackColor = true;
this.ButtonMoveVobDown.Click += new System.EventHandler(this.ButtonMoveVobDown_Click);
//
// ButtonMoveVobUp
//
this.ButtonMoveVobUp.Location = new System.Drawing.Point(447, 158);
this.ButtonMoveVobUp.Name = "ButtonMoveVobUp";
this.ButtonMoveVobUp.Size = new System.Drawing.Size(74, 21);
this.ButtonMoveVobUp.TabIndex = 10;
this.ButtonMoveVobUp.Text = "Move up";
this.ButtonMoveVobUp.UseVisualStyleBackColor = true;
this.ButtonMoveVobUp.Click += new System.EventHandler(this.ButtonMoveVobUp_Click);
//
// buttonAddVobFile
//
this.buttonAddVobFile.Location = new System.Drawing.Point(447, 77);
this.buttonAddVobFile.Name = "buttonAddVobFile";
this.buttonAddVobFile.Size = new System.Drawing.Size(73, 21);
this.buttonAddVobFile.TabIndex = 5;
this.buttonAddVobFile.Text = "Add...";
this.buttonAddVobFile.UseVisualStyleBackColor = true;
this.buttonAddVobFile.Click += new System.EventHandler(this.ButtonAddVobFileClick);
//
// labelVobFiles
//
this.labelVobFiles.AutoSize = true;
this.labelVobFiles.Location = new System.Drawing.Point(6, 61);
this.labelVobFiles.Name = "labelVobFiles";
this.labelVobFiles.Size = new System.Drawing.Size(50, 13);
this.labelVobFiles.TabIndex = 4;
this.labelVobFiles.Text = "VOB files";
//
// listBoxVobFiles
//
this.listBoxVobFiles.AllowDrop = true;
this.listBoxVobFiles.FormattingEnabled = true;
this.listBoxVobFiles.Location = new System.Drawing.Point(6, 77);
this.listBoxVobFiles.Name = "listBoxVobFiles";
this.listBoxVobFiles.Size = new System.Drawing.Size(435, 134);
this.listBoxVobFiles.TabIndex = 3;
this.listBoxVobFiles.DragDrop += new System.Windows.Forms.DragEventHandler(this.ListBoxVobFilesDragDrop);
this.listBoxVobFiles.DragEnter += new System.Windows.Forms.DragEventHandler(this.ListBoxVobFilesDragEnter);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// progressBarRip
//
this.progressBarRip.Location = new System.Drawing.Point(117, 290);
this.progressBarRip.Name = "progressBarRip";
this.progressBarRip.Size = new System.Drawing.Size(414, 14);
this.progressBarRip.TabIndex = 4;
this.progressBarRip.Visible = false;
//
// labelStatus
//
this.labelStatus.AutoSize = true;
this.labelStatus.Location = new System.Drawing.Point(117, 276);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(37, 13);
this.labelStatus.TabIndex = 5;
this.labelStatus.Text = "Status";
//
// buttonStartRipping
//
this.buttonStartRipping.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonStartRipping.Location = new System.Drawing.Point(4, 273);
this.buttonStartRipping.Name = "buttonStartRipping";
this.buttonStartRipping.Size = new System.Drawing.Size(107, 31);
this.buttonStartRipping.TabIndex = 25;
this.buttonStartRipping.Text = "Start ripping";
this.buttonStartRipping.UseVisualStyleBackColor = true;
this.buttonStartRipping.Click += new System.EventHandler(this.ButtonStartRippingClick);
//
// DvdSubRip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(536, 310);
this.Controls.Add(this.buttonStartRipping);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.progressBarRip);
this.Controls.Add(this.groupBoxDvd);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "DvdSubRip";
this.ShowIcon = false;
this.Text = "Rip subtitles from ifo/vobs (dvd)";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DvdSubRip_KeyDown);
this.groupBoxDvd.ResumeLayout(false);
this.groupBoxDvd.PerformLayout();
this.groupBoxLanguages.ResumeLayout(false);
this.groupBoxPalNtsc.ResumeLayout(false);
this.groupBoxPalNtsc.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOpenIfo;
private System.Windows.Forms.TextBox textBoxIfoFileName;
private System.Windows.Forms.Label labelIfoFile;
private System.Windows.Forms.GroupBox groupBoxDvd;
private System.Windows.Forms.ListBox listBoxVobFiles;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button ButtonRemoveVob;
private System.Windows.Forms.Button ButtonMoveVobDown;
private System.Windows.Forms.Button ButtonMoveVobUp;
private System.Windows.Forms.Button buttonAddVobFile;
private System.Windows.Forms.Label labelVobFiles;
private System.Windows.Forms.ProgressBar progressBarRip;
private System.Windows.Forms.Label labelStatus;
private System.Windows.Forms.Button buttonStartRipping;
private System.Windows.Forms.ComboBox comboBoxLanguages;
private System.Windows.Forms.GroupBox groupBoxLanguages;
private System.Windows.Forms.GroupBox groupBoxPalNtsc;
private System.Windows.Forms.RadioButton radioButtonNtsc;
private System.Windows.Forms.RadioButton radioButtonPal;
private System.Windows.Forms.Button buttonClear;
}
}

508
src/Forms/DvdSubRip.cs Normal file
View File

@ -0,0 +1,508 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.VobSub;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class DvdSubRip : Form
{
volatile bool _abort;
public List<VobSubMergedPack> MergedVobSubPacks;
public List<Color> Palette;
public List<string> Languages;
LanguageStructure.DvdSubRip _language;
long _lastPresentationTimeStamp = 0;
long _lastVobPresentationTimeStamp = 0;
long _lastNavEndPts = 0;
long _accumulatedPresentationTimeStamp;
public TimeSpan LastPresentationTimeStamp
{
get
{
if (radioButtonPal.Checked)
{
float ticksPerMillisecond = 90.000F;
return TimeSpan.FromMilliseconds(Convert.ToDouble(_lastPresentationTimeStamp / ticksPerMillisecond));
}
else
{
float ticksPerMillisecond = 90.090F;
return TimeSpan.FromMilliseconds(Convert.ToDouble(_lastPresentationTimeStamp / ticksPerMillisecond));
}
}
}
public double FrameRate
{
get
{
if (radioButtonPal.Checked)
return 25.0;
else
return 30.0;
}
}
public string SelectedLanguage
{
get
{
if (comboBoxLanguages.SelectedIndex >= 0)
return string.Format("{0} (0x{1:x})", comboBoxLanguages.Items[comboBoxLanguages.SelectedIndex], comboBoxLanguages.SelectedIndex + 32);
return string.Empty;
}
}
public DvdSubRip()
{
InitializeComponent();
labelStatus.Text = string.Empty;
buttonStartRipping.Enabled = false;
_language = Configuration.Settings.Language.DvdSubrip;
Text = _language.Title;
groupBoxDvd.Text = _language.DvdGroupTitle;
labelIfoFile.Text = _language.IfoFile;
labelVobFiles.Text = _language.VobFiles;
groupBoxLanguages.Text = _language.Languages;
groupBoxPalNtsc.Text = _language.PalNtsc;
radioButtonPal.Text = _language.Pal;
radioButtonNtsc.Text = _language.Ntsc;
buttonStartRipping.Text = _language.StartRipping;
buttonAddVobFile.Text = _language.Add;
ButtonRemoveVob.Text = _language.Remove;
buttonClear.Text = _language.Clear;
ButtonMoveVobDown.Text = _language.MoveDown;
ButtonMoveVobUp.Text = _language.MoveUp;
if (System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName == "en")
radioButtonNtsc.Checked = true;
else
radioButtonPal.Checked = true;
}
private void ButtonOpenIfoClick(object sender, EventArgs e)
{
openFileDialog1.Multiselect = false;
openFileDialog1.Filter = _language.IfoFiles + "|*.IFO";
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK && File.Exists(openFileDialog1.FileName))
{
OpenIfoFile(openFileDialog1.FileName);
}
}
private void OpenIfoFile(string fileName)
{
Clear();
textBoxIfoFileName.Text = fileName;
// List vob files
string path = Path.GetDirectoryName(fileName);
string onlyFileName = Path.GetFileNameWithoutExtension(fileName);
string searchPattern = onlyFileName.Substring(0, onlyFileName.Length - 1) + "?.VOB";
listBoxVobFiles.Items.Clear();
for (int i = 1; i < 30; i++)
{
string vobFileName = searchPattern.Replace("?", i.ToString());
if (File.Exists(Path.Combine(path, vobFileName)))
listBoxVobFiles.Items.Add(Path.Combine(path, vobFileName));
}
if (listBoxVobFiles.Items.Count == 0)
{
searchPattern = onlyFileName.Substring(0, onlyFileName.Length - 1) + "PGC_01_?.VOB";
for (int i = 1; i < 30; i++)
{
string vobFileName = searchPattern.Replace("?", i.ToString());
if (File.Exists(Path.Combine(path, vobFileName)))
listBoxVobFiles.Items.Add(Path.Combine(path, vobFileName));
}
}
var ifoParser = new IfoParser(fileName);
if (!string.IsNullOrEmpty(ifoParser.ErrorMessage))
{
Clear();
MessageBox.Show(ifoParser.ErrorMessage);
return;
}
// List info
labelIfoFile.Text = _language.IfoFile + ": " + ifoParser.VideoTitleSetVobs.VideoStream.Resolution;
bool isPal = string.Compare(ifoParser.VideoTitleSetVobs.VideoStream.Standard, "PAL", true) == 0;
if (isPal)
radioButtonPal.Checked = true;
else
radioButtonNtsc.Checked = true;
// List languages
comboBoxLanguages.Items.Clear();
foreach (string s in ifoParser.VideoTitleSetVobs.Subtitles)
comboBoxLanguages.Items.Add(s);
if (comboBoxLanguages.Items.Count > 0)
comboBoxLanguages.SelectedIndex = 0;
// Save palette (Color LookUp Table)
if (ifoParser.VideoTitleSetProgramChainTable.ProgramChains.Count > 0)
Palette = ifoParser.VideoTitleSetProgramChainTable.ProgramChains[0].ColorLookupTable;
buttonStartRipping.Enabled = listBoxVobFiles.Items.Count > 0;
}
private void ButtonStartRippingClick(object sender, EventArgs e)
{
if (buttonStartRipping.Text == _language.Abort)
{
_abort = true;
buttonStartRipping.Text = _language.StartRipping;
return;
}
_abort = false;
buttonStartRipping.Text = _language.Abort;
_lastPresentationTimeStamp = 0;
_lastVobPresentationTimeStamp = 0;
_lastNavEndPts = 0;
_accumulatedPresentationTimeStamp = 0;
progressBarRip.Visible = true;
var ms = new MemoryStream();
int i = 0;
foreach (string vobFileName in listBoxVobFiles.Items)
{
i++;
labelStatus.Text = string.Format(_language.RippingVobFileXofYZ, Path.GetFileName(vobFileName), i, listBoxVobFiles.Items.Count);
Refresh();
Application.DoEvents();
if (!_abort)
RipSubtitles(vobFileName, ms, i-1); // Rip/demux subtitle vob packs
}
progressBarRip.Visible = false;
buttonStartRipping.Enabled = false;
if (_abort)
{
labelStatus.Text = _language.AbortedByUser;
buttonStartRipping.Text = _language.StartRipping;
buttonStartRipping.Enabled = true;
return;
}
labelStatus.Text = string.Format(_language.ReadingSubtitleData);
Refresh();
Application.DoEvents();
var vobSub = new VobSubParser(radioButtonPal.Checked);
vobSub.Open(ms);
ms.Close();
labelStatus.Text = string.Empty;
MergedVobSubPacks = vobSub.MergeVobSubPacks(); // Merge splitted-packs to whole-packs
Languages = new List<string>();
for (int k = 0; k < comboBoxLanguages.Items.Count; k++)
Languages.Add(string.Format("{0} (0x{1:x})", comboBoxLanguages.Items[k], k + 32));
buttonStartRipping.Text = _language.StartRipping;
buttonStartRipping.Enabled = true;
DialogResult = DialogResult.OK;
}
private void RipSubtitles(string vobFileName, MemoryStream stream, int vobNumber)
{
long firstNavStartPTS = 0;
FileStream fs = null;
bool tryAgain = true;
while (tryAgain)
{
try
{
fs = new FileStream(vobFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
tryAgain = false;
}
catch (IOException exception)
{
var result = MessageBox.Show(string.Format("An error occured while opening file: {0}", exception.Message), "", MessageBoxButtons.RetryCancel);
if (result == DialogResult.Cancel)
return;
if (result == DialogResult.Retry)
tryAgain = true;
}
}
byte[] buffer = new byte[0x800];
long position = 0;
progressBarRip.Maximum = 100;
progressBarRip.Value = 0;
int lba = 0;
while (position < fs.Length && !_abort)
{
int bytesRead = 0;
// Reading and test for IO errors... and allow abort/retry/ignore
tryAgain = true;
while (tryAgain && position < fs.Length)
{
tryAgain = false;
try
{
fs.Seek(position, SeekOrigin.Begin);
bytesRead = fs.Read(buffer, 0, 0x0800);
}
catch (IOException exception)
{
var result = MessageBox.Show(string.Format("An error occured while reading file: {0}", exception.Message), "", MessageBoxButtons.AbortRetryIgnore);
if (result == DialogResult.Abort)
return;
if (result == DialogResult.Retry)
tryAgain = true;
if (result == DialogResult.Ignore)
{
position += 0x800;
tryAgain = true;
}
}
}
if (VobSubParser.IsMpeg2PackHeader(buffer))
{
VobSubPack vsp = new VobSubPack(buffer, null);
if (IsSubtitlePack(buffer))
{
if (vsp.PacketizedElementaryStream.PresentationTimeStamp.HasValue && _accumulatedPresentationTimeStamp != 0)
UpdatePresentationTimeStamp(buffer, _accumulatedPresentationTimeStamp, vsp);
stream.Write(buffer, 0, 0x800);
if (bytesRead < 0x800)
stream.Write(Encoding.ASCII.GetBytes(new string(' ', 0x800 - bytesRead)), 0, 0x800 - bytesRead);
}
else if (IsPrivateStream2(buffer, 0x26))
{
if (Helper.GetEndian(buffer, 0x0026, 4) == 0x1bf && Helper.GetEndian(buffer, 0x400, 4) == 0x1bf)
{
uint vobu_s_ptm = Helper.GetEndian(buffer, 0x0039, 4);
uint vobu_e_ptm = Helper.GetEndian(buffer, 0x003d, 4);
_lastPresentationTimeStamp = vobu_e_ptm;
if (firstNavStartPTS == 0)
{
firstNavStartPTS = vobu_s_ptm;
if (vobNumber == 0)
_accumulatedPresentationTimeStamp = -vobu_s_ptm;
}
if (vobu_s_ptm + firstNavStartPTS + _accumulatedPresentationTimeStamp < _lastVobPresentationTimeStamp)
{
_accumulatedPresentationTimeStamp += _lastNavEndPts - vobu_s_ptm;
}
else if (_lastNavEndPts > vobu_e_ptm)
{
_accumulatedPresentationTimeStamp += _lastNavEndPts - vobu_s_ptm;
}
_lastNavEndPts = vobu_e_ptm;
}
}
}
position += 0x800;
progressBarRip.Value = (int)((position * 100) / fs.Length);
Application.DoEvents();
lba++;
}
fs.Close();
_lastVobPresentationTimeStamp = _lastPresentationTimeStamp;
}
/// <summary>
/// Write the 5 PTS bytes to buffer
/// </summary>
private void UpdatePresentationTimeStamp(byte[] buffer, long addPresentationTimeStamp, VobSubPack vsp)
{
const int presentationTimeStampIndex = 23;
string pre = "0011";
if (vsp.PacketizedElementaryStream.PresentationTimeStampDecodeTimeStampFlags == Helper.B00000010)
pre = "0010";
long newPts = addPresentationTimeStamp + ((long)vsp.PacketizedElementaryStream.PresentationTimeStamp.Value);
string bString = Convert.ToString((long)newPts, 2).PadLeft(33, '0');
string fiveBytesString = pre + bString.Substring(0, 3) + "1" + bString.Substring(3, 15) + "1" + bString.Substring(18, 15) + "1";
for (int i = 0; i < 5; i++)
{
byte b = Convert.ToByte(fiveBytesString.Substring((i * 8), 8), 2);
buffer[presentationTimeStampIndex + i] = b;
}
}
internal static bool IsPrivateStream2(byte[] buffer, int index)
{
return buffer.Length >= index + 3 &&
buffer[index + 0] == 0 &&
buffer[index + 1] == 0 &&
buffer[index + 2] == 1 &&
buffer[index + 3] == 0xbf;
}
private static bool IsSubtitlePack(byte[] buffer)
{
const int mpeg2HeaderLength = 14;
if (buffer[0] == 0 &&
buffer[1] == 0 &&
buffer[2] == 1 &&
buffer[3] == 0xba) // 186 - MPEG-2 Pack Header
{
if (buffer[mpeg2HeaderLength + 0] == 0 &&
buffer[mpeg2HeaderLength + 1] == 0 &&
buffer[mpeg2HeaderLength + 2] == 1 &&
buffer[mpeg2HeaderLength + 3] == 0xbd) // 189 - Private stream 1 (non MPEG audio, subpictures)
{
int pesHeaderDataLength = buffer[mpeg2HeaderLength + 8];
int streamId = buffer[mpeg2HeaderLength + 8 + 1 + pesHeaderDataLength];
if (streamId >= 0x20 && streamId <= 0x3f) // Subtitle IDs allowed (or x3f to x40?)
return true;
}
}
return false;
}
private void ButtonAddVobFileClick(object sender, EventArgs e)
{
openFileDialog1.Filter = _language.VobFiles + "|*.VOB";
openFileDialog1.FileName = string.Empty;
openFileDialog1.Multiselect = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK && File.Exists(openFileDialog1.FileName))
{
foreach (var fileName in openFileDialog1.FileNames)
{
listBoxVobFiles.Items.Add(fileName);
}
}
buttonStartRipping.Enabled = listBoxVobFiles.Items.Count > 0;
}
private void ButtonMoveVobUp_Click(object sender, EventArgs e)
{
if (listBoxVobFiles.SelectedIndex > -1 && listBoxVobFiles.SelectedIndex > 0)
{
int index = listBoxVobFiles.SelectedIndex;
string old = listBoxVobFiles.Items[index].ToString();
listBoxVobFiles.Items.RemoveAt(index);
listBoxVobFiles.Items.Insert(index - 1, old);
listBoxVobFiles.SelectedIndex = index - 1;
}
}
private void ButtonMoveVobDown_Click(object sender, EventArgs e)
{
if (listBoxVobFiles.SelectedIndex > -1 && listBoxVobFiles.SelectedIndex < listBoxVobFiles.Items.Count -1)
{
int index = listBoxVobFiles.SelectedIndex;
string old = listBoxVobFiles.Items[index].ToString();
listBoxVobFiles.Items.RemoveAt(index);
listBoxVobFiles.Items.Insert(index + 1, old);
listBoxVobFiles.SelectedIndex = index + 1;
}
}
private void ButtonRemoveVob_Click(object sender, EventArgs e)
{
if (listBoxVobFiles.SelectedIndex > -1)
{
int index = listBoxVobFiles.SelectedIndex;
listBoxVobFiles.Items.RemoveAt(index);
if (index < listBoxVobFiles.Items.Count)
listBoxVobFiles.SelectedIndex = index;
else if (index > 0)
listBoxVobFiles.SelectedIndex = index-1;
buttonStartRipping.Enabled = listBoxVobFiles.Items.Count > 0;
if (listBoxVobFiles.Items.Count == 0)
Clear();
}
}
private void TextBoxIfoFileNameDragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
e.Effect = DragDropEffects.All;
}
private void TextBoxIfoFileNameDragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
if (files.Length >= 1)
{
string fileName = files[0];
var fi = new FileInfo(fileName);
string ext = Path.GetExtension(fileName).ToLower();
if (fi.Length < 1024 * 1024 * 2) // max 2 mb
{
if (ext == ".ifo")
OpenIfoFile(fileName);
}
}
}
private void ListBoxVobFilesDragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
e.Effect = DragDropEffects.All;
}
private void ListBoxVobFilesDragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
e.Effect = DragDropEffects.All;
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string fileName in files)
{
string ext = Path.GetExtension(fileName).ToLower();
if (ext == ".vob")
listBoxVobFiles.Items.Add(fileName);
}
buttonStartRipping.Enabled = listBoxVobFiles.Items.Count > 0;
}
private void ButtonClearClick(object sender, EventArgs e)
{
Clear();
}
private void Clear()
{
textBoxIfoFileName.Text = string.Empty;
listBoxVobFiles.Items.Clear();
buttonStartRipping.Enabled = false;
comboBoxLanguages.Items.Clear();
labelIfoFile.Text = _language.IfoFile;
}
private void DvdSubRip_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
if (buttonStartRipping.Text == _language.Abort)
{
ButtonStartRippingClick(sender, e);
}
else
{
e.SuppressKeyPress = true;
DialogResult = DialogResult.Cancel;
}
}
}
}
}

123
src/Forms/DvdSubRip.resx Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,157 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class DvdSubRipChooseLanguage
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.listBox1 = new System.Windows.Forms.ListBox();
this.pictureBoxImage = new System.Windows.Forms.PictureBox();
this.comboBoxLanguages = new System.Windows.Forms.ComboBox();
this.labelChooseLanguage = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.groupBoxImage = new System.Windows.Forms.GroupBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxImage)).BeginInit();
this.groupBoxImage.SuspendLayout();
this.SuspendLayout();
//
// listBox1
//
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(5, 57);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(298, 212);
this.listBox1.TabIndex = 2;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1SelectedIndexChanged);
//
// pictureBoxImage
//
this.pictureBoxImage.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.pictureBoxImage.Location = new System.Drawing.Point(6, 19);
this.pictureBoxImage.Name = "pictureBoxImage";
this.pictureBoxImage.Size = new System.Drawing.Size(452, 214);
this.pictureBoxImage.TabIndex = 1;
this.pictureBoxImage.TabStop = false;
//
// comboBoxLanguages
//
this.comboBoxLanguages.FormattingEnabled = true;
this.comboBoxLanguages.Location = new System.Drawing.Point(6, 30);
this.comboBoxLanguages.Name = "comboBoxLanguages";
this.comboBoxLanguages.Size = new System.Drawing.Size(297, 21);
this.comboBoxLanguages.TabIndex = 1;
this.comboBoxLanguages.SelectedIndexChanged += new System.EventHandler(this.ComboBoxLanguagesSelectedIndexChanged);
//
// labelChooseLanguage
//
this.labelChooseLanguage.AutoSize = true;
this.labelChooseLanguage.Location = new System.Drawing.Point(6, 11);
this.labelChooseLanguage.Name = "labelChooseLanguage";
this.labelChooseLanguage.Size = new System.Drawing.Size(141, 13);
this.labelChooseLanguage.TabIndex = 3;
this.labelChooseLanguage.Text = "Choose language (stream-id)";
//
// 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(692, 281);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 4;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(611, 281);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 3;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// groupBoxImage
//
this.groupBoxImage.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.groupBoxImage.Controls.Add(this.pictureBoxImage);
this.groupBoxImage.Location = new System.Drawing.Point(309, 30);
this.groupBoxImage.Name = "groupBoxImage";
this.groupBoxImage.Size = new System.Drawing.Size(464, 239);
this.groupBoxImage.TabIndex = 14;
this.groupBoxImage.TabStop = false;
this.groupBoxImage.Text = "Subtitle image";
//
// DvdSubRipChooseLanguage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(779, 314);
this.Controls.Add(this.groupBoxImage);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelChooseLanguage);
this.Controls.Add(this.comboBoxLanguages);
this.Controls.Add(this.listBox1);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(700, 350);
this.Name = "DvdSubRipChooseLanguage";
this.ShowIcon = false;
this.Text = "Choose language";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DvdSubRipShowSubtitles_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxImage)).EndInit();
this.groupBoxImage.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.PictureBox pictureBoxImage;
private System.Windows.Forms.ComboBox comboBoxLanguages;
private System.Windows.Forms.Label labelChooseLanguage;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.GroupBox groupBoxImage;
}
}

View File

@ -0,0 +1,157 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic.VobSub;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class DvdSubRipChooseLanguage : Form
{
class SubListBoxItem
{
public string Name { get; set; }
public VobSubMergedPack SubPack { get; set; }
public override string ToString()
{
return Name;
}
public SubListBoxItem(string name, VobSubMergedPack subPack)
{
Name = name;
SubPack = subPack;
}
}
List<VobSubMergedPack> _mergedVobSubPacks;
List<Color> _palette;
public List<VobSubMergedPack> SelectedVobSubMergedPacks { get; private set; }
public DvdSubRipChooseLanguage()
{
InitializeComponent();
Text = Configuration.Settings.Language.DvdSubRipChooseLanguage.Title;
labelChooseLanguage.Text = Configuration.Settings.Language.DvdSubRipChooseLanguage.ChooseLanguageStreamId;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
internal void Initialize(List<VobSubMergedPack> mergedVobSubPacks, List<Color> palette, List<string> languages, string selectedLanguage)
{
_mergedVobSubPacks = mergedVobSubPacks;
_palette = palette;
List<int> uniqueLanguageStreamIds = new List<int>();
foreach (var pack in mergedVobSubPacks)
{
if (!uniqueLanguageStreamIds.Contains(pack.StreamId))
uniqueLanguageStreamIds.Add(pack.StreamId);
}
comboBoxLanguages.Items.Clear();
foreach (string languageName in languages)
{
if (uniqueLanguageStreamIds.Contains(GetLanguageIdFromString(languageName))) // only list languages actually found in vob
{
comboBoxLanguages.Items.Add(languageName);
if (languageName == selectedLanguage)
comboBoxLanguages.SelectedIndex = comboBoxLanguages.Items.Count - 1;
uniqueLanguageStreamIds.Remove(GetLanguageIdFromString(languageName));
}
}
foreach (var existingLanguageId in uniqueLanguageStreamIds)
comboBoxLanguages.Items.Add(string.Format(Configuration.Settings.Language.DvdSubRipChooseLanguage.UnknownLanguage + " (0x{0:x})", existingLanguageId)); // subtitle track not supplied from IFO
if (comboBoxLanguages.Items.Count > 0 && comboBoxLanguages.SelectedIndex < 0)
comboBoxLanguages.SelectedIndex = 0;
}
private static string ShowInSrtFormat(TimeSpan ts)
{
return string.Format("{0:00}:{1:00}:{2:00},{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds);
}
private void ListBox1SelectedIndexChanged(object sender, EventArgs e)
{
SubListBoxItem x = listBox1.Items[listBox1.SelectedIndex] as SubListBoxItem;
Bitmap bmp = x.SubPack.SubPicture.GetBitmap(_palette, Color.Transparent, Color.Wheat, Color.Black, Color.DarkGray);
if (bmp.Width > pictureBoxImage.Width || bmp.Height > pictureBoxImage.Height)
{
float width = bmp.Width;
float height = bmp.Height;
while (width > pictureBoxImage.Width || height > pictureBoxImage.Height)
{
width = width * 95 / 100;
height = height * 95 / 100;
}
Bitmap temp = new Bitmap((int)width, (int)height);
using (Graphics g = Graphics.FromImage((Image)temp))
g.DrawImage(bmp, 0, 0, (int)width, (int)height);
bmp = temp;
}
pictureBoxImage.Image = bmp;
groupBoxImage.Text = string.Format(Configuration.Settings.Language.DvdSubRipChooseLanguage.SubtitleImageXofYAndWidthXHeight, listBox1.SelectedIndex + 1, listBox1.Items.Count, bmp.Width, bmp.Height);
}
private static int GetLanguageIdFromString(string currentLanguage)
{
currentLanguage = currentLanguage.Substring(currentLanguage.IndexOf("0x") + 2).TrimEnd(')');
return Convert.ToInt32(currentLanguage, 16);
}
private void ComboBoxLanguagesSelectedIndexChanged(object sender, EventArgs e)
{
int chosenStreamId = GetLanguageIdFromString(comboBoxLanguages.Items[comboBoxLanguages.SelectedIndex].ToString());
listBox1.Items.Clear();
for (int i = 0; i < _mergedVobSubPacks.Count; i++)
{
var x = _mergedVobSubPacks[i];
if (x.StreamId == chosenStreamId)
{
string s = string.Format("#{0:000}: Stream-id=0X{1:X} - {2} --> {3}", i, x.StreamId, ShowInSrtFormat(x.StartTime), ShowInSrtFormat(x.EndTime));
listBox1.Items.Add(new SubListBoxItem(s, x));
}
}
if (listBox1.Items.Count > 0)
listBox1.SelectedIndex = 0;
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (listBox1.Items.Count > -1)
{
SelectedVobSubMergedPacks = new List<VobSubMergedPack>();
foreach (var x in listBox1.Items)
{
SelectedVobSubMergedPacks.Add((x as SubListBoxItem).SubPack);
}
DialogResult = DialogResult.OK;
}
}
private void ButtonCancelClick(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void DvdSubRipShowSubtitles_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
e.SuppressKeyPress = true;
DialogResult = DialogResult.Cancel;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

229
src/Forms/EffectKaraoke.Designer.cs generated Normal file
View File

@ -0,0 +1,229 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class EffectKaraoke
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.labelTotalMillisecs = new System.Windows.Forms.Label();
this.labelTM = new System.Windows.Forms.Label();
this.numericUpDownDelay = new System.Windows.Forms.NumericUpDown();
this.labelColor = new System.Windows.Forms.Label();
this.labelEndDelay = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonChooseColor = new System.Windows.Forms.Button();
this.panelColor = new System.Windows.Forms.Panel();
this.labelChooseColor = new System.Windows.Forms.Label();
this.buttonPreview = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.richTextBoxPreview = new System.Windows.Forms.RichTextBox();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).BeginInit();
this.SuspendLayout();
//
// labelTotalMillisecs
//
this.labelTotalMillisecs.AutoSize = true;
this.labelTotalMillisecs.Location = new System.Drawing.Point(120, 57);
this.labelTotalMillisecs.Name = "labelTotalMillisecs";
this.labelTotalMillisecs.Size = new System.Drawing.Size(92, 13);
this.labelTotalMillisecs.TabIndex = 49;
this.labelTotalMillisecs.Text = "labelTotalMillisecs";
//
// labelTM
//
this.labelTM.AutoSize = true;
this.labelTM.Location = new System.Drawing.Point(44, 56);
this.labelTM.Name = "labelTM";
this.labelTM.Size = new System.Drawing.Size(78, 13);
this.labelTM.TabIndex = 48;
this.labelTM.Text = "Total millisecs.:";
//
// numericUpDownDelay
//
this.numericUpDownDelay.DecimalPlaces = 3;
this.numericUpDownDelay.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numericUpDownDelay.Location = new System.Drawing.Point(123, 77);
this.numericUpDownDelay.Maximum = new decimal(new int[] {
99999,
0,
0,
0});
this.numericUpDownDelay.Minimum = new decimal(new int[] {
99999,
0,
0,
-2147483648});
this.numericUpDownDelay.Name = "numericUpDownDelay";
this.numericUpDownDelay.Size = new System.Drawing.Size(54, 20);
this.numericUpDownDelay.TabIndex = 47;
//
// labelColor
//
this.labelColor.AutoSize = true;
this.labelColor.Location = new System.Drawing.Point(180, 22);
this.labelColor.Name = "labelColor";
this.labelColor.Size = new System.Drawing.Size(31, 13);
this.labelColor.TabIndex = 46;
this.labelColor.Text = "Color";
//
// labelEndDelay
//
this.labelEndDelay.AutoSize = true;
this.labelEndDelay.Location = new System.Drawing.Point(10, 78);
this.labelEndDelay.Name = "labelEndDelay";
this.labelEndDelay.Size = new System.Drawing.Size(112, 13);
this.labelEndDelay.TabIndex = 45;
this.labelEndDelay.Text = "End delay in millisecs.:";
//
// buttonCancel
//
this.buttonCancel.BackColor = System.Drawing.SystemColors.Control;
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(353, 181);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 44;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = false;
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(272, 181);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 43;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonChooseColor
//
this.buttonChooseColor.Location = new System.Drawing.Point(121, 17);
this.buttonChooseColor.Name = "buttonChooseColor";
this.buttonChooseColor.Size = new System.Drawing.Size(27, 23);
this.buttonChooseColor.TabIndex = 42;
this.buttonChooseColor.Text = "...";
this.buttonChooseColor.UseVisualStyleBackColor = true;
this.buttonChooseColor.Click += new System.EventHandler(this.ButtonChooseColorClick);
//
// panelColor
//
this.panelColor.Location = new System.Drawing.Point(154, 19);
this.panelColor.Name = "panelColor";
this.panelColor.Size = new System.Drawing.Size(20, 20);
this.panelColor.TabIndex = 41;
//
// labelChooseColor
//
this.labelChooseColor.AutoSize = true;
this.labelChooseColor.Location = new System.Drawing.Point(50, 22);
this.labelChooseColor.Name = "labelChooseColor";
this.labelChooseColor.Size = new System.Drawing.Size(72, 13);
this.labelChooseColor.TabIndex = 40;
this.labelChooseColor.Text = "Choose color:";
//
// buttonPreview
//
this.buttonPreview.Location = new System.Drawing.Point(12, 154);
this.buttonPreview.Name = "buttonPreview";
this.buttonPreview.Size = new System.Drawing.Size(75, 21);
this.buttonPreview.TabIndex = 39;
this.buttonPreview.Text = "Preview";
this.buttonPreview.UseVisualStyleBackColor = true;
this.buttonPreview.Click += new System.EventHandler(this.ButtonPreviewClick);
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.Timer1Tick);
//
// richTextBoxPreview
//
this.richTextBoxPreview.BackColor = System.Drawing.Color.Black;
this.richTextBoxPreview.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBoxPreview.DetectUrls = false;
this.richTextBoxPreview.Location = new System.Drawing.Point(13, 99);
this.richTextBoxPreview.Name = "richTextBoxPreview";
this.richTextBoxPreview.ReadOnly = true;
this.richTextBoxPreview.Size = new System.Drawing.Size(415, 49);
this.richTextBoxPreview.TabIndex = 50;
this.richTextBoxPreview.TabStop = false;
this.richTextBoxPreview.Text = "";
//
// EffectKaraoke
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(440, 208);
this.Controls.Add(this.richTextBoxPreview);
this.Controls.Add(this.labelTotalMillisecs);
this.Controls.Add(this.labelTM);
this.Controls.Add(this.numericUpDownDelay);
this.Controls.Add(this.labelColor);
this.Controls.Add(this.labelEndDelay);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonChooseColor);
this.Controls.Add(this.panelColor);
this.Controls.Add(this.labelChooseColor);
this.Controls.Add(this.buttonPreview);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EffectKaraoke";
this.Text = "Karaoke effect";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormEffectkaraoke_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelTotalMillisecs;
private System.Windows.Forms.Label labelTM;
private System.Windows.Forms.NumericUpDown numericUpDownDelay;
private System.Windows.Forms.Label labelColor;
private System.Windows.Forms.Label labelEndDelay;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonChooseColor;
private System.Windows.Forms.Panel panelColor;
private System.Windows.Forms.Label labelChooseColor;
private System.Windows.Forms.Button buttonPreview;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.RichTextBox richTextBoxPreview;
}
}

328
src/Forms/EffectKaraoke.cs Normal file
View File

@ -0,0 +1,328 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class EffectKaraoke : Form
{
Paragraph _paragraph;
List<Paragraph> _animation;
int _timerCount;
public EffectKaraoke()
{
InitializeComponent();
Text = Configuration.Settings.Language.EffectKaraoke.Title;
labelChooseColor.Text = Configuration.Settings.Language.EffectKaraoke.ChooseColor;
labelTM.Text = Configuration.Settings.Language.EffectKaraoke.TotalMilliseconds;
labelEndDelay.Text = Configuration.Settings.Language.EffectKaraoke.EndDelayInMilliseconds;
buttonPreview.Text = Configuration.Settings.Language.General.Preview;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private void FormEffectkaraoke_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
internal void Initialize(Paragraph paragraph)
{
_paragraph = paragraph;
_animation = new List<Paragraph>();
colorDialog1.Color = Color.Red;
labelColor.Text = Utilities.ColorToHex(colorDialog1.Color);
panelColor.BackColor = colorDialog1.Color;
AddToPreview(richTextBoxPreview, paragraph.Text);
RefreshPreview();
labelTotalMillisecs.Text = string.Format("{0:#,##0.000}", paragraph.Duration.TotalMilliseconds / 1000);
numericUpDownDelay.Maximum = (int)((paragraph.Duration.TotalMilliseconds - 500) / 1000);
numericUpDownDelay.Minimum = 0;
}
private void AddToPreview(RichTextBox rtb, string text)
{
richTextBoxPreview.ForeColor = Color.White;
int bold = 0;
int underline = 0;
int italic = 0;
Stack<string> fontColors = new Stack<string>();
string currentColor = string.Empty;
StringBuilder sb = new StringBuilder();
int i = 0;
while (i < text.Length)
{
if (text[i] == '<')
{
AddTextToRichTextBox(rtb, bold > 0, italic > 0, underline > 0, currentColor, sb.ToString());
sb = new StringBuilder();
string tag = GetTag(text.Substring(i).ToLower());
if (i + 1 < text.Length && text[i+1] == '/')
{ //
if (tag == "</i>" && italic > 0)
italic--;
else if (tag == "</b>" && bold > 0)
bold--;
else if (tag == "<u>" && underline > 0)
underline--;
else if (tag == "</font>")
{
if (fontColors.Count > 0)
currentColor = fontColors.Pop();
else
currentColor = string.Empty;
}
}
else
{
if (tag == "<i>")
italic++;
else if (tag == "<b>")
bold++;
else if (tag == "<u>")
underline++;
else if (tag.StartsWith("<font "))
{
const string colorTag = " color=";
if (tag.Contains(colorTag))
{
string tempColor = string.Empty;
int start = tag.IndexOf(colorTag);
int j = start + colorTag.Length;
if ("\"'".Contains(tag[j].ToString()))
j++;
while (j < tag.Length && ("#" + Utilities.GetLetters(false, true, true)).Contains(tag[j].ToString()))
{
tempColor += tag[j].ToString();
j++;
}
if (!string.IsNullOrEmpty(currentColor))
fontColors.Push(currentColor);
currentColor = tempColor;
}
}
}
i += tag.Length;
}
else
{
sb.Append(text[i]);
i++;
}
}
if (sb.Length > 0)
AddTextToRichTextBox(rtb, bold > 0, italic > 0, underline > 0, currentColor, sb.ToString());
}
private void AddTextToRichTextBox(RichTextBox rtb, bool bold, bool italic, bool underline, string color, string text)
{
if (text.Length > 0)
{
int length = rtb.Text.Length;
richTextBoxPreview.Text += text;
rtb.SelectionStart = length;
rtb.SelectionLength = text.Length;
if (!string.IsNullOrEmpty(color))
rtb.SelectionColor = ColorTranslator.FromHtml(color);
else
rtb.SelectionColor = Color.White;
FontStyle fontStyle = new FontStyle();
if (underline)
fontStyle = fontStyle | FontStyle.Underline;
if (italic)
fontStyle = fontStyle | FontStyle.Italic;
if (bold)
fontStyle = fontStyle | FontStyle.Bold;
rtb.SelectionFont = new Font(rtb.Font.FontFamily, rtb.Font.Size, fontStyle);
}
}
private static string GetTag(string text)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < text.Length; i++)
{
sb.Append(text[i]);
if (text[i] == '>')
return sb.ToString();
}
return sb.ToString();
}
private void ClearPreview()
{
richTextBoxPreview.Text = string.Empty;
}
private void RefreshPreview()
{
richTextBoxPreview.SelectAll();
richTextBoxPreview.SelectionAlignment = HorizontalAlignment.Center;
richTextBoxPreview.Refresh();
}
private void ButtonChooseColorClick(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
labelColor.Text = Utilities.ColorToHex(colorDialog1.Color);
panelColor.BackColor = colorDialog1.Color;
}
}
private void ButtonPreviewClick(object sender, EventArgs e)
{
MakeAnimation();
PlayAnimation();
}
private void PlayAnimation()
{
_timerCount = (int)_paragraph.StartTime.TotalMilliseconds;
timer1.Start();
}
private static double CalculateStepLength(string text, double duration)
{
text = Utilities.RemoveHtmlTags(text);
return duration / text.Length;
}
public List<Paragraph> MakeAnimation(Paragraph paragraph)
{
_paragraph = paragraph;
MakeAnimation();
return _animation;
}
private void MakeAnimation()
{
_animation = new List<Paragraph>();
double duration = _paragraph.Duration.TotalMilliseconds - ((double)numericUpDownDelay.Value * 1000.0);
double stepsLength = CalculateStepLength(_paragraph.Text, duration);
double startMilliseconds;
double endMilliseconds;
TimeSpan start;
TimeSpan end;
int index = 0;
string text = string.Empty;
bool tagOn = false;
string tag = string.Empty;
int i = 0;
string startFontTag = string.Format("<font color=\"{0}\">", Utilities.ColorToHex(panelColor.BackColor));
const string endFontTag = "</font>";
while (i < _paragraph.Text.Length)
{
if (tagOn)
{
if (_paragraph.Text[i] == '>')
tagOn = false;
tag += _paragraph.Text[i];
}
else if (_paragraph.Text[i] == '<')
{
tagOn = true;
tag += _paragraph.Text[i];
}
else
{
text += tag + _paragraph.Text[i];
tag = string.Empty;
//end tag
if (i + 2 < _paragraph.Text.Length &&
_paragraph.Text[i + 1] == '<' &&
_paragraph.Text[i + 2] == '/')
{
while (i < _paragraph.Text.Length && _paragraph.Text[i] != '>')
{
tag += _paragraph.Text[i];
i++;
}
text += tag;
}
string tempText = startFontTag + text + endFontTag;
if (i + 1 < _paragraph.Text.Length)
tempText += _paragraph.Text.Substring(i + 1);
startMilliseconds = index * stepsLength;
startMilliseconds += _paragraph.StartTime.TotalMilliseconds;
endMilliseconds = ((index + 1) * stepsLength) - 1;
endMilliseconds += _paragraph.StartTime.TotalMilliseconds;
start = TimeSpan.FromMilliseconds(startMilliseconds);
end = TimeSpan.FromMilliseconds(endMilliseconds);
_animation.Add(new Paragraph(new TimeCode(start), new TimeCode(end), tempText));
index++;
}
i++;
}
if (numericUpDownDelay.Value > 0)
{
startMilliseconds = index * stepsLength;
startMilliseconds += _paragraph.StartTime.TotalMilliseconds;
endMilliseconds = _paragraph.EndTime.TotalMilliseconds;
start = TimeSpan.FromMilliseconds(startMilliseconds);
end = TimeSpan.FromMilliseconds(endMilliseconds);
_animation.Add(new Paragraph(new TimeCode(start), new TimeCode(end), startFontTag + _paragraph.Text + endFontTag));
}
else if (_animation.Count > 0)
{
_animation[_animation.Count - 1].EndTime.TotalMilliseconds = _paragraph.EndTime.TotalMilliseconds;
}
}
private void Timer1Tick(object sender, EventArgs e)
{
_timerCount += timer1.Interval;
string s = GetText(_timerCount, _animation);
ClearPreview();
AddToPreview(richTextBoxPreview, s);
RefreshPreview();
if (_timerCount > _paragraph.EndTime.TotalMilliseconds)
{
timer1.Stop();
System.Threading.Thread.Sleep(200);
ClearPreview();
AddToPreview(richTextBoxPreview, _paragraph.Text);
}
}
private static string GetText(int milliseconds, IEnumerable<Paragraph> animation)
{
foreach (Paragraph p in animation)
{
if (p.StartTime.TotalMilliseconds <= milliseconds &&
p.EndTime.TotalMilliseconds >= milliseconds)
{
return p.Text;
}
}
return string.Empty;
}
private void ButtonOkClick(object sender, EventArgs e)
{
MakeAnimation();
DialogResult = DialogResult.OK;
}
}
}

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
</root>

180
src/Forms/EffectTypewriter.Designer.cs generated Normal file
View File

@ -0,0 +1,180 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class EffectTypewriter
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.labelPreview = new System.Windows.Forms.Label();
this.buttonPreview = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.labelEndDelay = new System.Windows.Forms.Label();
this.numericUpDownDelay = new System.Windows.Forms.NumericUpDown();
this.labelTM = new System.Windows.Forms.Label();
this.labelTotalMillisecs = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).BeginInit();
this.SuspendLayout();
//
// labelPreview
//
this.labelPreview.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.labelPreview.BackColor = System.Drawing.Color.Black;
this.labelPreview.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelPreview.ForeColor = System.Drawing.Color.White;
this.labelPreview.Location = new System.Drawing.Point(12, 72);
this.labelPreview.Name = "labelPreview";
this.labelPreview.Size = new System.Drawing.Size(409, 40);
this.labelPreview.TabIndex = 25;
this.labelPreview.Text = "labelPreview";
this.labelPreview.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// buttonPreview
//
this.buttonPreview.Location = new System.Drawing.Point(12, 115);
this.buttonPreview.Name = "buttonPreview";
this.buttonPreview.Size = new System.Drawing.Size(75, 21);
this.buttonPreview.TabIndex = 26;
this.buttonPreview.Text = "Preview";
this.buttonPreview.UseVisualStyleBackColor = true;
this.buttonPreview.Click += new System.EventHandler(this.ButtonPreviewClick);
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(265, 148);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 30;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(346, 148);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 31;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.Timer1Tick);
//
// labelEndDelay
//
this.labelEndDelay.AutoSize = true;
this.labelEndDelay.Location = new System.Drawing.Point(17, 44);
this.labelEndDelay.Name = "labelEndDelay";
this.labelEndDelay.Size = new System.Drawing.Size(112, 13);
this.labelEndDelay.TabIndex = 32;
this.labelEndDelay.Text = "End delay in millisecs.:";
//
// numericUpDownDelay
//
this.numericUpDownDelay.DecimalPlaces = 3;
this.numericUpDownDelay.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numericUpDownDelay.Location = new System.Drawing.Point(130, 43);
this.numericUpDownDelay.Maximum = new decimal(new int[] {
99999,
0,
0,
0});
this.numericUpDownDelay.Minimum = new decimal(new int[] {
99999,
0,
0,
-2147483648});
this.numericUpDownDelay.Name = "numericUpDownDelay";
this.numericUpDownDelay.Size = new System.Drawing.Size(54, 20);
this.numericUpDownDelay.TabIndex = 35;
//
// labelTM
//
this.labelTM.AutoSize = true;
this.labelTM.Location = new System.Drawing.Point(51, 22);
this.labelTM.Name = "labelTM";
this.labelTM.Size = new System.Drawing.Size(78, 13);
this.labelTM.TabIndex = 36;
this.labelTM.Text = "Total millisecs.:";
//
// labelTotalMillisecs
//
this.labelTotalMillisecs.AutoSize = true;
this.labelTotalMillisecs.Location = new System.Drawing.Point(127, 23);
this.labelTotalMillisecs.Name = "labelTotalMillisecs";
this.labelTotalMillisecs.Size = new System.Drawing.Size(92, 13);
this.labelTotalMillisecs.TabIndex = 37;
this.labelTotalMillisecs.Text = "labelTotalMillisecs";
//
// EffectTypewriter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(433, 179);
this.Controls.Add(this.labelTotalMillisecs);
this.Controls.Add(this.labelTM);
this.Controls.Add(this.numericUpDownDelay);
this.Controls.Add(this.labelEndDelay);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonPreview);
this.Controls.Add(this.labelPreview);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EffectTypewriter";
this.Text = "Typewriter effect";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormEffectTypewriter_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDelay)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelPreview;
private System.Windows.Forms.Button buttonPreview;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label labelEndDelay;
private System.Windows.Forms.NumericUpDown numericUpDownDelay;
private System.Windows.Forms.Label labelTM;
private System.Windows.Forms.Label labelTotalMillisecs;
}
}

View File

@ -0,0 +1,178 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class EffectTypewriter : Form
{
Paragraph _paragraph;
List<Paragraph> _animation;
int _timerCount;
public EffectTypewriter()
{
InitializeComponent();
Text = Configuration.Settings.Language.EffectKaraoke.Title;
labelTM.Text = Configuration.Settings.Language.EffectKaraoke.TotalMilliseconds;
labelEndDelay.Text = Configuration.Settings.Language.EffectKaraoke.EndDelayInMilliseconds;
buttonPreview.Text = Configuration.Settings.Language.General.Preview;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public List<Paragraph> TypewriterParagraphs
{
get
{
return _animation;
}
}
private void FormEffectTypewriter_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
internal void Initialize(Paragraph paragraph)
{
_paragraph = paragraph;
labelPreview.Text = paragraph.Text;
labelTotalMillisecs.Text = string.Format("{0:#,##0.000}", paragraph.Duration.TotalMilliseconds / 1000);
numericUpDownDelay.Maximum = (decimal)((paragraph.Duration.TotalMilliseconds - 500) / 1000);
numericUpDownDelay.Minimum = 0;
}
private void ButtonPreviewClick(object sender, EventArgs e)
{
MakeAnimation();
PlayAnimation();
}
private void PlayAnimation()
{
_timerCount = (int)_paragraph.StartTime.TotalMilliseconds;
timer1.Start();
}
private static double CalculateStepLength(string text, double duration)
{
text = Utilities.RemoveHtmlTags(text);
return duration / text.Length;
}
private void MakeAnimation()
{
_animation = new List<Paragraph>();
double duration = _paragraph.Duration.TotalMilliseconds - ((double)numericUpDownDelay.Value * 1000.0);
double stepsLength = CalculateStepLength(_paragraph.Text, duration);
double startMilliseconds;
double endMilliseconds;
TimeSpan start;
TimeSpan end;
int index = 0;
string text = string.Empty;
bool tagOn = false;
string tag = string.Empty;
int i = 0;
while (i < _paragraph.Text.Length)
{
if (tagOn)
{
if (_paragraph.Text[i] == '>')
tagOn = false;
tag += _paragraph.Text[i];
}
else if (_paragraph.Text[i] == '<')
{
tagOn = true;
tag += _paragraph.Text[i];
}
else
{
text += tag + _paragraph.Text[i];
tag = string.Empty;
//end tag
if (i + 2 < _paragraph.Text.Length &&
_paragraph.Text[i + 1] == '<' &&
_paragraph.Text[i + 2] == '/')
{
while (i < _paragraph.Text.Length && _paragraph.Text[i] != '>')
{
tag += _paragraph.Text[i];
i++;
}
text += tag;
}
startMilliseconds = index * stepsLength;
startMilliseconds += _paragraph.StartTime.TotalMilliseconds;
endMilliseconds = ((index + 1) * stepsLength) -1;
endMilliseconds += _paragraph.StartTime.TotalMilliseconds;
start = TimeSpan.FromMilliseconds(startMilliseconds);
end = TimeSpan.FromMilliseconds(endMilliseconds);
_animation.Add(new Paragraph(new TimeCode(start), new TimeCode(end), text));
index++;
}
i++;
}
if (numericUpDownDelay.Value > 0)
{
startMilliseconds = index * stepsLength;
startMilliseconds += _paragraph.StartTime.TotalMilliseconds;
endMilliseconds = _paragraph.EndTime.TotalMilliseconds;
start = TimeSpan.FromMilliseconds(startMilliseconds);
end = TimeSpan.FromMilliseconds(endMilliseconds);
_animation.Add(new Paragraph(new TimeCode(start), new TimeCode(end), _paragraph.Text));
}
else if (_animation.Count > 0)
{
_animation[_animation.Count - 1].EndTime.TotalMilliseconds = _paragraph.EndTime.TotalMilliseconds;
}
}
private void Timer1Tick(object sender, EventArgs e)
{
_timerCount += timer1.Interval;
string s = GetText(_timerCount, _animation);
labelPreview.Text = s;
labelPreview.Refresh();
if (_timerCount > _paragraph.EndTime.TotalMilliseconds)
{
timer1.Stop();
System.Threading.Thread.Sleep(200);
labelPreview.Text = _paragraph.Text;
}
}
private static string GetText(int milliseconds, IEnumerable<Paragraph> animation)
{
foreach (Paragraph p in animation)
{
if (p.StartTime.TotalMilliseconds <= milliseconds &&
p.EndTime.TotalMilliseconds >= milliseconds)
{
return p.Text;
}
}
return string.Empty;
}
private void ButtonOkClick(object sender, EventArgs e)
{
MakeAnimation();
DialogResult = DialogResult.OK;
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
</root>

137
src/Forms/FindDialog.Designer.cs generated Normal file
View File

@ -0,0 +1,137 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class FindDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindDialog));
this.textBoxFind = new System.Windows.Forms.TextBox();
this.buttonFind = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
this.radioButtonCaseSensitive = new System.Windows.Forms.RadioButton();
this.radioButtonRegEx = new System.Windows.Forms.RadioButton();
this.SuspendLayout();
//
// textBoxFind
//
this.textBoxFind.Location = new System.Drawing.Point(12, 12);
this.textBoxFind.Name = "textBoxFind";
this.textBoxFind.Size = new System.Drawing.Size(189, 20);
this.textBoxFind.TabIndex = 0;
this.textBoxFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxFindKeyDown);
//
// buttonFind
//
this.buttonFind.Location = new System.Drawing.Point(207, 11);
this.buttonFind.Name = "buttonFind";
this.buttonFind.Size = new System.Drawing.Size(75, 21);
this.buttonFind.TabIndex = 1;
this.buttonFind.Text = "Find";
this.buttonFind.UseVisualStyleBackColor = true;
this.buttonFind.Click += new System.EventHandler(this.ButtonFindClick);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(207, 36);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// radioButtonNormal
//
this.radioButtonNormal.AutoSize = true;
this.radioButtonNormal.Checked = true;
this.radioButtonNormal.Location = new System.Drawing.Point(12, 63);
this.radioButtonNormal.Name = "radioButtonNormal";
this.radioButtonNormal.Size = new System.Drawing.Size(58, 17);
this.radioButtonNormal.TabIndex = 5;
this.radioButtonNormal.TabStop = true;
this.radioButtonNormal.Text = "Normal";
this.radioButtonNormal.UseVisualStyleBackColor = true;
this.radioButtonNormal.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonCaseSensitive
//
this.radioButtonCaseSensitive.AutoSize = true;
this.radioButtonCaseSensitive.Location = new System.Drawing.Point(76, 63);
this.radioButtonCaseSensitive.Name = "radioButtonCaseSensitive";
this.radioButtonCaseSensitive.Size = new System.Drawing.Size(93, 17);
this.radioButtonCaseSensitive.TabIndex = 7;
this.radioButtonCaseSensitive.Text = "Case sensitive";
this.radioButtonCaseSensitive.UseVisualStyleBackColor = true;
this.radioButtonCaseSensitive.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonRegEx
//
this.radioButtonRegEx.AutoSize = true;
this.radioButtonRegEx.Location = new System.Drawing.Point(177, 63);
this.radioButtonRegEx.Name = "radioButtonRegEx";
this.radioButtonRegEx.Size = new System.Drawing.Size(57, 17);
this.radioButtonRegEx.TabIndex = 9;
this.radioButtonRegEx.Text = "RegEx";
this.radioButtonRegEx.UseVisualStyleBackColor = true;
this.radioButtonRegEx.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// FindDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(294, 88);
this.Controls.Add(this.radioButtonRegEx);
this.Controls.Add(this.radioButtonCaseSensitive);
this.Controls.Add(this.radioButtonNormal);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonFind);
this.Controls.Add(this.textBoxFind);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FindDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Find";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormFindDialog_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBoxFind;
private System.Windows.Forms.Button buttonFind;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.RadioButton radioButtonNormal;
private System.Windows.Forms.RadioButton radioButtonCaseSensitive;
private System.Windows.Forms.RadioButton radioButtonRegEx;
}
}

109
src/Forms/FindDialog.cs Normal file
View File

@ -0,0 +1,109 @@
using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.Enums;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class FindDialog : Form
{
private Regex _regEx;
public FindDialog()
{
InitializeComponent();
Text = Configuration.Settings.Language.FindDialog.Title;
buttonFind.Text = Configuration.Settings.Language.FindDialog.Find;
radioButtonNormal.Text = Configuration.Settings.Language.FindDialog.Normal;
radioButtonCaseSensitive.Text = Configuration.Settings.Language.FindDialog.CaseSensitive;
radioButtonRegEx.Text = Configuration.Settings.Language.FindDialog.RegularExpression;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
private FindType GetFindType()
{
if (radioButtonNormal.Checked)
return FindType.Normal;
if (radioButtonCaseSensitive.Checked)
return FindType.CaseSensitive;
return FindType.RegEx;
}
public FindReplaceDialogHelper GetFindDialogHelper(int startLineIndex)
{
return new FindReplaceDialogHelper(GetFindType(), textBoxFind.Text, _regEx, string.Empty, 200, 300, startLineIndex);
}
private void FormFindDialog_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
}
private void ButtonFindClick(object sender, EventArgs e)
{
string searchText = textBoxFind.Text.Trim();
if (searchText.Length == 0)
{
DialogResult = DialogResult.Cancel;
}
else if (radioButtonNormal.Checked)
{
DialogResult = DialogResult.OK;
}
else if (radioButtonCaseSensitive.Checked)
{
DialogResult = DialogResult.OK;
}
else if (radioButtonRegEx.Checked)
{
try
{
_regEx = new Regex(textBoxFind.Text, RegexOptions.Compiled);
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
}
}
private void TextBoxFindKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
ButtonFindClick(null, null);
}
private void RadioButtonCheckedChanged(object sender, EventArgs e)
{
if (sender == radioButtonRegEx)
textBoxFind.ContextMenu = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
else
textBoxFind.ContextMenuStrip = null;
}
internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper)
{
textBoxFind.Text = selectedText;
textBoxFind.SelectAll();
if (findHelper != null)
{
if (findHelper.FindType == FindType.RegEx)
radioButtonRegEx.Checked = true;
else if (findHelper.FindType == FindType.CaseSensitive)
radioButtonCaseSensitive.Checked = true;
else
radioButtonNormal.Checked = true;
}
}
}
}

197
src/Forms/FindDialog.resx Normal file
View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3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AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGBgYIMTEyTWNkZZaEhYfIjI6Q54iK
jPGAgoXqcXN1z1FSU58qKytcBwcHEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAQEBAQQBQUFFAQEBBMCAgIJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA////5////4P///+D///5A///8Af/8BAP/8AAH/8AAA/+AAAP/AAAD/gA
AB/wAAAf8AAAP+AAAB/gAAAf4AAAH8AAAB/AAAAfwAAAH8AAAB/AAAAfwAAAH+AAAB/gAAAf4AAAP/AA
AH/4AAB/+AAA//wAAf//AAP//4AP///wf/8=
</value>
</data>
</root>

146
src/Forms/FindSubtitleLine.Designer.cs generated Normal file
View File

@ -0,0 +1,146 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class FindSubtitleLine
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindSubtitleLine));
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonFind = new System.Windows.Forms.Button();
this.textBoxFindText = new System.Windows.Forms.TextBox();
this.buttonFindNext = new System.Windows.Forms.Button();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(428, 315);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 4;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(509, 315);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// buttonFind
//
this.buttonFind.Location = new System.Drawing.Point(196, 32);
this.buttonFind.Name = "buttonFind";
this.buttonFind.Size = new System.Drawing.Size(75, 21);
this.buttonFind.TabIndex = 1;
this.buttonFind.Text = "Find";
this.buttonFind.UseVisualStyleBackColor = true;
this.buttonFind.Click += new System.EventHandler(this.ButtonFindClick);
//
// textBoxFindText
//
this.textBoxFindText.Location = new System.Drawing.Point(12, 32);
this.textBoxFindText.Name = "textBoxFindText";
this.textBoxFindText.Size = new System.Drawing.Size(178, 20);
this.textBoxFindText.TabIndex = 0;
this.textBoxFindText.TextChanged += new System.EventHandler(this.TextBoxFindTextTextChanged);
this.textBoxFindText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxFindTextKeyDown);
//
// buttonFindNext
//
this.buttonFindNext.Location = new System.Drawing.Point(277, 32);
this.buttonFindNext.Name = "buttonFindNext";
this.buttonFindNext.Size = new System.Drawing.Size(75, 21);
this.buttonFindNext.TabIndex = 2;
this.buttonFindNext.Text = "Find next";
this.buttonFindNext.UseVisualStyleBackColor = true;
this.buttonFindNext.Click += new System.EventHandler(this.ButtonFindNextClick);
//
// subtitleListView1
//
this.subtitleListView1.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.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(12, 59);
this.subtitleListView1.MultiSelect = false;
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.Size = new System.Drawing.Size(572, 250);
this.subtitleListView1.TabIndex = 3;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubtitleListView1MouseDoubleClick);
//
// FindSubtitleLine
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(596, 345);
this.Controls.Add(this.buttonFindNext);
this.Controls.Add(this.textBoxFindText);
this.Controls.Add(this.buttonFind);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.subtitleListView1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FindSubtitleLine";
this.Text = "Find subtitle line";
this.Load += new System.EventHandler(this.FormFindSubtitleLine_Load);
this.Shown += new System.EventHandler(this.FormFindSubtitleLine_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormFindSubtitleLine_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private SubtitleListView subtitleListView1;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonFind;
private System.Windows.Forms.TextBox textBoxFindText;
private System.Windows.Forms.Button buttonFindNext;
}
}

View File

@ -0,0 +1,171 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class FindSubtitleLine : Form
{
int _startFindIndex = -1;
List<Paragraph> _paragraphs = new List<Paragraph>();
public int SelectedIndex
{
get;
set;
}
public FindSubtitleLine()
{
InitializeComponent();
Text = Configuration.Settings.Language.FindSubtitleLine.Title;
buttonFind.Text = Configuration.Settings.Language.FindSubtitleLine.Find;
buttonFindNext.Text = Configuration.Settings.Language.FindSubtitleLine.FindNext;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
public void Initialize(List<Paragraph> paragraphs, string appendTitle)
{
Text += appendTitle;
_paragraphs = paragraphs;
subtitleListView1.Fill(paragraphs);
_startFindIndex = -1;
}
private void ButtonFindClick(object sender, EventArgs e)
{
_startFindIndex = -1;
FindText();
}
private void FindText()
{
if (textBoxFindText.Text.Trim().Length > 0)
{
int index = 0;
foreach (Paragraph p in _paragraphs)
{
if (index > _startFindIndex)
{
if (p.Text.ToLower().Contains(textBoxFindText.Text.ToLower()))
{
subtitleListView1.Items[index].Selected = true;
subtitleListView1.HideSelection = false;
subtitleListView1.Items[index].EnsureVisible();
_startFindIndex = index;
return;
}
}
index++;
}
}
}
private void ButtonCancelClick(object sender, EventArgs e)
{
SelectedIndex = -1;
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (subtitleListView1.SelectedItems.Count > 0)
{
SelectedIndex = subtitleListView1.SelectedItems[0].Index;
}
else
{
SelectedIndex = -1;
}
}
private void TextBoxFindTextKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
ButtonFindClick(sender, null);
}
private void TextBoxFindTextTextChanged(object sender, EventArgs e)
{
_startFindIndex = -1;
}
private void ButtonFindNextClick(object sender, EventArgs e)
{
FindText();
}
private void FormFindSubtitleLine_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F3)
FindText();
else if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
else if (e.KeyCode == Keys.Down && e.Alt)
{
int selectedIndex = 0;
if (subtitleListView1.SelectedItems.Count > 0)
{
selectedIndex = subtitleListView1.SelectedItems[0].Index;
selectedIndex++;
}
subtitleListView1.SelectIndexAndEnsureVisible(selectedIndex);
}
else if (e.KeyCode == Keys.Up && e.Alt)
{
int selectedIndex = 0;
if (subtitleListView1.SelectedItems.Count > 0)
{
selectedIndex = subtitleListView1.SelectedItems[0].Index;
selectedIndex--;
}
subtitleListView1.SelectIndexAndEnsureVisible(selectedIndex);
}
else if (e.KeyCode == Keys.Home && e.Alt)
{
subtitleListView1.SelectIndexAndEnsureVisible(0);
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.End && e.Alt)
{
subtitleListView1.SelectIndexAndEnsureVisible(subtitleListView1.Items.Count - 1);
e.SuppressKeyPress = true;
}
else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.G && subtitleListView1.Items.Count > 1)
{
var goToLine = new GoToLine();
goToLine.Initialize(1, subtitleListView1.Items.Count);
if (goToLine.ShowDialog(this) == DialogResult.OK)
{
subtitleListView1.SelectNone();
subtitleListView1.Items[goToLine.LineNumber - 1].Selected = true;
subtitleListView1.Items[goToLine.LineNumber - 1].EnsureVisible();
}
}
}
private void FormFindSubtitleLine_Load(object sender, EventArgs e)
{
if (textBoxFindText.CanFocus)
textBoxFindText.Focus();
}
private void FormFindSubtitleLine_Shown(object sender, EventArgs e)
{
if (textBoxFindText.CanFocus)
textBoxFindText.Focus();
}
private void SubtitleListView1MouseDoubleClick(object sender, MouseEventArgs e)
{
ButtonOkClick(null, null);
Close();
}
}
}

View File

@ -0,0 +1,546 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAkAMDAQAAEABABoBgAAlgAAACAgEAABAAQA6AIAAP4GAAAQEBAAAQAEACgBAADmCQAAMDAAAAEA
CACoDgAADgsAACAgAAABAAgAqAgAALYZAAAQEAAAAQAIAGgFAABeIgAAMDAAAAEAIACoJQAAxicAACAg
AAABACAAqBAAAG5NAAAQEAAAAQAgAGgEAAAWXgAAKAAAADAAAABgAAAAAQAEAAAAAACABAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAACAgIAAwMDAAAAA/wAA/wAAAP//AP8A
AAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAHd3AAAAAAAAAAAAAAAAAAAAAAAAAAAAB4d3d3d3cAAAAAAAAAAAAAAAAAAAAHd3d3d3iI
iIiHh4cAAAAAAAAAAAAAAAd3d3d3d3d4eIiIh4eHd4AAAAAAAAAAAHd3eHd3d3d3d3d3iIiIiHcAAAAA
AAAAB3d4iPiIiIeHd3d4d3eHh3cAAAAAAAAAB3eIiIiIiIiIiIh3eHd3d3d3cAAAAAAAd3iHd3eIiI+P
+PiIh4d3d3d3d3AAAAAHd3d3AHcHd3d4iIj4+I+IiHh3d3cAAAAHd3dwBwBwcHB3d4iIiPj4iIiHh3dw
AAAHd3cAcHBwcHBwcHB3d3eIiPj/h3d3AAAHd3AHAHBwcHBwcHBwcHd3d3d4j4dwcAAHd3cAcHAHBwcH
B3BwdwcHB3d3j4h3cAAHdw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/1JSUv9SUlL/UlJS/1JS
Uv9RUVH/UVFR/1FRUf9RUVH/UFBQ/1BQUP9LS0v/U1NT/2hoaP+tra3/srKy/3h4eP94eHj/b29v+V9f
X+8jIyN8BQUFQzQ0NE1hYWHDeHh4/3l5ef9lZWX/SUlJ/ycnJ/8xMTH/ODg4/zs7O/88PDz/PT09/z8/
P/9BQUH/RERE/8HBwf////////////////9MTEz/Tk5O/1BQUP9QUFD/UVFR////////////UlJS/1JS
Uv9SUlL/UlJS/1JSUv9RUVH/UVFR/1FRUf9RUVH/UFBQ/1BQUP9LS0v/U1NT/2hoaP+tra3/srKy/3h4
eP94eHj/cHBw+WBgYO8jIyN8BQUFQzU1NU5iYmLEeHh4/3l5ef9lZWX/SUlJ/yYmJv8xMTH/ODg4/zs7
O/9mZmb/fX19/39/f/+AgID/gYGB/8HBwf/BwcH/wsLC/8LCwv9MTEz/TU1N/09PT/9QUFD/UVFR////
////////i4uL/4uLi/+Li4v/i4uL/4uLi/+Li4v/i4uL/4uLi/9kZGT/UFBQ/09PT/9LS0v/U1NT/2ho
aP+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzc3N1BiYmLEeHh4/3l5ef9lZWX/SEhI/yUl
Jf8wMDD/Nzc3/zo6Ov++vr7//////////////////////8HBwf9HR0f/SEhI/0lJSf9LS0v/TU1N/05O
Tv9PT0//UFBQ//////////////////////////////////////////////////////+Kior/T09P/05O
Tv9KSkr/UlJS/2dnZ/+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzg4OFJiYmLFeHh4/3l5
ef9kZGT/SEhI/yQkJP8vLy//YmJi/729vf+9vb3/fX19/35+fv9/f3//gYGB/21tbf9GRkb/R0dH/0lJ
Sf9LS0v/TExM/05OTv9OTk7/T09P////////////i4uL/4uLi/+Li4v/i4uL/4uLi/+Li4v/ioqK/4qK
iv9iYmL/Tk5O/05OTv9KSkr/UlJS/2dnZ/+srKz/srKy/3h4eP94eHj/cHBw+WBgY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JCQ
kAUAAAAApKSkD5qaml+cnJyDmZmZhJmZmYSZmZmEmZmZhJmZmYSZmZmEmZmZhJqamoWlpaWEf39/SJKS
kgQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAMAfAACABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAgAEAAP//AAA=
</value>
</data>
</root>

669
src/Forms/FixCommonErrors.Designer.cs generated Normal file
View File

@ -0,0 +1,669 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class FixCommonErrors
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonNextFinish = new System.Windows.Forms.Button();
this.labelStatus = new System.Windows.Forms.Label();
this.buttonBack = new System.Windows.Forms.Button();
this.groupBoxStep1 = new System.Windows.Forms.GroupBox();
this.buttonInverseSelection = new System.Windows.Forms.Button();
this.buttonSelectAll = new System.Windows.Forms.Button();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPageFixes = new System.Windows.Forms.TabPage();
this.buttonRefreshFixes = new System.Windows.Forms.Button();
this.buttonFixesInverse = new System.Windows.Forms.Button();
this.buttonFixesSelectAll = new System.Windows.Forms.Button();
this.buttonFixesApply = new System.Windows.Forms.Button();
this.contextMenuStripListview = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItemDelete = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.mergeSelectedLinesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBoxEditPanel = new System.Windows.Forms.GroupBox();
this.panelSingleLine = new System.Windows.Forms.Panel();
this.buttonUnBreak = new System.Windows.Forms.Button();
this.buttonAutoBreak = new System.Windows.Forms.Button();
this.labelStartTimeWarning = new System.Windows.Forms.Label();
this.labelDurationWarning = new System.Windows.Forms.Label();
this.numericUpDownDuration = new System.Windows.Forms.NumericUpDown();
this.labelDuration = new System.Windows.Forms.Label();
this.labelStartTime = new System.Windows.Forms.Label();
this.labelTextLineTotal = new System.Windows.Forms.Label();
this.labelTextLineLengths = new System.Windows.Forms.Label();
this.textBoxListViewText = new System.Windows.Forms.TextBox();
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.tabPageLog = new System.Windows.Forms.TabPage();
this.textBoxFixedIssues = new System.Windows.Forms.TextBox();
this.labelNumberOfImportantLogMessages = new System.Windows.Forms.Label();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.timeUpDownStartTime = new Nikse.SubtitleEdit.Controls.TimeUpDown();
this.groupBoxStep1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPageFixes.SuspendLayout();
this.contextMenuStripListview.SuspendLayout();
this.groupBoxEditPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDuration)).BeginInit();
this.tabPageLog.SuspendLayout();
this.SuspendLayout();
//
// 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(759, 540);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 10;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// buttonNextFinish
//
this.buttonNextFinish.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonNextFinish.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonNextFinish.Location = new System.Drawing.Point(678, 540);
this.buttonNextFinish.Name = "buttonNextFinish";
this.buttonNextFinish.Size = new System.Drawing.Size(75, 21);
this.buttonNextFinish.TabIndex = 9;
this.buttonNextFinish.Text = "&Next >";
this.buttonNextFinish.UseVisualStyleBackColor = true;
this.buttonNextFinish.Click += new System.EventHandler(this.ButtonFixClick);
//
// labelStatus
//
this.labelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelStatus.AutoSize = true;
this.labelStatus.Location = new System.Drawing.Point(12, 542);
this.labelStatus.Name = "labelStatus";
this.labelStatus.Size = new System.Drawing.Size(59, 13);
this.labelStatus.TabIndex = 5;
this.labelStatus.Text = "labelStatus";
//
// buttonBack
//
this.buttonBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonBack.Enabled = false;
this.buttonBack.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonBack.Location = new System.Drawing.Point(597, 540);
this.buttonBack.Name = "buttonBack";
this.buttonBack.Size = new System.Drawing.Size(75, 21);
this.buttonBack.TabIndex = 8;
this.buttonBack.Text = "< &Back";
this.buttonBack.UseVisualStyleBackColor = true;
this.buttonBack.Click += new System.EventHandler(this.ButtonBackClick);
//
// groupBoxStep1
//
this.groupBoxStep1.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.groupBoxStep1.Controls.Add(this.buttonInverseSelection);
this.groupBoxStep1.Controls.Add(this.buttonSelectAll);
this.groupBoxStep1.Controls.Add(this.listView1);
this.groupBoxStep1.Location = new System.Drawing.Point(12, 12);
this.groupBoxStep1.Name = "groupBoxStep1";
this.groupBoxStep1.Size = new System.Drawing.Size(822, 522);
this.groupBoxStep1.TabIndex = 9;
this.groupBoxStep1.TabStop = false;
this.groupBoxStep1.Text = "Step 1/2 - Choose which errors to fix";
//
// buttonInverseSelection
//
this.buttonInverseSelection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonInverseSelection.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonInverseSelection.Location = new System.Drawing.Point(87, 495);
this.buttonInverseSelection.Name = "buttonInverseSelection";
this.buttonInverseSelection.Size = new System.Drawing.Size(100, 21);
this.buttonInverseSelection.TabIndex = 10;
this.buttonInverseSelection.Text = "Inverse selection";
this.buttonInverseSelection.UseVisualStyleBackColor = true;
this.buttonInverseSelection.Click += new System.EventHandler(this.ButtonInverseSelectionClick);
//
// buttonSelectAll
//
this.buttonSelectAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonSelectAll.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonSelectAll.Location = new System.Drawing.Point(6, 495);
this.buttonSelectAll.Name = "buttonSelectAll";
this.buttonSelectAll.Size = new System.Drawing.Size(75, 21);
this.buttonSelectAll.TabIndex = 9;
this.buttonSelectAll.Text = "Select all";
this.buttonSelectAll.UseVisualStyleBackColor = true;
this.buttonSelectAll.Click += new System.EventHandler(this.ButtonSelectAllClick);
//
// listView1
//
this.listView1.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.listView1.CheckBoxes = true;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3});
this.listView1.FullRowSelect = true;
this.listView1.Location = new System.Drawing.Point(6, 19);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(810, 471);
this.listView1.TabIndex = 3;
this.listView1.UseCompatibleStateImageBehavior = false;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Apply";
this.columnHeader1.Width = 53;
//
// columnHeader2
//
this.columnHeader2.Text = "What to fix";
this.columnHeader2.Width = 99;
//
// columnHeader3
//
this.columnHeader3.Text = "Example";
this.columnHeader3.Width = 158;
//
// groupBox2
//
this.groupBox2.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.groupBox2.Controls.Add(this.tabControl1);
this.groupBox2.Location = new System.Drawing.Point(12, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(822, 522);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Step 2/2 - Verify fixes";
//
// tabControl1
//
this.tabControl1.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.tabControl1.Controls.Add(this.tabPageFixes);
this.tabControl1.Controls.Add(this.tabPageLog);
this.tabControl1.Location = new System.Drawing.Point(6, 19);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(810, 497);
this.tabControl1.TabIndex = 7;
//
// tabPageFixes
//
this.tabPageFixes.Controls.Add(this.buttonRefreshFixes);
this.tabPageFixes.Controls.Add(this.buttonFixesInverse);
this.tabPageFixes.Controls.Add(this.buttonFixesSelectAll);
this.tabPageFixes.Controls.Add(this.buttonFixesApply);
this.tabPageFixes.Controls.Add(this.subtitleListView1);
this.tabPageFixes.Controls.Add(this.groupBoxEditPanel);
this.tabPageFixes.Controls.Add(this.listViewFixes);
this.tabPageFixes.Location = new System.Drawing.Point(4, 22);
this.tabPageFixes.Name = "tabPageFixes";
this.tabPageFixes.Padding = new System.Windows.Forms.Padding(3);
this.tabPageFixes.Size = new System.Drawing.Size(802, 471);
this.tabPageFixes.TabIndex = 1;
this.tabPageFixes.Text = "Fixes";
this.tabPageFixes.UseVisualStyleBackColor = true;
//
// buttonRefreshFixes
//
this.buttonRefreshFixes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonRefreshFixes.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonRefreshFixes.Location = new System.Drawing.Point(463, 232);
this.buttonRefreshFixes.Name = "buttonRefreshFixes";
this.buttonRefreshFixes.Size = new System.Drawing.Size(165, 21);
this.buttonRefreshFixes.TabIndex = 106;
this.buttonRefreshFixes.Text = "&Refresh available fixes";
this.buttonRefreshFixes.UseVisualStyleBackColor = true;
this.buttonRefreshFixes.Click += new System.EventHandler(this.ButtonRefreshFixesClick);
//
// buttonFixesInverse
//
this.buttonFixesInverse.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonFixesInverse.Location = new System.Drawing.Point(84, 232);
this.buttonFixesInverse.Name = "buttonFixesInverse";
this.buttonFixesInverse.Size = new System.Drawing.Size(100, 21);
this.buttonFixesInverse.TabIndex = 104;
this.buttonFixesInverse.Text = "&Inverse selection";
this.buttonFixesInverse.UseVisualStyleBackColor = true;
this.buttonFixesInverse.Click += new System.EventHandler(this.ButtonFixesInverseClick);
//
// buttonFixesSelectAll
//
this.buttonFixesSelectAll.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonFixesSelectAll.Location = new System.Drawing.Point(3, 232);
this.buttonFixesSelectAll.Name = "buttonFixesSelectAll";
this.buttonFixesSelectAll.Size = new System.Drawing.Size(75, 21);
this.buttonFixesSelectAll.TabIndex = 102;
this.buttonFixesSelectAll.Text = "Select &all";
this.buttonFixesSelectAll.UseVisualStyleBackColor = true;
this.buttonFixesSelectAll.Click += new System.EventHandler(this.ButtonFixesSelectAllClick);
//
// buttonFixesApply
//
this.buttonFixesApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFixesApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonFixesApply.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonFixesApply.Location = new System.Drawing.Point(634, 232);
this.buttonFixesApply.Name = "buttonFixesApply";
this.buttonFixesApply.Size = new System.Drawing.Size(165, 21);
this.buttonFixesApply.TabIndex = 108;
this.buttonFixesApply.Text = "Apply &selected fixes";
this.buttonFixesApply.UseVisualStyleBackColor = true;
this.buttonFixesApply.Click += new System.EventHandler(this.ButtonFixesApplyClick);
//
// contextMenuStripListview
//
this.contextMenuStripListview.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItemDelete,
this.toolStripSeparator1,
this.mergeSelectedLinesToolStripMenuItem});
this.contextMenuStripListview.Name = "contextMenuStripListview";
this.contextMenuStripListview.Size = new System.Drawing.Size(182, 54);
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
//
// toolStripMenuItemDelete
//
this.toolStripMenuItemDelete.Name = "toolStripMenuItemDelete";
this.toolStripMenuItemDelete.Size = new System.Drawing.Size(181, 22);
this.toolStripMenuItemDelete.Text = "Delete";
this.toolStripMenuItemDelete.Click += new System.EventHandler(this.ToolStripMenuItemDeleteClick);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(178, 6);
//
// mergeSelectedLinesToolStripMenuItem
//
this.mergeSelectedLinesToolStripMenuItem.Name = "mergeSelectedLinesToolStripMenuItem";
this.mergeSelectedLinesToolStripMenuItem.Size = new System.Drawing.Size(181, 22);
this.mergeSelectedLinesToolStripMenuItem.Text = "Merge selected lines";
this.mergeSelectedLinesToolStripMenuItem.Click += new System.EventHandler(this.MergeSelectedLinesToolStripMenuItemClick);
//
// groupBoxEditPanel
//
this.groupBoxEditPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxEditPanel.Controls.Add(this.panelSingleLine);
this.groupBoxEditPanel.Controls.Add(this.buttonUnBreak);
this.groupBoxEditPanel.Controls.Add(this.buttonAutoBreak);
this.groupBoxEditPanel.Controls.Add(this.labelStartTimeWarning);
this.groupBoxEditPanel.Controls.Add(this.labelDurationWarning);
this.groupBoxEditPanel.Controls.Add(this.timeUpDownStartTime);
this.groupBoxEditPanel.Controls.Add(this.numericUpDownDuration);
this.groupBoxEditPanel.Controls.Add(this.labelDuration);
this.groupBoxEditPanel.Controls.Add(this.labelStartTime);
this.groupBoxEditPanel.Controls.Add(this.labelTextLineTotal);
this.groupBoxEditPanel.Controls.Add(this.labelTextLineLengths);
this.groupBoxEditPanel.Controls.Add(this.textBoxListViewText);
this.groupBoxEditPanel.Location = new System.Drawing.Point(6, 380);
this.groupBoxEditPanel.Name = "groupBoxEditPanel";
this.groupBoxEditPanel.Size = new System.Drawing.Size(790, 85);
this.groupBoxEditPanel.TabIndex = 111;
this.groupBoxEditPanel.TabStop = false;
//
// panelSingleLine
//
this.panelSingleLine.Location = new System.Drawing.Point(302, 67);
this.panelSingleLine.Margin = new System.Windows.Forms.Padding(0);
this.panelSingleLine.Name = "panelSingleLine";
this.panelSingleLine.Size = new System.Drawing.Size(83, 16);
this.panelSingleLine.TabIndex = 35;
//
// buttonUnBreak
//
this.buttonUnBreak.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonUnBreak.Location = new System.Drawing.Point(557, 39);
this.buttonUnBreak.Name = "buttonUnBreak";
this.buttonUnBreak.Size = new System.Drawing.Size(66, 21);
this.buttonUnBreak.TabIndex = 122;
this.buttonUnBreak.Text = "&Unbreak";
this.buttonUnBreak.UseVisualStyleBackColor = true;
this.buttonUnBreak.Click += new System.EventHandler(this.ButtonUnBreakClick);
//
// buttonAutoBreak
//
this.buttonAutoBreak.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAutoBreak.Location = new System.Drawing.Point(557, 12);
this.buttonAutoBreak.Name = "buttonAutoBreak";
this.buttonAutoBreak.Size = new System.Drawing.Size(66, 21);
this.buttonAutoBreak.TabIndex = 120;
this.buttonAutoBreak.Text = "Auto &br";
this.buttonAutoBreak.UseVisualStyleBackColor = true;
this.buttonAutoBreak.Click += new System.EventHandler(this.ButtonAutoBreakClick);
//
// labelStartTimeWarning
//
this.labelStartTimeWarning.AutoSize = true;
this.labelStartTimeWarning.ForeColor = System.Drawing.Color.Red;
this.labelStartTimeWarning.Location = new System.Drawing.Point(6, 51);
this.labelStartTimeWarning.Name = "labelStartTimeWarning";
this.labelStartTimeWarning.Size = new System.Drawing.Size(114, 13);
this.labelStartTimeWarning.TabIndex = 32;
this.labelStartTimeWarning.Text = "labelStartTimeWarning";
//
// labelDurationWarning
//
this.labelDurationWarning.AutoSize = true;
this.labelDurationWarning.ForeColor = System.Drawing.Color.Red;
this.labelDurationWarning.Location = new System.Drawing.Point(57, 64);
this.labelDurationWarning.Name = "labelDurationWarning";
this.labelDurationWarning.Size = new System.Drawing.Size(109, 13);
this.labelDurationWarning.TabIndex = 31;
this.labelDurationWarning.Text = "labelDurationWarning";
//
// numericUpDownDuration
//
this.numericUpDownDuration.DecimalPlaces = 3;
this.numericUpDownDuration.Increment = new decimal(new int[] {
1,
0,
0,
65536});
this.numericUpDownDuration.Location = new System.Drawing.Point(99, 28);
this.numericUpDownDuration.Maximum = new decimal(new int[] {
99999,
0,
0,
0});
this.numericUpDownDuration.Minimum = new decimal(new int[] {
99999,
0,
0,
-2147483648});
this.numericUpDownDuration.Name = "numericUpDownDuration";
this.numericUpDownDuration.Size = new System.Drawing.Size(54, 20);
this.numericUpDownDuration.TabIndex = 114;
this.numericUpDownDuration.ValueChanged += new System.EventHandler(this.NumericUpDownDurationValueChanged);
//
// labelDuration
//
this.labelDuration.AutoSize = true;
this.labelDuration.Location = new System.Drawing.Point(97, 12);
this.labelDuration.Name = "labelDuration";
this.labelDuration.Size = new System.Drawing.Size(47, 13);
this.labelDuration.TabIndex = 28;
this.labelDuration.Text = "Duration";
//
// labelStartTime
//
this.labelStartTime.AutoSize = true;
this.labelStartTime.Location = new System.Drawing.Point(6, 12);
this.labelStartTime.Name = "labelStartTime";
this.labelStartTime.Size = new System.Drawing.Size(51, 13);
this.labelStartTime.TabIndex = 27;
this.labelStartTime.Text = "Start time";
//
// labelTextLineTotal
//
this.labelTextLineTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.labelTextLineTotal.Location = new System.Drawing.Point(374, 66);
this.labelTextLineTotal.Name = "labelTextLineTotal";
this.labelTextLineTotal.Size = new System.Drawing.Size(177, 13);
this.labelTextLineTotal.TabIndex = 26;
this.labelTextLineTotal.Text = "labelTextLineTotal";
this.labelTextLineTotal.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// labelTextLineLengths
//
this.labelTextLineLengths.AutoSize = true;
this.labelTextLineLengths.Location = new System.Drawing.Point(191, 66);
this.labelTextLineLengths.Name = "labelTextLineLengths";
this.labelTextLineLengths.Size = new System.Drawing.Size(108, 13);
this.labelTextLineLengths.TabIndex = 25;
this.labelTextLineLengths.Text = "labelTextLineLengths";
//
// textBoxListViewText
//
this.textBoxListViewText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxListViewText.HideSelection = false;
this.textBoxListViewText.Location = new System.Drawing.Point(194, 9);
this.textBoxListViewText.Multiline = true;
this.textBoxListViewText.Name = "textBoxListViewText";
this.textBoxListViewText.Size = new System.Drawing.Size(357, 56);
this.textBoxListViewText.TabIndex = 118;
this.textBoxListViewText.TextChanged += new System.EventHandler(this.TextBoxListViewTextTextChanged);
//
// listViewFixes
//
this.listViewFixes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader6,
this.columnHeader7,
this.columnHeader8});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.HideSelection = false;
this.listViewFixes.Location = new System.Drawing.Point(2, 1);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(797, 225);
this.listViewFixes.TabIndex = 100;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
this.listViewFixes.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListViewFixesColumnClick);
this.listViewFixes.SelectedIndexChanged += new System.EventHandler(this.ListViewFixesSelectedIndexChanged);
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 61;
//
// columnHeader6
//
this.columnHeader6.Text = "Function";
this.columnHeader6.Width = 134;
//
// columnHeader7
//
this.columnHeader7.Text = "Before";
this.columnHeader7.Width = 281;
//
// columnHeader8
//
this.columnHeader8.Text = "After";
this.columnHeader8.Width = 248;
//
// tabPageLog
//
this.tabPageLog.Controls.Add(this.textBoxFixedIssues);
this.tabPageLog.Location = new System.Drawing.Point(4, 22);
this.tabPageLog.Name = "tabPageLog";
this.tabPageLog.Size = new System.Drawing.Size(802, 472);
this.tabPageLog.TabIndex = 2;
this.tabPageLog.Text = "Log";
this.tabPageLog.UseVisualStyleBackColor = true;
//
// textBoxFixedIssues
//
this.textBoxFixedIssues.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.textBoxFixedIssues.Location = new System.Drawing.Point(3, 3);
this.textBoxFixedIssues.MaxLength = 65767;
this.textBoxFixedIssues.Multiline = true;
this.textBoxFixedIssues.Name = "textBoxFixedIssues";
this.textBoxFixedIssues.ReadOnly = true;
this.textBoxFixedIssues.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxFixedIssues.Size = new System.Drawing.Size(796, 466);
this.textBoxFixedIssues.TabIndex = 5;
this.textBoxFixedIssues.WordWrap = false;
//
// labelNumberOfImportantLogMessages
//
this.labelNumberOfImportantLogMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelNumberOfImportantLogMessages.AutoSize = true;
this.labelNumberOfImportantLogMessages.ForeColor = System.Drawing.Color.Red;
this.labelNumberOfImportantLogMessages.Location = new System.Drawing.Point(12, 558);
this.labelNumberOfImportantLogMessages.Name = "labelNumberOfImportantLogMessages";
this.labelNumberOfImportantLogMessages.Size = new System.Drawing.Size(187, 13);
this.labelNumberOfImportantLogMessages.TabIndex = 11;
this.labelNumberOfImportantLogMessages.Text = "labelNumberOfImportantLogMessages";
//
// subtitleListView1
//
this.subtitleListView1.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.subtitleListView1.ContextMenuStrip = this.contextMenuStripListview;
this.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(2, 269);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.Size = new System.Drawing.Size(797, 109);
this.subtitleListView1.TabIndex = 110;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView1SelectedIndexChanged);
//
// timeUpDownStartTime
//
this.timeUpDownStartTime.AutoSize = true;
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 27);
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(89, 24);
this.timeUpDownStartTime.TabIndex = 112;
//
// FixCommonErrors
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(846, 573);
this.Controls.Add(this.labelStatus);
this.Controls.Add(this.labelNumberOfImportantLogMessages);
this.Controls.Add(this.buttonBack);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonNextFinish);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBoxStep1);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(840, 580);
this.Name = "FixCommonErrors";
this.ShowIcon = false;
this.Text = "Fix common errors";
this.Shown += new System.EventHandler(this.FixCommonErrors_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormFix_KeyDown);
this.Resize += new System.EventHandler(this.FixCommonErrors_Resize);
this.groupBoxStep1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPageFixes.ResumeLayout(false);
this.contextMenuStripListview.ResumeLayout(false);
this.groupBoxEditPanel.ResumeLayout(false);
this.groupBoxEditPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDuration)).EndInit();
this.tabPageLog.ResumeLayout(false);
this.tabPageLog.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonNextFinish;
private System.Windows.Forms.Label labelStatus;
private System.Windows.Forms.Button buttonBack;
private System.Windows.Forms.GroupBox groupBoxStep1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPageFixes;
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader6;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
private System.Windows.Forms.TabPage tabPageLog;
private System.Windows.Forms.TextBox textBoxFixedIssues;
private System.Windows.Forms.Button buttonInverseSelection;
private System.Windows.Forms.Button buttonSelectAll;
private System.Windows.Forms.GroupBox groupBoxEditPanel;
private SubtitleListView subtitleListView1;
private System.Windows.Forms.Label labelTextLineTotal;
private System.Windows.Forms.Label labelTextLineLengths;
private System.Windows.Forms.TextBox textBoxListViewText;
private System.Windows.Forms.Button buttonFixesApply;
private System.Windows.Forms.Button buttonFixesInverse;
private System.Windows.Forms.Button buttonFixesSelectAll;
private System.Windows.Forms.Label labelStartTimeWarning;
private System.Windows.Forms.Label labelDurationWarning;
private Nikse.SubtitleEdit.Controls.TimeUpDown timeUpDownStartTime;
private System.Windows.Forms.NumericUpDown numericUpDownDuration;
private System.Windows.Forms.Label labelDuration;
private System.Windows.Forms.Label labelStartTime;
private System.Windows.Forms.Button buttonRefreshFixes;
private System.Windows.Forms.Button buttonUnBreak;
private System.Windows.Forms.Button buttonAutoBreak;
private System.Windows.Forms.ContextMenuStrip contextMenuStripListview;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemDelete;
private System.Windows.Forms.ToolStripMenuItem mergeSelectedLinesToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.Panel panelSingleLine;
private System.Windows.Forms.Label labelNumberOfImportantLogMessages;
}
}

3651
src/Forms/FixCommonErrors.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStripListview.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

154
src/Forms/GetDictionaries.Designer.cs generated Normal file
View File

@ -0,0 +1,154 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class GetDictionaries
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.labelDescription2 = new System.Windows.Forms.Label();
this.linkLabelOpenDictionaryFolder = new System.Windows.Forms.LinkLabel();
this.labelDescription1 = new System.Windows.Forms.Label();
this.comboBoxDictionaries = new System.Windows.Forms.ComboBox();
this.buttonDownload = new System.Windows.Forms.Button();
this.labelChooseLanguageAndClickDownload = new System.Windows.Forms.Label();
this.labelPleaseWait = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Location = new System.Drawing.Point(356, 159);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 20;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// labelDescription2
//
this.labelDescription2.AutoSize = true;
this.labelDescription2.Location = new System.Drawing.Point(30, 34);
this.labelDescription2.Name = "labelDescription2";
this.labelDescription2.Size = new System.Drawing.Size(260, 13);
this.labelDescription2.TabIndex = 1;
this.labelDescription2.Text = "uses the spell checking dictionaries from Open Office.";
//
// linkLabelOpenDictionaryFolder
//
this.linkLabelOpenDictionaryFolder.AutoSize = true;
this.linkLabelOpenDictionaryFolder.Location = new System.Drawing.Point(30, 164);
this.linkLabelOpenDictionaryFolder.Name = "linkLabelOpenDictionaryFolder";
this.linkLabelOpenDictionaryFolder.Size = new System.Drawing.Size(124, 13);
this.linkLabelOpenDictionaryFolder.TabIndex = 15;
this.linkLabelOpenDictionaryFolder.TabStop = true;
this.linkLabelOpenDictionaryFolder.Text = "Open \'Dictionaries\' folder";
this.linkLabelOpenDictionaryFolder.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel4LinkClicked);
//
// labelDescription1
//
this.labelDescription1.AutoSize = true;
this.labelDescription1.Location = new System.Drawing.Point(30, 16);
this.labelDescription1.Name = "labelDescription1";
this.labelDescription1.Size = new System.Drawing.Size(320, 13);
this.labelDescription1.TabIndex = 8;
this.labelDescription1.Text = "Subtitle Edit\'s spell check is based on the NHunspell engine which";
//
// comboBoxDictionaries
//
this.comboBoxDictionaries.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxDictionaries.FormattingEnabled = true;
this.comboBoxDictionaries.Location = new System.Drawing.Point(33, 98);
this.comboBoxDictionaries.Name = "comboBoxDictionaries";
this.comboBoxDictionaries.Size = new System.Drawing.Size(317, 21);
this.comboBoxDictionaries.TabIndex = 0;
this.comboBoxDictionaries.SelectedIndexChanged += new System.EventHandler(this.comboBoxDictionaries_SelectedIndexChanged);
//
// buttonDownload
//
this.buttonDownload.Location = new System.Drawing.Point(356, 96);
this.buttonDownload.Name = "buttonDownload";
this.buttonDownload.Size = new System.Drawing.Size(75, 23);
this.buttonDownload.TabIndex = 10;
this.buttonDownload.Text = "&Download";
this.buttonDownload.UseVisualStyleBackColor = true;
this.buttonDownload.Click += new System.EventHandler(this.buttonDownload_Click);
//
// labelChooseLanguageAndClickDownload
//
this.labelChooseLanguageAndClickDownload.AutoSize = true;
this.labelChooseLanguageAndClickDownload.Location = new System.Drawing.Point(30, 80);
this.labelChooseLanguageAndClickDownload.Name = "labelChooseLanguageAndClickDownload";
this.labelChooseLanguageAndClickDownload.Size = new System.Drawing.Size(202, 13);
this.labelChooseLanguageAndClickDownload.TabIndex = 11;
this.labelChooseLanguageAndClickDownload.Text = "Choose your languge and click download";
//
// labelPleaseWait
//
this.labelPleaseWait.AutoSize = true;
this.labelPleaseWait.Location = new System.Drawing.Point(30, 122);
this.labelPleaseWait.Name = "labelPleaseWait";
this.labelPleaseWait.Size = new System.Drawing.Size(70, 13);
this.labelPleaseWait.TabIndex = 12;
this.labelPleaseWait.Text = "Please wait...";
//
// GetDictionaries
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(443, 195);
this.Controls.Add(this.labelPleaseWait);
this.Controls.Add(this.labelChooseLanguageAndClickDownload);
this.Controls.Add(this.buttonDownload);
this.Controls.Add(this.comboBoxDictionaries);
this.Controls.Add(this.labelDescription1);
this.Controls.Add(this.linkLabelOpenDictionaryFolder);
this.Controls.Add(this.labelDescription2);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GetDictionaries";
this.Text = "Need dictionaries?";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormGetDictionaries_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Label labelDescription2;
private System.Windows.Forms.LinkLabel linkLabelOpenDictionaryFolder;
private System.Windows.Forms.Label labelDescription1;
private System.Windows.Forms.ComboBox comboBoxDictionaries;
private System.Windows.Forms.Button buttonDownload;
private System.Windows.Forms.Label labelChooseLanguageAndClickDownload;
private System.Windows.Forms.Label labelPleaseWait;
}
}

View File

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Windows.Forms;
using System.Xml;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class GetDictionaries : Form
{
List<string> _dictionaryDownloadLinks = new List<string>();
List<string> _descriptions = new List<string>();
public GetDictionaries()
{
InitializeComponent();
Text = Configuration.Settings.Language.GetDictionaries.Title;
labelDescription1.Text = Configuration.Settings.Language.GetDictionaries.DescriptionLine1;
labelDescription2.Text = Configuration.Settings.Language.GetDictionaries.DescriptionLine2;
linkLabelOpenDictionaryFolder.Text = Configuration.Settings.Language.GetDictionaries.OpenDictionariesFolder;
labelChooseLanguageAndClickDownload.Text = Configuration.Settings.Language.GetDictionaries.ChooseLanguageAndClickDownload;
buttonDownload.Text = Configuration.Settings.Language.GetDictionaries.Download;
buttonOK.Text = Configuration.Settings.Language.General.OK;
labelPleaseWait.Text = Configuration.Settings.Language.General.PleaseWait;
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
Stream strm = asm.GetManifestResourceStream("Nikse.SubtitleEdit.Resources.OpenOfficeDictionaries.xml.zip");
if (strm != null)
{
XmlDocument doc = new XmlDocument();
var rdr = new StreamReader(strm);
using (var zip = new GZipStream(rdr.BaseStream, CompressionMode.Decompress))
{
byte[] data = new byte[175000];
int count = zip.Read(data, 0, 175000);
doc.LoadXml(System.Text.Encoding.UTF8.GetString(data));
}
rdr.Close();
foreach (XmlNode node in doc.DocumentElement.SelectNodes("Dictionary"))
{
string englishName = node.SelectSingleNode("EnglishName").InnerText;
string nativeName = node.SelectSingleNode("NativeName").InnerText;
string downloadLink = node.SelectSingleNode("DownloadLink").InnerText;
string description = string.Empty;
if (node.SelectSingleNode("Description") != null)
description = node.SelectSingleNode("Description").InnerText;
if (!string.IsNullOrEmpty(downloadLink))
{
string name = englishName;
if (!string.IsNullOrEmpty(nativeName))
name += " - " + nativeName;
comboBoxDictionaries.Items.Add(name);
_dictionaryDownloadLinks.Add(downloadLink);
_descriptions.Add(description);
}
comboBoxDictionaries.SelectedIndex = 0;
}
}
}
private void FormGetDictionaries_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void LinkLabel3LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://nhunspell.sourceforge.net/");
}
private void LinkLabel4LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string dictionaryFolder = Utilities.DictionaryFolder;
if (!Directory.Exists(dictionaryFolder))
Directory.CreateDirectory(dictionaryFolder);
System.Diagnostics.Process.Start(dictionaryFolder);
}
private void buttonDownload_Click(object sender, System.EventArgs e)
{
try
{
labelPleaseWait.Text = Configuration.Settings.Language.General.PleaseWait;
buttonOK.Enabled = false;
buttonDownload.Enabled = false;
comboBoxDictionaries.Enabled = false;
this.Refresh();
Cursor = Cursors.WaitCursor;
string dictionaryFolder = Utilities.DictionaryFolder;
if (!Directory.Exists(dictionaryFolder))
Directory.CreateDirectory(dictionaryFolder);
int index = comboBoxDictionaries.SelectedIndex;
string url = _dictionaryDownloadLinks[index];
var wc = new WebClient { Proxy = Utilities.GetProxy() };
var ms = new MemoryStream(wc.DownloadData(url));
var reader = new StreamReader(ms);
ZipExtractor zip = ZipExtractor.Open(ms);
List<ZipExtractor.ZipFileEntry> dir = zip.ReadCentralDir();
// Extract dic/aff files in dictionary folder
string path;
bool result;
foreach (ZipExtractor.ZipFileEntry entry in dir)
{
if (entry.FilenameInZip.ToLower().EndsWith(".dic") || entry.FilenameInZip.ToLower().EndsWith(".aff"))
{
string fileName = Path.GetFileName(entry.FilenameInZip);
// French fix
if (fileName.StartsWith("fr-moderne"))
fileName = fileName.Replace("fr-moderne", "fr_FR");
// German fix
if (fileName.StartsWith("de_DE_frami"))
fileName = fileName.Replace("de_DE_frami", "de_DE");
path = Path.Combine(dictionaryFolder, fileName);
result = zip.ExtractFile(entry, path);
}
}
zip.Close();
ms.Close();
Cursor = Cursors.Default;
labelPleaseWait.Text = string.Empty;
buttonOK.Enabled = true;
buttonDownload.Enabled = true;
comboBoxDictionaries.Enabled = true;
MessageBox.Show(string.Format(Configuration.Settings.Language.GetDictionaries.XDownloaded, comboBoxDictionaries.Items[index]));
}
catch (Exception exception)
{
labelPleaseWait.Text = string.Empty;
buttonOK.Enabled = true;
buttonDownload.Enabled = true;
comboBoxDictionaries.Enabled = true;
Cursor = Cursors.Default;
MessageBox.Show(exception.Message + Environment.NewLine + Environment.NewLine + exception.StackTrace);
}
}
private void comboBoxDictionaries_SelectedIndexChanged(object sender, EventArgs e)
{
int index = comboBoxDictionaries.SelectedIndex;
labelPleaseWait.Text = _descriptions[index];
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

89
src/Forms/GoToLine.Designer.cs generated Normal file
View File

@ -0,0 +1,89 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class GoToLine
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GoToLine));
this.labelGoToLine = new System.Windows.Forms.Label();
this.buttonOK = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.buttonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// labelGoToLine
//
resources.ApplyResources(this.labelGoToLine, "labelGoToLine");
this.labelGoToLine.Name = "labelGoToLine";
//
// buttonOK
//
resources.ApplyResources(this.buttonOK, "buttonOK");
this.buttonOK.Name = "buttonOK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// textBox1
//
resources.ApplyResources(this.textBox1, "textBox1");
this.textBox1.Name = "textBox1";
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBox1KeyDown);
//
// buttonCancel
//
resources.ApplyResources(this.buttonCancel, "buttonCancel");
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// GoToLine
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.labelGoToLine);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GoToLine";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormGoToLine_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label labelGoToLine;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button buttonCancel;
}
}

100
src/Forms/GoToLine.cs Normal file
View File

@ -0,0 +1,100 @@
using System;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class GoToLine : Form
{
private int _max;
private int _min;
int _lineNumber;
public GoToLine()
{
InitializeComponent();
Text = Configuration.Settings.Language.GoToLine.Title;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public int LineNumber
{
get
{
return _lineNumber;
}
}
public void Initialize(int min, int max)
{
_min = min;
_max = max;
labelGoToLine.Text = string.Format(Text + " ({0} - {1})", min, max);
}
private void FormGoToLine_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
}
private void TextBox1KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (int.TryParse(textBox1.Text, out _lineNumber))
{
if (_lineNumber >= _min && _lineNumber <= _max)
DialogResult = DialogResult.OK;
}
}
else
{
if (e.KeyCode == Keys.D0 ||
e.KeyCode == Keys.D1 ||
e.KeyCode == Keys.D2 ||
e.KeyCode == Keys.D3 ||
e.KeyCode == Keys.D4 ||
e.KeyCode == Keys.D5 ||
e.KeyCode == Keys.D6 ||
e.KeyCode == Keys.D7 ||
e.KeyCode == Keys.D8 ||
e.KeyCode == Keys.D9 ||
e.KeyCode == Keys.Delete ||
e.KeyCode == Keys.Left ||
e.KeyCode == Keys.Right ||
e.KeyCode == Keys.Back ||
(e.KeyValue >= 96 && e.KeyValue <= 105))
{
}
else
{
e.Handled = true;
e.SuppressKeyPress = true;
}
}
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (int.TryParse(textBox1.Text, out _lineNumber))
{
if (_lineNumber >= _min && _lineNumber <= _max)
{
DialogResult = DialogResult.OK;
return;
}
}
MessageBox.Show(string.Format(Configuration.Settings.Language.GoToLine.XIsNotAValidNumber, textBox1.Text));
}
private void ButtonCancelClick(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}

665
src/Forms/GoToLine.resx Normal file
View File

@ -0,0 +1,665 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labelGoToLine.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="labelGoToLine.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 9</value>
</data>
<data name="labelGoToLine.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value>
</data>
<data name="labelGoToLine.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="labelGoToLine.Text" xml:space="preserve">
<value>labelGoToLine</value>
</data>
<data name="&gt;&gt;labelGoToLine.Name" xml:space="preserve">
<value>labelGoToLine</value>
</data>
<data name="&gt;&gt;labelGoToLine.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelGoToLine.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;labelGoToLine.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="buttonOK.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 51</value>
</data>
<data name="buttonOK.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 21</value>
</data>
<data name="buttonOK.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="buttonOK.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="&gt;&gt;buttonOK.Name" xml:space="preserve">
<value>buttonOK</value>
</data>
<data name="&gt;&gt;buttonOK.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonOK.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonOK.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="textBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>15, 25</value>
</data>
<data name="textBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 20</value>
</data>
<data name="textBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;textBox1.Name" xml:space="preserve">
<value>textBox1</value>
</data>
<data name="&gt;&gt;textBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;textBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;textBox1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="buttonCancel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="buttonCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 51</value>
</data>
<data name="buttonCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 21</value>
</data>
<data name="buttonCancel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="buttonCancel.Text" xml:space="preserve">
<value>C&amp;ancel</value>
</data>
<data name="&gt;&gt;buttonCancel.Name" xml:space="preserve">
<value>buttonCancel</value>
</data>
<data name="&gt;&gt;buttonCancel.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonCancel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonCancel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>235, 84</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype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pK/0lJSf90dHT/sLCw//39
/f/u7u7/x8fH/4eHh/91dXX/V1dX5CwsLK8ODg5NAAAAHCIiIkFWVla/c3Nz/nl5ef9mZmb/SkpK/yUl
Jf8uLi7/NTU1/zk5Of85OTn/Ojo6/zw8PP89PT3/Pz8//0FBQf9DQ0P/RUVF/0ZGRv9HR0f/SEhI/0pK
Sv9LS0v/TExM/0xMTP9NTU3/Tk5O/05OTv9OTk7/T09P/09PT/9OTk7/Tk5O/01NTf9MTEz/S0tL/0lJ
Sf9XV1f/g4OD/83Nzf/i4uL/zc3N/46Ojv96enr/YGBg7kFBQc0WFhZiAAAALCEhIUJWVlbAc3Nz/3l5
ef9mZmb/SkpK/yYmJv8vLy//NjY2/zo6Ov+RkZH/vb29/76+vv++vr7/v7+//8DAwP/AwMD/wcHB/8HB
wf9ISEj/SUlJ/0tLS/9NTU3/TU1N/8TExP/ExMT/xMTE/8TExP/ExMT/xMTE/8TExP/ExMT/xMTE/8TE
xP/ExMT/w8PD/0tLS/9ISEj/ZGRk/6CgoP/Q0ND/ysrK/4yMjP97e3v/aGho9VFRUeIcHBxxAgICOSEh
IURWVlbAc3Nz/3l5ef9mZmb/S0tL/ycnJ/8wMDD/NjY2/zo6Ov+9vb3/////////////////////////
//////////////////9KSkr/S0tL/01NTf9OTk7/T09P////////////////////////////////////
/////////////////////////////09PT/9JSUn/VVVV/3R0dP+6urr/vr6+/4CAgP95eXn/bm5u+V5e
Xu4iIiJ7BQUFQiEhIUVWVlbBc3Nz/3l5ef9mZmb/SkpK/ycnJ/8wMDD/eXl5//////+9vb3/PDw8/z4+
Pv8/Pz//QkJC/0VFRf9GRkb/R0dH/4WFhf//////w8PD/05OTv9PT0//UFBQ////////////UVFR/1FR
Uf9RUVH/UVFR/1FRUf9RUVH/UVFR/1FRUf9QUFD/T09P/09PT/9KSkr/U1NT/2pqav+wsLD/tra2/3p6
ev93d3f/bm5u+V9fX+4jIyN8BQUFQiEhIUZWVlbBdHR0/3p6ev9mZmb/Sk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Bwf////////////////9MTEz/Tk5O/1BQUP9QUFD/UVFR////////////UlJS/1JS
Uv9SUlL/UlJS/1JSUv9RUVH/UVFR/1FRUf9RUVH/UFBQ/1BQUP9LS0v/U1NT/2hoaP+tra3/srKy/3h4
eP94eHj/cHBw+WBgYO8jIyN8BQUFQzU1NU5iYmLEeHh4/3l5ef9lZWX/SUlJ/yYmJv8xMTH/ODg4/zs7
O/9mZmb/fX19/39/f/+AgID/gYGB/8HBwf/BwcH/wsLC/8LCwv9MTEz/TU1N/09PT/9QUFD/UVFR////
////////i4uL/4uLi/+Li4v/i4uL/4uLi/+Li4v/i4uL/4uLi/9kZGT/UFBQ/09PT/9LS0v/U1NT/2ho
aP+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzc3N1BiYmLEeHh4/3l5ef9lZWX/SEhI/yUl
Jf8wMDD/Nzc3/zo6Ov++vr7//////////////////////8HBwf9HR0f/SEhI/0lJSf9LS0v/TU1N/05O
Tv9PT0//UFBQ//////////////////////////////////////////////////////+Kior/T09P/05O
Tv9KSkr/UlJS/2dnZ/+tra3/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzg4OFJiYmLFeHh4/3l5
ef9kZGT/SEhI/yQkJP8vLy//YmJi/729vf+9vb3/fX19/35+fv9/f3//gYGB/21tbf9GRkb/R0dH/0lJ
Sf9LS0v/TExM/05OTv9OTk7/T09P////////////i4uL/4uLi/+Li4v/i4uL/4uLi/+Li4v/ioqK/4qK
iv9iYmL/Tk5O/05OTv9KSkr/UlJS/2dnZ/+srKz/srKy/3h4eP94eHj/cHBw+WBgYO8jIyN8BQUFQzg4
OFRjY2PGeHh4/3l5ef9jY2P/R0dH/yQkJP8vLy//eXl5//////+9vb3/PDw8/z09Pf8+Pj7/QUFB/0ND
Q/9FRUX/R0dH/0hISP9JSUn/SkpK/0xMTP9NTU3/Tk5O////////////T09P/1BQUP9QUFD/UFBQ/1BQ
UP9PT0//T09P/05OTv9OTk7/TU1N/0xM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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAgAEAAP//AAA=
</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Go to line</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>GoToLine</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

213
src/Forms/GoogleTranslate.Designer.cs generated Normal file
View File

@ -0,0 +1,213 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class GoogleTranslate
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBoxFrom = new System.Windows.Forms.ComboBox();
this.labelFrom = new System.Windows.Forms.Label();
this.labelTo = new System.Windows.Forms.Label();
this.comboBoxTo = new System.Windows.Forms.ComboBox();
this.buttonTranslate = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.linkLabelPoweredByGoogleTranslate = new System.Windows.Forms.LinkLabel();
this.labelPleaseWait = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.subtitleListViewTo = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.subtitleListViewFrom = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.SuspendLayout();
//
// comboBoxFrom
//
this.comboBoxFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxFrom.FormattingEnabled = true;
this.comboBoxFrom.Location = new System.Drawing.Point(327, 38);
this.comboBoxFrom.Name = "comboBoxFrom";
this.comboBoxFrom.Size = new System.Drawing.Size(121, 21);
this.comboBoxFrom.TabIndex = 0;
//
// labelFrom
//
this.labelFrom.AutoSize = true;
this.labelFrom.Location = new System.Drawing.Point(288, 41);
this.labelFrom.Name = "labelFrom";
this.labelFrom.Size = new System.Drawing.Size(33, 13);
this.labelFrom.TabIndex = 1;
this.labelFrom.Text = "From:";
//
// labelTo
//
this.labelTo.AutoSize = true;
this.labelTo.Location = new System.Drawing.Point(468, 37);
this.labelTo.Name = "labelTo";
this.labelTo.Size = new System.Drawing.Size(23, 13);
this.labelTo.TabIndex = 4;
this.labelTo.Text = "To:";
//
// comboBoxTo
//
this.comboBoxTo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxTo.FormattingEnabled = true;
this.comboBoxTo.Location = new System.Drawing.Point(497, 34);
this.comboBoxTo.Name = "comboBoxTo";
this.comboBoxTo.Size = new System.Drawing.Size(121, 21);
this.comboBoxTo.TabIndex = 3;
//
// buttonTranslate
//
this.buttonTranslate.Location = new System.Drawing.Point(624, 34);
this.buttonTranslate.Name = "buttonTranslate";
this.buttonTranslate.Size = new System.Drawing.Size(75, 21);
this.buttonTranslate.TabIndex = 5;
this.buttonTranslate.Text = "Translate";
this.buttonTranslate.UseVisualStyleBackColor = true;
this.buttonTranslate.Click += new System.EventHandler(this.buttonTranslate_Click);
//
// 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(744, 529);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 6;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// 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.Location = new System.Drawing.Point(825, 529);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 7;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// linkLabelPoweredByGoogleTranslate
//
this.linkLabelPoweredByGoogleTranslate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.linkLabelPoweredByGoogleTranslate.AutoSize = true;
this.linkLabelPoweredByGoogleTranslate.Location = new System.Drawing.Point(15, 529);
this.linkLabelPoweredByGoogleTranslate.Name = "linkLabelPoweredByGoogleTranslate";
this.linkLabelPoweredByGoogleTranslate.Size = new System.Drawing.Size(143, 13);
this.linkLabelPoweredByGoogleTranslate.TabIndex = 8;
this.linkLabelPoweredByGoogleTranslate.TabStop = true;
this.linkLabelPoweredByGoogleTranslate.Text = "Powered by Google translate";
this.linkLabelPoweredByGoogleTranslate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1LinkClicked);
//
// labelPleaseWait
//
this.labelPleaseWait.AutoSize = true;
this.labelPleaseWait.Location = new System.Drawing.Point(703, 23);
this.labelPleaseWait.Name = "labelPleaseWait";
this.labelPleaseWait.Size = new System.Drawing.Size(171, 13);
this.labelPleaseWait.TabIndex = 10;
this.labelPleaseWait.Text = "Please wait... this may take a while";
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(705, 39);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(192, 16);
this.progressBar1.TabIndex = 11;
//
// subtitleListViewTo
//
this.subtitleListViewTo.FirstVisibleIndex = -1;
this.subtitleListViewTo.FullRowSelect = true;
this.subtitleListViewTo.GridLines = true;
this.subtitleListViewTo.Location = new System.Drawing.Point(471, 64);
this.subtitleListViewTo.Name = "subtitleListViewTo";
this.subtitleListViewTo.Size = new System.Drawing.Size(428, 459);
this.subtitleListViewTo.TabIndex = 2;
this.subtitleListViewTo.UseCompatibleStateImageBehavior = false;
this.subtitleListViewTo.View = System.Windows.Forms.View.Details;
//
// subtitleListViewFrom
//
this.subtitleListViewFrom.FirstVisibleIndex = -1;
this.subtitleListViewFrom.FullRowSelect = true;
this.subtitleListViewFrom.GridLines = true;
this.subtitleListViewFrom.Location = new System.Drawing.Point(18, 64);
this.subtitleListViewFrom.Name = "subtitleListViewFrom";
this.subtitleListViewFrom.Size = new System.Drawing.Size(430, 459);
this.subtitleListViewFrom.TabIndex = 0;
this.subtitleListViewFrom.UseCompatibleStateImageBehavior = false;
this.subtitleListViewFrom.View = System.Windows.Forms.View.Details;
//
// GoogleTranslate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(915, 558);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.labelPleaseWait);
this.Controls.Add(this.linkLabelPoweredByGoogleTranslate);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonTranslate);
this.Controls.Add(this.labelTo);
this.Controls.Add(this.comboBoxTo);
this.Controls.Add(this.subtitleListViewTo);
this.Controls.Add(this.subtitleListViewFrom);
this.Controls.Add(this.labelFrom);
this.Controls.Add(this.comboBoxFrom);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(900, 500);
this.Name = "GoogleTranslate";
this.ShowIcon = false;
this.Text = "Google translate";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormGoogleTranslate_KeyDown);
this.Resize += new System.EventHandler(this.GoogleTranslate_Resize);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox comboBoxFrom;
private System.Windows.Forms.Label labelFrom;
private SubtitleListView subtitleListViewFrom;
private SubtitleListView subtitleListViewTo;
private System.Windows.Forms.Label labelTo;
private System.Windows.Forms.ComboBox comboBoxTo;
private System.Windows.Forms.Button buttonTranslate;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.LinkLabel linkLabelPoweredByGoogleTranslate;
private System.Windows.Forms.Label labelPleaseWait;
private System.Windows.Forms.ProgressBar progressBar1;
}
}

View File

@ -0,0 +1,742 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class GoogleTranslate : Form
{
Subtitle _subtitle;
Subtitle _translatedSubtitle;
bool _breakTranslation;
bool _googleTranslate = true;
MicrosoftTranslationService.SoapService _microsoftTranslationService = null;
private const string BingApiId = "C2C2E9A508E6748F0494D68DFD92FAA1FF9B0BA4";
class ComboBoxItem
{
public string Text { get; set; }
public string Value { get; set; }
public ComboBoxItem(string text, string value)
{
if (text.Length > 1)
text = text.Substring(0, 1).ToUpper() + text.Substring(1).ToLower();
Text = text;
Value = value;
}
public override string ToString()
{
return Text;
}
}
public Subtitle TranslatedSubtitle
{
get
{
return _translatedSubtitle;
}
}
public GoogleTranslate()
{
InitializeComponent();
Text = Configuration.Settings.Language.GoogleTranslate.Title;
labelFrom.Text = Configuration.Settings.Language.GoogleTranslate.From;
labelTo.Text = Configuration.Settings.Language.GoogleTranslate.To;
buttonTranslate.Text = Configuration.Settings.Language.GoogleTranslate.Translate;
labelPleaseWait.Text = Configuration.Settings.Language.GoogleTranslate.PleaseWait;
linkLabelPoweredByGoogleTranslate.Text = Configuration.Settings.Language.GoogleTranslate.PoweredByGoogleTranslate;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListViewFrom.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
subtitleListViewTo.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
internal void Initialize(Subtitle subtitle, string title, bool googleTranslate)
{
if (title != null)
Text = title;
_googleTranslate = googleTranslate;
if (!_googleTranslate)
{
linkLabelPoweredByGoogleTranslate.Text = Configuration.Settings.Language.GoogleTranslate.PoweredByMicrosoftTranslate;
}
labelPleaseWait.Visible = false;
progressBar1.Visible = false;
_subtitle = subtitle;
_translatedSubtitle = new Subtitle(subtitle);
string defaultFromLanguage = Utilities.AutoDetectGoogleLanguage(subtitle);
FillComboWithLanguages(comboBoxFrom);
int i=0;
foreach (ComboBoxItem item in comboBoxFrom.Items)
{
if (item.Value == defaultFromLanguage)
{
comboBoxFrom.SelectedIndex = i;
break;
}
i++;
}
FillComboWithLanguages(comboBoxTo);
i = 0;
string uiCultureTL = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName.ToLower();
if (uiCultureTL == defaultFromLanguage)
{
foreach (string s in Utilities.GetDictionaryLanguages())
{
string temp = s.Replace("[", string.Empty).Replace("]", string.Empty);
if (temp.Length > 4)
{
temp = temp.Substring(temp.Length - 5,2).ToLower();
if (temp != uiCultureTL)
{
uiCultureTL = temp;
break;
}
}
}
}
comboBoxTo.SelectedIndex = 0;
foreach (ComboBoxItem item in comboBoxTo.Items)
{
if (item.Value == uiCultureTL)
{
comboBoxTo.SelectedIndex = i;
break;
}
i++;
}
subtitleListViewFrom.Fill(subtitle);
GoogleTranslate_Resize(null, null);
}
private void buttonTranslate_Click(object sender, EventArgs e)
{
if (buttonTranslate.Text == Configuration.Settings.Language.General.Cancel)
{
buttonTranslate.Enabled = false;
_breakTranslation = true;
buttonOK.Enabled = true;
buttonCancel.Enabled = true;
return;
}
if (!_googleTranslate)
{
DoMicrosoftTranslate();
return;
}
buttonOK.Enabled = false;
buttonCancel.Enabled = false;
_breakTranslation = false;
buttonTranslate.Text = Configuration.Settings.Language.General.Cancel;
const int textMaxSize = 1000;
Cursor.Current = Cursors.WaitCursor;
progressBar1.Maximum = _subtitle.Paragraphs.Count;
progressBar1.Value = 0;
progressBar1.Visible = true;
labelPleaseWait.Visible = true;
int start = 0;
try
{
StringBuilder sb = new StringBuilder();
int index = 0;
foreach (Paragraph p in _subtitle.Paragraphs)
{
string text = string.Format("<p>{0}</p>", p.Text);
if (HttpUtility.UrlEncode(sb.ToString() + text).Length >= textMaxSize)
{
FillTranslatedText(DoTranslate(sb.ToString()), start, index-1);
sb = new StringBuilder();
progressBar1.Refresh();
Application.DoEvents();
start = index;
}
sb.Append(text);
index++;
progressBar1.Value = index;
if (_breakTranslation)
break;
}
if (sb.Length > 0)
FillTranslatedText(DoTranslate(sb.ToString()), start, index-1);
}
finally
{
labelPleaseWait.Visible = false;
progressBar1.Visible = false;
Cursor.Current = Cursors.Default;
buttonTranslate.Text = Configuration.Settings.Language.GoogleTranslate.Translate;
buttonTranslate.Enabled = true;
buttonOK.Enabled = true;
buttonCancel.Enabled = true;
}
}
private void FillTranslatedText(string translatedText, int start, int end)
{
List<string> lines = new List<string>();
foreach (string s in translatedText.Split(new string[] { "<p>" }, StringSplitOptions.None))
lines.Add(s);
lines.RemoveAt(0);
int index = start;
foreach (string s in lines)
{
if (index < _translatedSubtitle.Paragraphs.Count)
{
string cleanText = s.Replace("</p>", string.Empty).Trim();
cleanText = cleanText.Replace(" ...", "...");
cleanText = cleanText.Replace("<br>", Environment.NewLine);
cleanText = cleanText.Replace("<br/>", Environment.NewLine);
cleanText = cleanText.Replace("<br />", Environment.NewLine);
cleanText = cleanText.Replace(Environment.NewLine + " ", Environment.NewLine);
_translatedSubtitle.Paragraphs[index].Text = cleanText;
}
index++;
}
subtitleListViewTo.Fill(_translatedSubtitle);
subtitleListViewTo.SelectIndexAndEnsureVisible(end);
}
private string DoTranslate(string input)
{
string languagePair = (comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|" +
(comboBoxTo.SelectedItem as ComboBoxItem).Value;
input = PreTranslate(input);
string result;
try
{
result = TranslateTextViaApi(input, languagePair);
}
catch
{
result = string.Empty;
}
// fallback to screen scraping
if (string.IsNullOrEmpty(result))
result = TranslateTextViaScreenScraping(input, languagePair);
return PostTranslate(result);
}
public static string TranslateTextViaApi(string input, string languagePair)
{
input = input.Replace(Environment.NewLine, "<br/>");
input = input.Replace("'", "&apos;");
// create the web request to the Google Translate REST interface
WebRequest request = WebRequest.Create("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=" + HttpUtility.UrlEncode(input) + "&langpair=" + languagePair);
request.Proxy = Utilities.GetProxy();
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8);
string content = reader.ReadToEnd();
string key = "{\"translatedText\":";
if (content.Contains(key))
{
int start = content.IndexOf(key) + key.Length + 1;
int end = content.IndexOf("\"}", start);
string translatedText = content.Substring(start, end - start);
string test = translatedText.Replace("\\u003c", "<");
test = test.Replace("\\u003e", ">");
test = test.Replace("\\u0026#39;", "'");
test = test.Replace("\\u0026amp;", "&");
test = test.Replace("\\u0026quot;", "\"");
test = test.Replace("\\u0026lt;", "<");
test = test.Replace("\\u0026gt;", ">");
test = test.Replace("\\u003d", "=");
test = test.Replace("\\\"", "\"");
test = test.Replace(" <br/>", Environment.NewLine);
test = test.Replace("<br/>", Environment.NewLine);
test = RemovePStyleParameters(test);
return test;
}
return string.Empty;
}
private static string RemovePStyleParameters(string test)
{
string key = "<p style";
while (test.Contains(key))
{
int startPosition = test.IndexOf(key);
int endPosition = test.IndexOf(">", startPosition + key.Length);
if (endPosition == -1)
return test;
test = test.Remove(startPosition + 2, endPosition-startPosition-2);
}
return test;
}
/// <summary>
/// Translate Text using Google Translate API's
/// Google URL - http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}
/// </summary>
/// <param name="input">Input string</param>
/// <param name="languagePair">2 letter Language Pair, delimited by "|".
/// E.g. "ar|en" language pair means to translate from Arabic to English</param>
/// <returns>Translated to String</returns>
public static string TranslateTextViaScreenScraping(string input, string languagePair)
{
input = input.Replace(Environment.NewLine, "<br/>");
input = input.Replace("'", "&apos;");
//string url = String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}", HttpUtility.UrlEncode(input), languagePair);
string url = String.Format("http://translate.google.com/?hl=en&eotf=1&sl={0}&tl={1}&q={2}", languagePair.Substring(0, 2), languagePair.Substring(3), HttpUtility.UrlEncode(input));
WebClient webClient = new WebClient();
webClient.Proxy = Utilities.GetProxy();
webClient.Encoding = System.Text.Encoding.Default;
string result = webClient.DownloadString(url);
int startIndex = result.IndexOf("<span id=result_box");
StringBuilder sb = new StringBuilder();
if (startIndex > 0)
{
startIndex = result.IndexOf("<span title=", startIndex);
while (startIndex > 0)
{
startIndex = result.IndexOf(">", startIndex);
if (startIndex > 0)
{
startIndex++;
int endIndex = result.IndexOf("</span>", startIndex);
string translatedText = result.Substring(startIndex, endIndex - startIndex);
string test = HttpUtility.HtmlDecode(translatedText);
sb.Append(test);
startIndex = result.IndexOf("<span title=", startIndex);
}
}
}
string res = sb.ToString();
res = res.Replace(" <br/>", Environment.NewLine);
res = res.Replace("<br/>", Environment.NewLine);
res = res.Replace("<br />", Environment.NewLine);
res = res.Replace("< p >", "<p>");
res = res.Replace("< p>", "<p>");
res = res.Replace("<p >", "<p>");
res = res.Replace("</ p>", "</p>");
res = res.Replace("< / p >", "</p>");
res = res.Replace("< / p>", "</p>");
res = res.Replace(" </p>", "</p>");
res = res.Replace(" </p>", "</p>");
res = res.Replace("</p> ", "</p>");
res = res.Replace("</p> ", "</p>");
res = res.Replace("</p> ", "</p>");
res = res.Replace("</p><p>", "@__P_TAG");
res = res.Replace("</p>", "</p><p>");
res = res.Replace("@__P_TAG", "</p><p>");
int end = res.LastIndexOf("<p>");
if (end > 0)
{
res = res.Substring(0, end);
}
return res;
}
public void FillComboWithLanguages(ComboBox comboBox)
{
if (!_googleTranslate)
{
if (comboBox == comboBoxTo)
{
foreach (ComboBoxItem item in comboBoxFrom.Items)
{
comboBoxTo.Items.Add(new ComboBoxItem(item.Text, item.Value));
}
return;
}
MicrosoftTranslationService.SoapService client = MsTranslationServiceClient;
string[] locales = client.GetLanguagesForTranslate(BingApiId);
string[] names = client.GetLanguageNames(BingApiId, "en", locales);
for (int i = 0; i < locales.Length; i++)
{
if (names.Length > i && locales.Length > i)
comboBox.Items.Add(new ComboBoxItem(names[i], locales[i]));
}
return;
}
comboBox.Items.Add(new ComboBoxItem("AFRIKAANS", "af"));
comboBox.Items.Add(new ComboBoxItem("ALBANIAN" , "sq"));
comboBox.Items.Add(new ComboBoxItem("AMHARIC" , "am"));
comboBox.Items.Add(new ComboBoxItem("ARABIC" , "ar"));
// comboBox.Items.Add(new ComboBoxItem("ARMENIAN" , "hy"));
comboBox.Items.Add(new ComboBoxItem("AZERBAIJANI" , "az"));
comboBox.Items.Add(new ComboBoxItem("BASQUE" , "eu"));
comboBox.Items.Add(new ComboBoxItem("BELARUSIAN" , "be"));
// comboBox.Items.Add(new ComboBoxItem("BENGALI" , "bn"));
// comboBox.Items.Add(new ComboBoxItem("BIHARI" , "bh"));
comboBox.Items.Add(new ComboBoxItem("BULGARIAN" , "bg"));
// comboBox.Items.Add(new ComboBoxItem("BURMESE" , "my"));
comboBox.Items.Add(new ComboBoxItem("CATALAN" , "ca"));
// comboBox.Items.Add(new ComboBoxItem("CHEROKEE" , "chr"));
comboBox.Items.Add(new ComboBoxItem("CHINESE" , "zh"));
comboBox.Items.Add(new ComboBoxItem("CHINESE_SIMPLIFIED" , "zh-CN"));
comboBox.Items.Add(new ComboBoxItem("CHINESE_TRADITIONAL" , "zh-TW"));
comboBox.Items.Add(new ComboBoxItem("CROATIAN" , "hr"));
comboBox.Items.Add(new ComboBoxItem("CZECH" , "cs"));
comboBox.Items.Add(new ComboBoxItem("DANISH" , "da"));
// comboBox.Items.Add(new ComboBoxItem("DHIVEHI" , "dv"));
comboBox.Items.Add(new ComboBoxItem("DUTCH", "nl"));
comboBox.Items.Add(new ComboBoxItem("ENGLISH" , "en"));
// comboBox.Items.Add(new ComboBoxItem("ESPERANTO" , "eo"));
comboBox.Items.Add(new ComboBoxItem("ESTONIAN" , "et"));
comboBox.Items.Add(new ComboBoxItem("FILIPINO" , "tl"));
comboBox.Items.Add(new ComboBoxItem("FINNISH" , "fi"));
comboBox.Items.Add(new ComboBoxItem("FRENCH" , "fr"));
comboBox.Items.Add(new ComboBoxItem("GALICIAN" , "gl"));
comboBox.Items.Add(new ComboBoxItem("GEORGIAN" , "ka"));
comboBox.Items.Add(new ComboBoxItem("GERMAN" , "de"));
comboBox.Items.Add(new ComboBoxItem("GREEK" , "el"));
// comboBox.Items.Add(new ComboBoxItem("GUARANI" , "gn"));
// comboBox.Items.Add(new ComboBoxItem("GUJARATI" , "gu"));
comboBox.Items.Add(new ComboBoxItem("HEBREW" , "iw"));
comboBox.Items.Add(new ComboBoxItem("HINDI" , "hi"));
comboBox.Items.Add(new ComboBoxItem("HUNGARIAN" , "hu"));
comboBox.Items.Add(new ComboBoxItem("ICELANDIC", "is"));
comboBox.Items.Add(new ComboBoxItem("IRISH", "ga"));
comboBox.Items.Add(new ComboBoxItem("INDONESIAN", "id"));
// comboBox.Items.Add(new ComboBoxItem("INUKTITUT" , "iu"));
comboBox.Items.Add(new ComboBoxItem("ITALIAN" , "it"));
comboBox.Items.Add(new ComboBoxItem("JAPANESE" , "ja"));
// comboBox.Items.Add(new ComboBoxItem("KANNADA" , "kn"));
// comboBox.Items.Add(new ComboBoxItem("KAZAKH" , "kk"));
// comboBox.Items.Add(new ComboBoxItem("KHMER" , "km"));
comboBox.Items.Add(new ComboBoxItem("KOREAN" , "ko"));
// comboBox.Items.Add(new ComboBoxItem("KURDISH", "ku"));
// comboBox.Items.Add(new ComboBoxItem("KYRGYZ", "ky"));
// comboBox.Items.Add(new ComboBoxItem("LAOTHIAN", "lo"));
comboBox.Items.Add(new ComboBoxItem("LATVIAN" , "lv"));
comboBox.Items.Add(new ComboBoxItem("LITHUANIAN" , "lt"));
comboBox.Items.Add(new ComboBoxItem("MACEDONIAN" , "mk"));
comboBox.Items.Add(new ComboBoxItem("MALAY" , "ms"));
// comboBox.Items.Add(new ComboBoxItem("MALAYALAM" , "ml"));
comboBox.Items.Add(new ComboBoxItem("MALTESE" , "mt"));
// comboBox.Items.Add(new ComboBoxItem("MARATHI" , "mr"));
// comboBox.Items.Add(new ComboBoxItem("MONGOLIAN" , "mn"));
// comboBox.Items.Add(new ComboBoxItem("NEPALI" , "ne"));
comboBox.Items.Add(new ComboBoxItem("NORWEGIAN" , "no"));
// comboBox.Items.Add(new ComboBoxItem("ORIYA" , "or"));
// comboBox.Items.Add(new ComboBoxItem("PASHTO" , "ps"));
comboBox.Items.Add(new ComboBoxItem("PERSIAN" , "fa"));
comboBox.Items.Add(new ComboBoxItem("POLISH" , "pl"));
comboBox.Items.Add(new ComboBoxItem("PORTUGUESE" , "pt-PT"));
// comboBox.Items.Add(new ComboBoxItem("PUNJABI" , "pa"));
comboBox.Items.Add(new ComboBoxItem("ROMANIAN" , "ro"));
comboBox.Items.Add(new ComboBoxItem("RUSSIAN" , "ru"));
// comboBox.Items.Add(new ComboBoxItem("SANSKRIT" , "sa"));
comboBox.Items.Add(new ComboBoxItem("SERBIAN" , "sr"));
// comboBox.Items.Add(new ComboBoxItem("SINDHI" , "sd"));
// comboBox.Items.Add(new ComboBoxItem("SINHALESE" , "si"));
comboBox.Items.Add(new ComboBoxItem("SLOVAK" , "sk"));
comboBox.Items.Add(new ComboBoxItem("SLOVENIAN" , "sl"));
comboBox.Items.Add(new ComboBoxItem("SPANISH" , "es"));
comboBox.Items.Add(new ComboBoxItem("SWAHILI" , "sw"));
comboBox.Items.Add(new ComboBoxItem("SWEDISH" , "sv"));
// comboBox.Items.Add(new ComboBoxItem("TAJIK" , "tg"));
// comboBox.Items.Add(new ComboBoxItem("TAMIL" , "ta"));
comboBox.Items.Add(new ComboBoxItem("TAGALOG" , "tl"));
// comboBox.Items.Add(new ComboBoxItem("TELUGU" , "te"));
comboBox.Items.Add(new ComboBoxItem("THAI" , "th"));
// comboBox.Items.Add(new ComboBoxItem("TIBETAN" , "bo"));
comboBox.Items.Add(new ComboBoxItem("TURKISH" , "tr"));
comboBox.Items.Add(new ComboBoxItem("UKRAINIAN" , "uk"));
comboBox.Items.Add(new ComboBoxItem("URDU" , "ur"));
// comboBox.Items.Add(new ComboBoxItem("UZBEK" , "uz"));
// comboBox.Items.Add(new ComboBoxItem("UIGHUR" , "ug"));
comboBox.Items.Add(new ComboBoxItem("VIETNAMESE", "vi"));
comboBox.Items.Add(new ComboBoxItem("WELSH", "cy"));
comboBox.Items.Add(new ComboBoxItem("YIDDISH", "yi"));
}
private void LinkLabel1LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (_googleTranslate)
System.Diagnostics.Process.Start("http://www.google.com/translate");
else
System.Diagnostics.Process.Start("http://www.microsofttranslator.com/");
}
private void ButtonOkClick(object sender, EventArgs e)
{
if (subtitleListViewTo.Items.Count > 0)
{
DialogResult = DialogResult.OK;
}
else
{
DialogResult = DialogResult.Cancel;
}
}
private string PreTranslate(string s)
{
Regex reg;
if ((comboBoxFrom.SelectedItem as ComboBoxItem).Value == "en")
{
reg = new Regex("\\bI'm ");
s = reg.Replace(s, "I am ");
reg = new Regex("\\bI've ");
s = reg.Replace(s, "I have ");
reg = new Regex("\\bI'll ");
s = reg.Replace(s, "I will ");
reg = new Regex("\\bI'd "); // had or would???
s = reg.Replace(s, "I would ");
reg = new Regex("\\bIt's ");
s = reg.Replace(s, "It is ");
reg = new Regex("\\bit's ");
s = reg.Replace(s, "it is ");
reg = new Regex("\\bYou're ");
s = reg.Replace(s, "You are ");
reg = new Regex("\\byou're ");
s = reg.Replace(s, "You are ");
reg = new Regex("\\bYou've ");
s = reg.Replace(s, "You have ");
reg = new Regex("\\byou've ");
s = reg.Replace(s, "you have ");
reg = new Regex("\\bYou'll ");
s = reg.Replace(s, "You will ");
reg = new Regex("\\byou'll ");
s = reg.Replace(s, "you will ");
reg = new Regex("\\bYou'd "); // had or would???
s = reg.Replace(s, "You would ");
reg = new Regex("\\byou'd ");
s = reg.Replace(s, "you would ");
reg = new Regex("\\bHe's ");
s = reg.Replace(s, "He is ");
reg = new Regex("\\bhe's ");
s = reg.Replace(s, "he is ");
reg = new Regex("\\bShe's ");
s = reg.Replace(s, "She is ");
reg = new Regex("\\bshe's ");
s = reg.Replace(s, "she is ");
reg = new Regex("\\bWe're ");
s = reg.Replace(s, "We are ");
reg = new Regex("\\bwe're ");
s = reg.Replace(s, "we are ");
reg = new Regex("\\bwon't ");
s = reg.Replace(s, "will not ");
reg = new Regex("\\bThey're ");
s = reg.Replace(s, "They are ");
reg = new Regex("\\bthey're ");
s = reg.Replace(s, "they are ");
reg = new Regex("\\bWho's ");
s = reg.Replace(s, "Who is ");
reg = new Regex("\\bwho's ");
s = reg.Replace(s, "who is ");
reg = new Regex("\\bThat's ");
s = reg.Replace(s, "That is ");
reg = new Regex("\\bthat's ");
s = reg.Replace(s, "that is ");
reg = new Regex("\\bWhat's ");
s = reg.Replace(s, "What is ");
reg = new Regex("\\bwhat's ");
s = reg.Replace(s, "what is ");
reg = new Regex("\\bWhere's ");
s = reg.Replace(s, "Where is ");
reg = new Regex("\\bwhere's ");
s = reg.Replace(s, "where is ");
reg = new Regex("\\bWho's ");
s = reg.Replace(s, "Who is ");
reg = new Regex("\\bwho's ");
s = reg.Replace(s, "who is ");
reg = new Regex(" 'Cause "); // \b (word boundry) does not workig with '
s = reg.Replace(s, " Because ");
reg = new Regex(" 'cause ");
s = reg.Replace(s, " because ");
reg = new Regex("\\r\\n'Cause ");
s = reg.Replace(s, "\r\nBecause ");
reg = new Regex("\\r\\n'cause ");
s = reg.Replace(s, "\r\nbecause ");
reg = new Regex(">'Cause ");
s = reg.Replace(s, ">Because ");
reg = new Regex(">'cause ");
s = reg.Replace(s, ">because ");
}
return s;
}
private string PostTranslate(string s)
{
if ((comboBoxTo.SelectedItem as ComboBoxItem).Value == "da")
{
s = s.Replace("Jeg ved.", "Jeg ved det.");
s = s.Replace(", jeg ved.", ", jeg ved det.");
s = s.Replace("Jeg er ked af.", "Jeg er ked af det.");
s = s.Replace(", jeg er ked af.", ", jeg er ked af det.");
s = s.Replace("Come on.", "Kom nu.");
s = s.Replace(", come on.", ", kom nu.");
s = s.Replace("Come on,", "Kom nu,");
s = s.Replace("Hey ", "Hej ");
s = s.Replace("Hey,", "Hej,");
s = s.Replace(" gonna ", " ville ");
s = s.Replace("Gonna ", "Vil ");
s = s.Replace("Ked af.", "Undskyld.");
}
return s;
}
private void FormGoogleTranslate_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape && labelPleaseWait.Visible == false)
DialogResult = DialogResult.Cancel;
else if (e.KeyCode == Keys.Escape && labelPleaseWait.Visible)
{
_breakTranslation = true;
e.Handled = true;
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.F1)
Utilities.ShowHelp("#translation");
else if (e.Control && e.Shift && e.Alt && e.KeyCode == Keys.L)
{
Cursor.Current = Cursors.WaitCursor;
Configuration.Settings.Language.Save();
Language.TranslateViaGoogle((comboBoxFrom.SelectedItem as ComboBoxItem).Value + "|" +
(comboBoxTo.SelectedItem as ComboBoxItem).Value);
Cursor.Current = Cursors.Default;
}
}
private void GoogleTranslate_Resize(object sender, EventArgs e)
{
int width = (this.Width / 2) - (subtitleListViewFrom.Left * 3) + 19;
subtitleListViewFrom.Width = width;
subtitleListViewTo.Width = width;
int height = this.Height - (subtitleListViewFrom.Top + buttonTranslate.Height + 60);
subtitleListViewFrom.Height = height;
subtitleListViewTo.Height = height;
comboBoxFrom.Left = subtitleListViewFrom.Left + (subtitleListViewFrom.Width - comboBoxFrom.Width);
labelFrom.Left = comboBoxFrom.Left - 5 - labelFrom.Width;
subtitleListViewTo.Left = width + (subtitleListViewFrom.Left * 2);
labelTo.Left = subtitleListViewTo.Left;
comboBoxTo.Left = labelTo.Left + labelTo.Width + 5;
buttonTranslate.Left = comboBoxTo.Left + comboBoxTo.Width + 9;
labelPleaseWait.Left = buttonTranslate.Left + buttonTranslate.Width + 9;
progressBar1.Left = labelPleaseWait.Left;
progressBar1.Width = subtitleListViewTo.Width - (progressBar1.Left - subtitleListViewTo.Left);
}
private MicrosoftTranslationService.SoapService MsTranslationServiceClient
{
get
{
if (_microsoftTranslationService == null)
{
_microsoftTranslationService = new MicrosoftTranslationService.SoapService();
_microsoftTranslationService.Proxy = Utilities.GetProxy();
}
return _microsoftTranslationService;
}
}
private void DoMicrosoftTranslate()
{
string from = (comboBoxFrom.SelectedItem as ComboBoxItem).Value;
string to = (comboBoxTo.SelectedItem as ComboBoxItem).Value;
MicrosoftTranslationService.SoapService client = MsTranslationServiceClient;
_breakTranslation = false;
buttonTranslate.Text = Configuration.Settings.Language.General.Cancel;
const int textMaxSize = 10000;
Cursor.Current = Cursors.WaitCursor;
progressBar1.Maximum = _subtitle.Paragraphs.Count;
progressBar1.Value = 0;
progressBar1.Visible = true;
labelPleaseWait.Visible = true;
int start = 0;
try
{
StringBuilder sb = new StringBuilder();
int index = 0;
foreach (Paragraph p in _subtitle.Paragraphs)
{
string text = string.Format("<p>{0}</p>", p.Text);
if ((HttpUtility.UrlEncode(sb.ToString() + text)).Length >= textMaxSize)
{
FillTranslatedText(client.Translate(BingApiId, sb.ToString().Replace(Environment.NewLine, "<br />"), from, to), start, index - 1);
sb = new StringBuilder();
progressBar1.Refresh();
Application.DoEvents();
start = index;
}
sb.Append(text);
index++;
progressBar1.Value = index;
if (_breakTranslation)
break;
}
if (sb.Length > 0)
FillTranslatedText(client.Translate(BingApiId, sb.ToString(), from, to), start, index - 1);
}
finally
{
labelPleaseWait.Visible = false;
progressBar1.Visible = false;
Cursor.Current = Cursors.Default;
buttonTranslate.Text = Configuration.Settings.Language.GoogleTranslate.Translate;
buttonTranslate.Enabled = true;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

407
src/Forms/ImportText.Designer.cs generated Normal file
View File

@ -0,0 +1,407 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class ImportText
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOpenText = new System.Windows.Forms.Button();
this.groupBoxImportText = new System.Windows.Forms.GroupBox();
this.textBoxText = new System.Windows.Forms.TextBox();
this.groupBoxImportOptions = new System.Windows.Forms.GroupBox();
this.checkBoxMergeShortLines = new System.Windows.Forms.CheckBox();
this.groupBoxDuration = new System.Windows.Forms.GroupBox();
this.numericUpDownDurationFixed = new System.Windows.Forms.NumericUpDown();
this.radioButtonDurationFixed = new System.Windows.Forms.RadioButton();
this.radioButtonDurationAuto = new System.Windows.Forms.RadioButton();
this.buttonRefresh = new System.Windows.Forms.Button();
this.numericUpDownGapBetweenLines = new System.Windows.Forms.NumericUpDown();
this.labelGapBetweenSubtitles = new System.Windows.Forms.Label();
this.checkBoxRemoveLinesWithoutLetters = new System.Windows.Forms.CheckBox();
this.groupBoxSplitting = new System.Windows.Forms.GroupBox();
this.radioButtonAutoSplit = new System.Windows.Forms.RadioButton();
this.radioButtonLineMode = new System.Windows.Forms.RadioButton();
this.checkBoxRemoveEmptyLines = new System.Windows.Forms.CheckBox();
this.groupBoxImportResult = new System.Windows.Forms.GroupBox();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.SubtitleListview1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.groupBoxImportText.SuspendLayout();
this.groupBoxImportOptions.SuspendLayout();
this.groupBoxDuration.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDurationFixed)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownGapBetweenLines)).BeginInit();
this.groupBoxSplitting.SuspendLayout();
this.groupBoxImportResult.SuspendLayout();
this.SuspendLayout();
//
// buttonOpenText
//
this.buttonOpenText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOpenText.Location = new System.Drawing.Point(358, 19);
this.buttonOpenText.Name = "buttonOpenText";
this.buttonOpenText.Size = new System.Drawing.Size(143, 21);
this.buttonOpenText.TabIndex = 0;
this.buttonOpenText.Text = "Open file...";
this.buttonOpenText.UseVisualStyleBackColor = true;
this.buttonOpenText.Click += new System.EventHandler(this.buttonOpenText_Click);
//
// groupBoxImportText
//
this.groupBoxImportText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxImportText.Controls.Add(this.textBoxText);
this.groupBoxImportText.Controls.Add(this.buttonOpenText);
this.groupBoxImportText.Location = new System.Drawing.Point(12, 12);
this.groupBoxImportText.Name = "groupBoxImportText";
this.groupBoxImportText.Size = new System.Drawing.Size(507, 326);
this.groupBoxImportText.TabIndex = 13;
this.groupBoxImportText.TabStop = false;
this.groupBoxImportText.Text = "Import text";
//
// textBoxText
//
this.textBoxText.AllowDrop = true;
this.textBoxText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBoxText.Location = new System.Drawing.Point(6, 48);
this.textBoxText.MaxLength = 232767;
this.textBoxText.Multiline = true;
this.textBoxText.Name = "textBoxText";
this.textBoxText.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textBoxText.Size = new System.Drawing.Size(495, 272);
this.textBoxText.TabIndex = 2;
this.textBoxText.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBoxText_DragDrop);
this.textBoxText.DragEnter += new System.Windows.Forms.DragEventHandler(this.textBoxText_DragEnter);
//
// groupBoxImportOptions
//
this.groupBoxImportOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxImportOptions.Controls.Add(this.checkBoxMergeShortLines);
this.groupBoxImportOptions.Controls.Add(this.groupBoxDuration);
this.groupBoxImportOptions.Controls.Add(this.buttonRefresh);
this.groupBoxImportOptions.Controls.Add(this.numericUpDownGapBetweenLines);
this.groupBoxImportOptions.Controls.Add(this.labelGapBetweenSubtitles);
this.groupBoxImportOptions.Controls.Add(this.checkBoxRemoveLinesWithoutLetters);
this.groupBoxImportOptions.Controls.Add(this.groupBoxSplitting);
this.groupBoxImportOptions.Controls.Add(this.checkBoxRemoveEmptyLines);
this.groupBoxImportOptions.Location = new System.Drawing.Point(525, 12);
this.groupBoxImportOptions.Name = "groupBoxImportOptions";
this.groupBoxImportOptions.Size = new System.Drawing.Size(310, 326);
this.groupBoxImportOptions.TabIndex = 14;
this.groupBoxImportOptions.TabStop = false;
this.groupBoxImportOptions.Text = "Import options";
//
// checkBoxMergeShortLines
//
this.checkBoxMergeShortLines.AutoSize = true;
this.checkBoxMergeShortLines.Checked = true;
this.checkBoxMergeShortLines.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxMergeShortLines.Location = new System.Drawing.Point(6, 98);
this.checkBoxMergeShortLines.Name = "checkBoxMergeShortLines";
this.checkBoxMergeShortLines.Size = new System.Drawing.Size(189, 17);
this.checkBoxMergeShortLines.TabIndex = 40;
this.checkBoxMergeShortLines.Text = "Merge short lines with continuation";
this.checkBoxMergeShortLines.UseVisualStyleBackColor = true;
this.checkBoxMergeShortLines.CheckedChanged += new System.EventHandler(this.checkBoxMergeShortLines_CheckedChanged);
//
// groupBoxDuration
//
this.groupBoxDuration.Controls.Add(this.numericUpDownDurationFixed);
this.groupBoxDuration.Controls.Add(this.radioButtonDurationFixed);
this.groupBoxDuration.Controls.Add(this.radioButtonDurationAuto);
this.groupBoxDuration.Location = new System.Drawing.Point(6, 223);
this.groupBoxDuration.Name = "groupBoxDuration";
this.groupBoxDuration.Size = new System.Drawing.Size(298, 63);
this.groupBoxDuration.TabIndex = 39;
this.groupBoxDuration.TabStop = false;
this.groupBoxDuration.Text = "Duration";
//
// numericUpDownDurationFixed
//
this.numericUpDownDurationFixed.Location = new System.Drawing.Point(86, 39);
this.numericUpDownDurationFixed.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDownDurationFixed.Minimum = new decimal(new int[] {
100,
0,
0,
0});
this.numericUpDownDurationFixed.Name = "numericUpDownDurationFixed";
this.numericUpDownDurationFixed.Size = new System.Drawing.Size(64, 20);
this.numericUpDownDurationFixed.TabIndex = 37;
this.numericUpDownDurationFixed.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// radioButtonDurationFixed
//
this.radioButtonDurationFixed.AutoSize = true;
this.radioButtonDurationFixed.Location = new System.Drawing.Point(19, 42);
this.radioButtonDurationFixed.Name = "radioButtonDurationFixed";
this.radioButtonDurationFixed.Size = new System.Drawing.Size(50, 17);
this.radioButtonDurationFixed.TabIndex = 3;
this.radioButtonDurationFixed.Text = "Fixed";
this.radioButtonDurationFixed.UseVisualStyleBackColor = true;
this.radioButtonDurationFixed.CheckedChanged += new System.EventHandler(this.radioButtonDurationFixed_CheckedChanged);
//
// radioButtonDurationAuto
//
this.radioButtonDurationAuto.AutoSize = true;
this.radioButtonDurationAuto.Checked = true;
this.radioButtonDurationAuto.Location = new System.Drawing.Point(19, 19);
this.radioButtonDurationAuto.Name = "radioButtonDurationAuto";
this.radioButtonDurationAuto.Size = new System.Drawing.Size(47, 17);
this.radioButtonDurationAuto.TabIndex = 2;
this.radioButtonDurationAuto.TabStop = true;
this.radioButtonDurationAuto.Text = "Auto";
this.radioButtonDurationAuto.UseVisualStyleBackColor = true;
//
// buttonRefresh
//
this.buttonRefresh.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonRefresh.Location = new System.Drawing.Point(11, 299);
this.buttonRefresh.Name = "buttonRefresh";
this.buttonRefresh.Size = new System.Drawing.Size(102, 21);
this.buttonRefresh.TabIndex = 38;
this.buttonRefresh.Text = "Refresh";
this.buttonRefresh.UseVisualStyleBackColor = true;
this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click);
//
// numericUpDownGapBetweenLines
//
this.numericUpDownGapBetweenLines.Location = new System.Drawing.Point(9, 191);
this.numericUpDownGapBetweenLines.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDownGapBetweenLines.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownGapBetweenLines.Name = "numericUpDownGapBetweenLines";
this.numericUpDownGapBetweenLines.Size = new System.Drawing.Size(64, 20);
this.numericUpDownGapBetweenLines.TabIndex = 36;
this.numericUpDownGapBetweenLines.Value = new decimal(new int[] {
1000,
0,
0,
0});
//
// labelGapBetweenSubtitles
//
this.labelGapBetweenSubtitles.AutoSize = true;
this.labelGapBetweenSubtitles.Location = new System.Drawing.Point(6, 175);
this.labelGapBetweenSubtitles.Name = "labelGapBetweenSubtitles";
this.labelGapBetweenSubtitles.Size = new System.Drawing.Size(177, 13);
this.labelGapBetweenSubtitles.TabIndex = 37;
this.labelGapBetweenSubtitles.Text = "Gap between subtitles (milliseconds)";
//
// checkBoxRemoveLinesWithoutLetters
//
this.checkBoxRemoveLinesWithoutLetters.AutoSize = true;
this.checkBoxRemoveLinesWithoutLetters.Checked = true;
this.checkBoxRemoveLinesWithoutLetters.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveLinesWithoutLetters.Location = new System.Drawing.Point(6, 144);
this.checkBoxRemoveLinesWithoutLetters.Name = "checkBoxRemoveLinesWithoutLetters";
this.checkBoxRemoveLinesWithoutLetters.Size = new System.Drawing.Size(158, 17);
this.checkBoxRemoveLinesWithoutLetters.TabIndex = 5;
this.checkBoxRemoveLinesWithoutLetters.Text = "Remove lines without letters";
this.checkBoxRemoveLinesWithoutLetters.UseVisualStyleBackColor = true;
this.checkBoxRemoveLinesWithoutLetters.CheckedChanged += new System.EventHandler(this.checkBoxRemoveLinesWithoutLettersOrNumbers_CheckedChanged);
//
// groupBoxSplitting
//
this.groupBoxSplitting.Controls.Add(this.radioButtonAutoSplit);
this.groupBoxSplitting.Controls.Add(this.radioButtonLineMode);
this.groupBoxSplitting.Location = new System.Drawing.Point(6, 19);
this.groupBoxSplitting.Name = "groupBoxSplitting";
this.groupBoxSplitting.Size = new System.Drawing.Size(298, 65);
this.groupBoxSplitting.TabIndex = 4;
this.groupBoxSplitting.TabStop = false;
this.groupBoxSplitting.Text = "Splitting";
//
// radioButtonAutoSplit
//
this.radioButtonAutoSplit.AutoSize = true;
this.radioButtonAutoSplit.Checked = true;
this.radioButtonAutoSplit.Location = new System.Drawing.Point(6, 19);
this.radioButtonAutoSplit.Name = "radioButtonAutoSplit";
this.radioButtonAutoSplit.Size = new System.Drawing.Size(88, 17);
this.radioButtonAutoSplit.TabIndex = 2;
this.radioButtonAutoSplit.TabStop = true;
this.radioButtonAutoSplit.Text = "Auto split text";
this.radioButtonAutoSplit.UseVisualStyleBackColor = true;
this.radioButtonAutoSplit.CheckedChanged += new System.EventHandler(this.radioButtonAutoSplit_CheckedChanged);
//
// radioButtonLineMode
//
this.radioButtonLineMode.AutoSize = true;
this.radioButtonLineMode.Location = new System.Drawing.Point(6, 42);
this.radioButtonLineMode.Name = "radioButtonLineMode";
this.radioButtonLineMode.Size = new System.Drawing.Size(131, 17);
this.radioButtonLineMode.TabIndex = 0;
this.radioButtonLineMode.Text = "One line is one subtitle";
this.radioButtonLineMode.UseVisualStyleBackColor = true;
this.radioButtonLineMode.CheckedChanged += new System.EventHandler(this.radioButtonLineMode_CheckedChanged);
//
// checkBoxRemoveEmptyLines
//
this.checkBoxRemoveEmptyLines.AutoSize = true;
this.checkBoxRemoveEmptyLines.Checked = true;
this.checkBoxRemoveEmptyLines.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveEmptyLines.Location = new System.Drawing.Point(6, 121);
this.checkBoxRemoveEmptyLines.Name = "checkBoxRemoveEmptyLines";
this.checkBoxRemoveEmptyLines.Size = new System.Drawing.Size(121, 17);
this.checkBoxRemoveEmptyLines.TabIndex = 3;
this.checkBoxRemoveEmptyLines.Text = "Remove empty lines";
this.checkBoxRemoveEmptyLines.UseVisualStyleBackColor = true;
this.checkBoxRemoveEmptyLines.CheckedChanged += new System.EventHandler(this.checkBoxRemoveEmptyLines_CheckedChanged);
//
// groupBoxImportResult
//
this.groupBoxImportResult.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.groupBoxImportResult.Controls.Add(this.SubtitleListview1);
this.groupBoxImportResult.Location = new System.Drawing.Point(12, 344);
this.groupBoxImportResult.Name = "groupBoxImportResult";
this.groupBoxImportResult.Size = new System.Drawing.Size(823, 227);
this.groupBoxImportResult.TabIndex = 15;
this.groupBoxImportResult.TabStop = false;
this.groupBoxImportResult.Text = "Preview";
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// buttonCancel
//
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(754, 579);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 17;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// 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(673, 579);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 16;
this.buttonOK.Text = "&Next >>";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
//
// SubtitleListview1
//
this.SubtitleListview1.AllowDrop = true;
this.SubtitleListview1.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.SubtitleListview1.FirstVisibleIndex = -1;
this.SubtitleListview1.FullRowSelect = true;
this.SubtitleListview1.GridLines = true;
this.SubtitleListview1.HideSelection = false;
this.SubtitleListview1.Location = new System.Drawing.Point(6, 19);
this.SubtitleListview1.MultiSelect = false;
this.SubtitleListview1.Name = "SubtitleListview1";
this.SubtitleListview1.Size = new System.Drawing.Size(811, 186);
this.SubtitleListview1.TabIndex = 12;
this.SubtitleListview1.UseCompatibleStateImageBehavior = false;
this.SubtitleListview1.View = System.Windows.Forms.View.Details;
//
// ImportText
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(847, 612);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.groupBoxImportResult);
this.Controls.Add(this.groupBoxImportOptions);
this.Controls.Add(this.groupBoxImportText);
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(810, 648);
this.Name = "ImportText";
this.ShowIcon = false;
this.Text = "Import text";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ImportText_KeyDown);
this.groupBoxImportText.ResumeLayout(false);
this.groupBoxImportText.PerformLayout();
this.groupBoxImportOptions.ResumeLayout(false);
this.groupBoxImportOptions.PerformLayout();
this.groupBoxDuration.ResumeLayout(false);
this.groupBoxDuration.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDurationFixed)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownGapBetweenLines)).EndInit();
this.groupBoxSplitting.ResumeLayout(false);
this.groupBoxSplitting.PerformLayout();
this.groupBoxImportResult.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button buttonOpenText;
private Controls.SubtitleListView SubtitleListview1;
private System.Windows.Forms.GroupBox groupBoxImportText;
private System.Windows.Forms.TextBox textBoxText;
private System.Windows.Forms.GroupBox groupBoxImportOptions;
private System.Windows.Forms.GroupBox groupBoxImportResult;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.GroupBox groupBoxSplitting;
private System.Windows.Forms.RadioButton radioButtonAutoSplit;
private System.Windows.Forms.RadioButton radioButtonLineMode;
private System.Windows.Forms.CheckBox checkBoxRemoveEmptyLines;
private System.Windows.Forms.CheckBox checkBoxRemoveLinesWithoutLetters;
private System.Windows.Forms.NumericUpDown numericUpDownGapBetweenLines;
private System.Windows.Forms.Label labelGapBetweenSubtitles;
private System.Windows.Forms.Button buttonRefresh;
private System.Windows.Forms.GroupBox groupBoxDuration;
private System.Windows.Forms.NumericUpDown numericUpDownDurationFixed;
private System.Windows.Forms.RadioButton radioButtonDurationFixed;
private System.Windows.Forms.RadioButton radioButtonDurationAuto;
private System.Windows.Forms.CheckBox checkBoxMergeShortLines;
}
}

351
src/Forms/ImportText.cs Normal file
View File

@ -0,0 +1,351 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ImportText : Form
{
Subtitle _subtitle;
string _videoFileName;
public Subtitle FixedSubtitle { get { return _subtitle; } }
public string VideoFileName { get { return _videoFileName; } }
public ImportText()
{
InitializeComponent();
this.Text = Configuration.Settings.Language.ImportText.Title;
groupBoxImportText.Text = Configuration.Settings.Language.ImportText.Title;
buttonOpenText.Text = Configuration.Settings.Language.ImportText.OpenTextFile;
groupBoxImportOptions.Text = Configuration.Settings.Language.ImportText.ImportOptions;
groupBoxSplitting.Text = Configuration.Settings.Language.ImportText.Splitting;
radioButtonAutoSplit.Text = Configuration.Settings.Language.ImportText.AutoSplitText;
radioButtonLineMode.Text = Configuration.Settings.Language.ImportText.OneLineIsOneSubtitle;
checkBoxMergeShortLines.Text = Configuration.Settings.Language.ImportText.MergeShortLines;
checkBoxRemoveEmptyLines.Text = Configuration.Settings.Language.ImportText.RemoveEmptyLines;
checkBoxRemoveLinesWithoutLetters.Text = Configuration.Settings.Language.ImportText.RemoveLinesWithoutLetters;
labelGapBetweenSubtitles.Text = Configuration.Settings.Language.ImportText.GapBetweenSubtitles;
groupBoxDuration.Text = Configuration.Settings.Language.General.Duration;
radioButtonDurationAuto.Text = Configuration.Settings.Language.ImportText.Auto;
radioButtonDurationFixed.Text = Configuration.Settings.Language.ImportText.Fixed;
buttonRefresh.Text = Configuration.Settings.Language.ImportText.Refresh;
groupBoxImportResult.Text = Configuration.Settings.Language.General.Preview;
buttonOK.Text = Configuration.Settings.Language.ImportText.Next;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
SubtitleListview1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
numericUpDownDurationFixed.Enabled = radioButtonDurationFixed.Checked;
}
private void buttonOpenText_Click(object sender, EventArgs e)
{
openFileDialog1.Title = buttonOpenText.Text;
openFileDialog1.Filter = Configuration.Settings.Language.ImportText.TextFiles + "|*.txt|" + Configuration.Settings.Language.General.AllFiles + "|*.*";
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
LoadTextFile(openFileDialog1.FileName);
}
private void GeneratePreview()
{
_subtitle = new Subtitle();
if (radioButtonLineMode.Checked)
ImportLineMode(textBoxText.Lines);
else
ImportAutoSplit(textBoxText.Lines);
if (checkBoxMergeShortLines.Checked)
MergeLinesWithContinuation();
_subtitle.Renumber(1);
FixDurations();
MakePseudoStartTime();
groupBoxImportResult.Text = string.Format(Configuration.Settings.Language.ImportText.PreviewLinesModifiedX, _subtitle.Paragraphs.Count);
SubtitleListview1.Fill(_subtitle);
if (_subtitle.Paragraphs.Count > 0)
SubtitleListview1.Items[0].Selected = true;
}
private void MergeLinesWithContinuation()
{
Subtitle temp = new Subtitle();
bool skipNext = false;
for (int i=0; i < _subtitle.Paragraphs.Count; i++)
{
Paragraph p = _subtitle.Paragraphs[i];
if (!skipNext)
{
Paragraph next = _subtitle.GetParagraphOrDefault(i + 1);
bool merge = true;
if (p.Text.Contains(Environment.NewLine) || next == null)
merge = false;
if (merge && (p.Text.TrimEnd().EndsWith("!") || p.Text.TrimEnd().EndsWith(".") || p.Text.TrimEnd().EndsWith("!")))
{
StripableText st = new StripableText(p.Text);
if (st.StrippedText.Length > 0 && Utilities.GetLetters(true, false, false).Contains(st.StrippedText[0].ToString()))
merge = false;
}
if (merge && (p.Text.Length >= Configuration.Settings.General.SubtitleLineMaximumLength - 5 || next.Text.Length >= Configuration.Settings.General.SubtitleLineMaximumLength - 5))
merge = false;
if (merge)
{
temp.Paragraphs.Add(new Paragraph() { Text = p.Text + Environment.NewLine + next.Text });
skipNext = true;
}
else
{
temp.Paragraphs.Add(new Paragraph(p));
}
}
else
{
skipNext = false;
}
}
_subtitle = temp;
}
private void MakePseudoStartTime()
{
double millisecondsInterval = (double)numericUpDownGapBetweenLines.Value;
double millisecondsIndex = millisecondsInterval;
foreach (Paragraph p in _subtitle.Paragraphs)
{
p.EndTime.TotalMilliseconds = millisecondsIndex + p.Duration.TotalMilliseconds;
p.StartTime.TotalMilliseconds = millisecondsIndex;
millisecondsIndex += p.Duration.TotalMilliseconds + millisecondsInterval;
}
}
private void FixDurations()
{
foreach (Paragraph p in _subtitle.Paragraphs)
{
if (p.Text.Length == 0)
{
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + 2000;
}
else
{
if (radioButtonDurationAuto.Checked)
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + (Utilities.GetDisplayMillisecondsFromText(p.Text) * 1.2);
else
p.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds + ((double)numericUpDownDurationFixed.Value);
}
}
}
private void ImportLineMode(IEnumerable<string> lines)
{
foreach (string line in lines)
{
if (line.Trim().Length == 0)
{
if (!checkBoxRemoveEmptyLines.Checked)
_subtitle.Paragraphs.Add(new Paragraph());
}
else if (!ContainsLetters(line))
{
if (!checkBoxRemoveLinesWithoutLetters.Checked)
_subtitle.Paragraphs.Add(new Paragraph(0, 0, line.Trim()));
}
else
{
_subtitle.Paragraphs.Add(new Paragraph(0, 0, line.Trim()));
}
}
}
private void ImportAutoSplit(IEnumerable<string> textLines)
{
StringBuilder sb = new StringBuilder();
foreach (string line in textLines)
{
if (line.Trim().Length == 0)
{
if (!checkBoxRemoveEmptyLines.Checked)
sb.AppendLine();
}
else if (!ContainsLetters(line.Trim()))
{
if (!checkBoxRemoveLinesWithoutLetters.Checked)
sb.AppendLine(line);
}
else
{
sb.AppendLine(line);
}
}
string text = sb.ToString().Replace(Environment.NewLine, " ");
while (text.Contains(" "))
text = text.Replace(" ", " ");
text = text.Replace("!", "_@EXM_.");
text = text.Replace("?", "_@QST_.");
text = text.Replace(".", "_@PER_.");
string[] lines = text.Split('.');
for (int i=0; i<lines.Length; i++)
{
lines[i] = lines[i].Replace("_@EXM_", "!");
lines[i] = lines[i].Replace("_@QST_", "?");
lines[i] = lines[i].Replace("_@PER_", ".");
}
List<string> list = new List<string>();
foreach (string s in lines)
AutoSplit(list, s);
ImportLineMode(list);
}
private void AutoSplit(List<string> list, string line)
{
foreach (string split in Utilities.AutoBreakLine(line).Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
if (split.Length < Configuration.Settings.General.SubtitleLineMaximumLength)
list.Add(split);
else
AutoSplit(list, split);
}
}
private bool ContainsLetters(string line)
{
string letterList = Utilities.GetLetters(true, true, false);
foreach (char ch in line.ToCharArray())
{
if (letterList.Contains(ch.ToString()))
return true;
}
return false;
}
private void buttonOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void checkBoxRemoveLinesWithoutLettersOrNumbers_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void checkBoxRemoveEmptyLines_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void radioButtonLineMode_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void radioButtonOneTwoLineMode_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void radioButtonAutoSplit_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void textBoxText_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
e.Effect = DragDropEffects.All;
}
private void textBoxText_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
if (files.Length == 1)
{
LoadTextFile(files[0]);
}
}
private void LoadTextFile(string fileName)
{
try
{
textBoxText.Text = File.ReadAllText(fileName);
_videoFileName = fileName.Substring(0, fileName.Length - Path.GetExtension(fileName).Length);
if (_videoFileName.EndsWith(".en"))
_videoFileName = _videoFileName.Remove(_videoFileName.Length - 3);
if (File.Exists(_videoFileName + ".avi"))
{
_videoFileName += ".avi";
}
else if (File.Exists(_videoFileName + ".mkv"))
{
_videoFileName += ".mkv";
}
else
{
string[] files = Directory.GetFiles(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(_videoFileName) + "*.avi");
if (files.Length == 0)
files = Directory.GetFiles(Path.GetDirectoryName(fileName), "*.avi");
if (files.Length == 0)
files = Directory.GetFiles(Path.GetDirectoryName(fileName), "*.mkv");
if (files.Length > 0)
_videoFileName = files[0];
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
GeneratePreview();
}
private void buttonRefresh_Click(object sender, EventArgs e)
{
GeneratePreview();
}
private void radioButtonDurationFixed_CheckedChanged(object sender, EventArgs e)
{
numericUpDownDurationFixed.Enabled = radioButtonDurationFixed.Checked;
GeneratePreview();
}
private void checkBoxMergeShortLines_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void ImportText_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
}
}

123
src/Forms/ImportText.resx Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

3165
src/Forms/Main.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

6400
src/Forms/Main.cs Normal file

File diff suppressed because it is too large Load Diff

1072
src/Forms/Main.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,103 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class MatroskaSubtitleChooser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.labelChoose = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.BackColor = System.Drawing.SystemColors.Control;
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(277, 224);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 46;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = false;
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(196, 224);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 45;
this.buttonOK.Text = "OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(12, 43);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(340, 173);
this.listBox1.TabIndex = 47;
//
// labelChoose
//
this.labelChoose.AutoSize = true;
this.labelChoose.Location = new System.Drawing.Point(9, 20);
this.labelChoose.Name = "labelChoose";
this.labelChoose.Size = new System.Drawing.Size(220, 13);
this.labelChoose.TabIndex = 48;
this.labelChoose.Text = "More than one subtitle found - please choose";
//
// MatroskaSubtitleChooser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(364, 251);
this.Controls.Add(this.labelChoose);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MatroskaSubtitleChooser";
this.Text = "Choose subtitle from Matroska file";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormMatroskaSubtitleChooser_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Label labelChoose;
}
}

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class MatroskaSubtitleChooser : Form
{
public MatroskaSubtitleChooser()
{
InitializeComponent();
Text = Configuration.Settings.Language.MatroskaSubtitleChooser.Title;
labelChoose.Text = Configuration.Settings.Language.MatroskaSubtitleChooser.PleaseChoose;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public int SelectedIndex
{
get
{
return listBox1.SelectedIndex;
}
}
public void Initialize(List<MatroskaSubtitleInfo> subtitleInfoList)
{
foreach (MatroskaSubtitleInfo info in subtitleInfoList)
{
string s = string.Format(Configuration.Settings.Language.MatroskaSubtitleChooser.TrackXLanguageYTypeZ, info.TrackNumber, info.Name, info.Language, info.CodecId);
listBox1.Items.Add(s);
}
listBox1.SelectedIndex = 0;
}
private void FormMatroskaSubtitleChooser_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void ButtonOkClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

244
src/Forms/MergeShortLines.Designer.cs generated Normal file
View File

@ -0,0 +1,244 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
partial class MergeShortLines
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.numericUpDownMaxCharacters = new System.Windows.Forms.NumericUpDown();
this.labelMaxCharacters = new System.Windows.Forms.Label();
this.labelMaxMillisecondsBetweenLines = new System.Windows.Forms.Label();
this.numericUpDownMaxMillisecondsBetweenLines = new System.Windows.Forms.NumericUpDown();
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.SubtitleListview1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxCharacters)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxMillisecondsBetweenLines)).BeginInit();
this.groupBoxLinesFound.SuspendLayout();
this.SuspendLayout();
//
// 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(608, 552);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 6;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// 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(689, 552);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 8;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// numericUpDownMaxCharacters
//
this.numericUpDownMaxCharacters.Location = new System.Drawing.Point(270, 25);
this.numericUpDownMaxCharacters.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numericUpDownMaxCharacters.Minimum = new decimal(new int[] {
10,
0,
0,
0});
this.numericUpDownMaxCharacters.Name = "numericUpDownMaxCharacters";
this.numericUpDownMaxCharacters.Size = new System.Drawing.Size(64, 20);
this.numericUpDownMaxCharacters.TabIndex = 0;
this.numericUpDownMaxCharacters.Value = new decimal(new int[] {
65,
0,
0,
0});
this.numericUpDownMaxCharacters.ValueChanged += new System.EventHandler(this.NumericUpDownMaxCharactersValueChanged);
//
// labelMaxCharacters
//
this.labelMaxCharacters.AutoSize = true;
this.labelMaxCharacters.Location = new System.Drawing.Point(267, 9);
this.labelMaxCharacters.Name = "labelMaxCharacters";
this.labelMaxCharacters.Size = new System.Drawing.Size(187, 13);
this.labelMaxCharacters.TabIndex = 32;
this.labelMaxCharacters.Text = "Maximum characters in one paragraph";
//
// labelMaxMillisecondsBetweenLines
//
this.labelMaxMillisecondsBetweenLines.AutoSize = true;
this.labelMaxMillisecondsBetweenLines.Location = new System.Drawing.Point(483, 9);
this.labelMaxMillisecondsBetweenLines.Name = "labelMaxMillisecondsBetweenLines";
this.labelMaxMillisecondsBetweenLines.Size = new System.Drawing.Size(178, 13);
this.labelMaxMillisecondsBetweenLines.TabIndex = 33;
this.labelMaxMillisecondsBetweenLines.Text = "Maximum milliseconds between lines";
//
// numericUpDownMaxMillisecondsBetweenLines
//
this.numericUpDownMaxMillisecondsBetweenLines.Location = new System.Drawing.Point(486, 25);
this.numericUpDownMaxMillisecondsBetweenLines.Maximum = new decimal(new int[] {
2000,
0,
0,
0});
this.numericUpDownMaxMillisecondsBetweenLines.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownMaxMillisecondsBetweenLines.Name = "numericUpDownMaxMillisecondsBetweenLines";
this.numericUpDownMaxMillisecondsBetweenLines.Size = new System.Drawing.Size(64, 20);
this.numericUpDownMaxMillisecondsBetweenLines.TabIndex = 2;
this.numericUpDownMaxMillisecondsBetweenLines.Value = new decimal(new int[] {
250,
0,
0,
0});
this.numericUpDownMaxMillisecondsBetweenLines.ValueChanged += new System.EventHandler(this.NumericUpDownMaxMillisecondsBetweenLinesValueChanged);
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxLinesFound.Controls.Add(this.listViewFixes);
this.groupBoxLinesFound.Location = new System.Drawing.Point(12, 51);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(752, 200);
this.groupBoxLinesFound.TabIndex = 36;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Lines that will be merged";
//
// listViewFixes
//
this.listViewFixes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader7});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.Location = new System.Drawing.Point(6, 13);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(740, 181);
this.listViewFixes.TabIndex = 0;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
this.listViewFixes.SelectedIndexChanged += new System.EventHandler(this.listViewFixes_SelectedIndexChanged);
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 122;
//
// columnHeader7
//
this.columnHeader7.Text = "New text";
this.columnHeader7.Width = 500;
//
// SubtitleListview1
//
this.SubtitleListview1.AllowDrop = true;
this.SubtitleListview1.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.SubtitleListview1.FirstVisibleIndex = -1;
this.SubtitleListview1.FullRowSelect = true;
this.SubtitleListview1.GridLines = true;
this.SubtitleListview1.HideSelection = false;
this.SubtitleListview1.Location = new System.Drawing.Point(10, 257);
this.SubtitleListview1.Name = "SubtitleListview1";
this.SubtitleListview1.Size = new System.Drawing.Size(757, 289);
this.SubtitleListview1.TabIndex = 4;
this.SubtitleListview1.UseCompatibleStateImageBehavior = false;
this.SubtitleListview1.View = System.Windows.Forms.View.Details;
//
// MergeShortLines
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(776, 585);
this.Controls.Add(this.groupBoxLinesFound);
this.Controls.Add(this.numericUpDownMaxMillisecondsBetweenLines);
this.Controls.Add(this.labelMaxMillisecondsBetweenLines);
this.Controls.Add(this.labelMaxCharacters);
this.Controls.Add(this.numericUpDownMaxCharacters);
this.Controls.Add(this.SubtitleListview1);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(750, 400);
this.Name = "MergeShortLines";
this.ShowIcon = false;
this.Text = "MergeShortLines";
this.Shown += new System.EventHandler(this.MergeShortLines_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MergeShortLines_KeyDown);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxCharacters)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxMillisecondsBetweenLines)).EndInit();
this.groupBoxLinesFound.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private SubtitleListView SubtitleListview1;
private System.Windows.Forms.NumericUpDown numericUpDownMaxCharacters;
private System.Windows.Forms.Label labelMaxCharacters;
private System.Windows.Forms.Label labelMaxMillisecondsBetweenLines;
private System.Windows.Forms.NumericUpDown numericUpDownMaxMillisecondsBetweenLines;
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader7;
}
}

View File

@ -0,0 +1,310 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Text;
namespace Nikse.SubtitleEdit.Forms
{
public partial class MergeShortLines : Form
{
Subtitle _subtitle;
private Subtitle _mergedSubtitle;
public int NumberOfMerges { get; private set; }
public MergeShortLines()
{
InitializeComponent();
}
public Subtitle MergedSubtitle
{
get { return _mergedSubtitle; }
}
private void MergeShortLines_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
public void Initialize(Subtitle subtitle)
{
if (subtitle.Paragraphs.Count > 0)
subtitle.Renumber(subtitle.Paragraphs[0].Number);
Text = Configuration.Settings.Language.MergedShortLines.Title;
labelMaxCharacters.Text = Configuration.Settings.Language.MergedShortLines.MaximumCharacters;
labelMaxMillisecondsBetweenLines.Text = Configuration.Settings.Language.MergedShortLines.MaximumMillisecondsBetween;
listViewFixes.Columns[0].Text = Configuration.Settings.Language.General.Apply;
listViewFixes.Columns[1].Text = Configuration.Settings.Language.MergedShortLines.LineNumber;
listViewFixes.Columns[2].Text = Configuration.Settings.Language.MergedShortLines.MergedText;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
SubtitleListview1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
NumberOfMerges = 0;
numericUpDownMaxCharacters.Value = Configuration.Settings.General.SubtitleLineMaximumLength;
_subtitle = subtitle;
}
private void AddToListView(Paragraph p, string lineNumbers, string newText)
{
var item = new ListViewItem(string.Empty) { Tag = p, Checked = true };
var subItem = new ListViewItem.ListViewSubItem(item, lineNumbers.TrimEnd(','));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
private void GeneratePreview()
{
if (_subtitle == null)
return;
var mergedIndexes = new List<int>();
NumberOfMerges = 0;
SubtitleListview1.Items.Clear();
SubtitleListview1.BeginUpdate();
int count;
_mergedSubtitle = MergeShortLinesInSubtitle(_subtitle, mergedIndexes, out count, (double)numericUpDownMaxMillisecondsBetweenLines.Value, (int)numericUpDownMaxCharacters.Value, true);
NumberOfMerges = count;
SubtitleListview1.Fill(_subtitle);
foreach(var index in mergedIndexes)
{
SubtitleListview1.SetBackgroundColor(index, Color.Green);
}
SubtitleListview1.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.MergedShortLines.NumberOfMergesX, NumberOfMerges);
}
private bool IsFixAllowed(Paragraph p)
{
foreach (ListViewItem item in listViewFixes.Items)
{
string numbers = item.SubItems[1].Text;
foreach (string number in numbers.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
if (number == p.Number.ToString())
return item.Checked;
}
}
return true;
}
public Subtitle MergeShortLinesInSubtitle(Subtitle subtitle, List<int> mergedIndexes, out int numberOfMerges, double maxMillisecondsBetweenLines, int maxCharacters, bool clearFixes)
{
listViewFixes.ItemChecked -= listViewFixes_ItemChecked;
if (clearFixes)
listViewFixes.Items.Clear();
numberOfMerges = 0;
Subtitle mergedSubtitle = new Subtitle();
bool lastMerged = false;
Paragraph p = null;
StringBuilder lineNumbers = new StringBuilder();
for (int i = 1; i < subtitle.Paragraphs.Count; i++)
{
if (!lastMerged)
{
p = new Paragraph(subtitle.GetParagraphOrDefault(i - 1));
mergedSubtitle.Paragraphs.Add(p);
}
Paragraph next = subtitle.GetParagraphOrDefault(i);
if (p != null && next != null)
{
if (QualifiesForMerge(p, next, maxMillisecondsBetweenLines, maxCharacters) && IsFixAllowed(p))
{
if (GetStartTag(p.Text) == GetStartTag(next.Text) &&
GetEndTag(p.Text) == GetEndTag(next.Text))
{
string s1 = p.Text.Trim();
s1 = s1.Substring(0, s1.Length - GetEndTag(s1).Length);
string s2 = next.Text.Trim();
s2 = s2.Substring(GetStartTag(s2).Length);
p.Text = Utilities.AutoBreakLine(s1 + Environment.NewLine + s2);
}
else
{
p.Text = Utilities.AutoBreakLine(p.Text + Environment.NewLine + next.Text);
}
p.EndTime = next.EndTime;
if (lastMerged)
{
lineNumbers.Append(next.Number.ToString() + ",");
}
else
{
lineNumbers.Append(p.Number.ToString() + ",");
lineNumbers.Append(next.Number.ToString() + ",");
}
lastMerged = true;
numberOfMerges++;
if (!mergedIndexes.Contains(i))
mergedIndexes.Add(i);
if (!mergedIndexes.Contains(i-1))
mergedIndexes.Add(i-1);
}
else
{
lastMerged = false;
}
}
else
{
lastMerged = false;
}
if (!lastMerged && lineNumbers.Length > 0 && clearFixes)
{
AddToListView(p, lineNumbers.ToString(), p.Text);
lineNumbers = new StringBuilder();
}
}
listViewFixes.ItemChecked += listViewFixes_ItemChecked;
return mergedSubtitle;
}
private static string GetEndTag(string text)
{
if (string.IsNullOrEmpty(text))
return string.Empty;
text = text.Trim();
if (!text.EndsWith(">"))
return string.Empty;
string endTag = string.Empty;
int start = text.LastIndexOf("</");
if (start > 0 && start >= text.Length - 8)
{
endTag = text.Substring(start);
}
return endTag;
}
private static string GetStartTag(string text)
{
if (string.IsNullOrEmpty(text))
return string.Empty;
text = text.Trim();
if (!text.StartsWith("<"))
return string.Empty;
string startTag = string.Empty;
int end = text.IndexOf(">");
if (end > 0 && end < 25)
{
startTag = text.Substring(0, end + 1);
}
return startTag;
}
private static bool QualifiesForMerge(Paragraph p, Paragraph next, double maximumMillisecondsBetweenLines, int maximumTotalLength)
{
if (p != null && p.Text != null && next != null && next.Text != null)
{
string sNext = Utilities.RemoveHtmlTags(next.Text.Trim());
string s = Utilities.RemoveHtmlTags(p.Text.Trim());
if (p.Text.Length + next.Text.Length < maximumTotalLength && next.StartTime.TotalMilliseconds - p.EndTime.TotalMilliseconds < maximumMillisecondsBetweenLines)
{
if (string.IsNullOrEmpty(s))
return true;
bool isLineContinuation = s.EndsWith(",") || s.EndsWith("-") || s.EndsWith("...") || Utilities.GetLetters(true, true, true).Contains(s.Substring(s.Length - 1));
if (isLineContinuation)
return true;
}
}
return false;
}
private void NumericUpDownMaxCharactersValueChanged(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
GeneratePreview();
Cursor = Cursors.Default;
}
private void NumericUpDownMaxMillisecondsBetweenLinesValueChanged(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
GeneratePreview();
Cursor = Cursors.Default;
}
private void ButtonCancelClick(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void ButtonOkClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void listViewFixes_SelectedIndexChanged(object sender, EventArgs e)
{
if (listViewFixes.SelectedIndices.Count > 0)
{
int index = listViewFixes.SelectedIndices[0];
ListViewItem item = listViewFixes.Items[index];
string[] numbers = item.SubItems[1].Text.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (string number in numbers)
{
foreach (Paragraph p in _subtitle.Paragraphs)
{
if (p.Number.ToString() == number)
{
index = _subtitle.GetIndex(p);
SubtitleListview1.EnsureVisible(index);
}
}
}
}
}
private void listViewFixes_ItemChecked(object sender, ItemCheckedEventArgs e)
{
var mergedIndexes = new List<int>();
NumberOfMerges = 0;
SubtitleListview1.Items.Clear();
SubtitleListview1.BeginUpdate();
int count;
_mergedSubtitle = MergeShortLinesInSubtitle(_subtitle, mergedIndexes, out count, (double)numericUpDownMaxMillisecondsBetweenLines.Value, (int)numericUpDownMaxCharacters.Value, false);
NumberOfMerges = count;
SubtitleListview1.Fill(_subtitle);
foreach (var index in mergedIndexes)
{
SubtitleListview1.SetBackgroundColor(index, Color.Green);
}
SubtitleListview1.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.MergedShortLines.NumberOfMergesX, NumberOfMerges);
}
private void MergeShortLines_Shown(object sender, EventArgs e)
{
GeneratePreview();
listViewFixes.Focus();
if (listViewFixes.Items.Count > 0)
listViewFixes.Items[0].Selected = true;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

349
src/Forms/MultipleReplace.Designer.cs generated Normal file
View File

@ -0,0 +1,349 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class MultipleReplace
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.groupBoxReplaces = new System.Windows.Forms.GroupBox();
this.buttonUpdate = new System.Windows.Forms.Button();
this.buttonAdd = new System.Windows.Forms.Button();
this.labelFindWhat = new System.Windows.Forms.Label();
this.labelReplaceWith = new System.Windows.Forms.Label();
this.textBoxReplace = new System.Windows.Forms.TextBox();
this.radioButtonRegEx = new System.Windows.Forms.RadioButton();
this.radioButtonCaseSensitive = new System.Windows.Forms.RadioButton();
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
this.textBoxFind = new System.Windows.Forms.TextBox();
this.listViewReplaceList = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.groupBoxLinesFound.SuspendLayout();
this.groupBoxReplaces.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.Controls.Add(this.listViewFixes);
this.groupBoxLinesFound.Location = new System.Drawing.Point(8, 292);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(726, 268);
this.groupBoxLinesFound.TabIndex = 8;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Lines found: {0}";
//
// listViewFixes
//
this.listViewFixes.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.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader7,
this.columnHeader8});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.HideSelection = false;
this.listViewFixes.Location = new System.Drawing.Point(6, 13);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(714, 249);
this.listViewFixes.TabIndex = 9;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 61;
//
// columnHeader7
//
this.columnHeader7.Text = "Before";
this.columnHeader7.Width = 292;
//
// columnHeader8
//
this.columnHeader8.Text = "After";
this.columnHeader8.Width = 292;
//
// groupBoxReplaces
//
this.groupBoxReplaces.Controls.Add(this.buttonUpdate);
this.groupBoxReplaces.Controls.Add(this.buttonAdd);
this.groupBoxReplaces.Controls.Add(this.labelFindWhat);
this.groupBoxReplaces.Controls.Add(this.labelReplaceWith);
this.groupBoxReplaces.Controls.Add(this.textBoxReplace);
this.groupBoxReplaces.Controls.Add(this.radioButtonRegEx);
this.groupBoxReplaces.Controls.Add(this.radioButtonCaseSensitive);
this.groupBoxReplaces.Controls.Add(this.radioButtonNormal);
this.groupBoxReplaces.Controls.Add(this.textBoxFind);
this.groupBoxReplaces.Controls.Add(this.listViewReplaceList);
this.groupBoxReplaces.Location = new System.Drawing.Point(8, 8);
this.groupBoxReplaces.Name = "groupBoxReplaces";
this.groupBoxReplaces.Size = new System.Drawing.Size(726, 284);
this.groupBoxReplaces.TabIndex = 0;
this.groupBoxReplaces.TabStop = false;
//
// buttonUpdate
//
this.buttonUpdate.Location = new System.Drawing.Point(588, 42);
this.buttonUpdate.Name = "buttonUpdate";
this.buttonUpdate.Size = new System.Drawing.Size(99, 21);
this.buttonUpdate.TabIndex = 23;
this.buttonUpdate.Text = "&Update";
this.buttonUpdate.UseVisualStyleBackColor = true;
this.buttonUpdate.Click += new System.EventHandler(this.ButtonUpdateClick);
//
// buttonAdd
//
this.buttonAdd.Location = new System.Drawing.Point(483, 42);
this.buttonAdd.Name = "buttonAdd";
this.buttonAdd.Size = new System.Drawing.Size(99, 21);
this.buttonAdd.TabIndex = 3;
this.buttonAdd.Text = "&Add";
this.buttonAdd.UseVisualStyleBackColor = true;
this.buttonAdd.Click += new System.EventHandler(this.ButtonAddClick);
//
// labelFindWhat
//
this.labelFindWhat.AutoSize = true;
this.labelFindWhat.Location = new System.Drawing.Point(17, 26);
this.labelFindWhat.Name = "labelFindWhat";
this.labelFindWhat.Size = new System.Drawing.Size(56, 13);
this.labelFindWhat.TabIndex = 22;
this.labelFindWhat.Text = "Find what:";
//
// labelReplaceWith
//
this.labelReplaceWith.AutoSize = true;
this.labelReplaceWith.Location = new System.Drawing.Point(247, 26);
this.labelReplaceWith.Name = "labelReplaceWith";
this.labelReplaceWith.Size = new System.Drawing.Size(72, 13);
this.labelReplaceWith.TabIndex = 21;
this.labelReplaceWith.Text = "Replace with:";
//
// textBoxReplace
//
this.textBoxReplace.Location = new System.Drawing.Point(250, 42);
this.textBoxReplace.Name = "textBoxReplace";
this.textBoxReplace.Size = new System.Drawing.Size(227, 20);
this.textBoxReplace.TabIndex = 2;
this.textBoxReplace.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxReplaceKeyDown);
//
// radioButtonRegEx
//
this.radioButtonRegEx.AutoSize = true;
this.radioButtonRegEx.Location = new System.Drawing.Point(187, 68);
this.radioButtonRegEx.Name = "radioButtonRegEx";
this.radioButtonRegEx.Size = new System.Drawing.Size(57, 17);
this.radioButtonRegEx.TabIndex = 6;
this.radioButtonRegEx.Text = "RegEx";
this.radioButtonRegEx.UseVisualStyleBackColor = true;
this.radioButtonRegEx.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonCaseSensitive
//
this.radioButtonCaseSensitive.AutoSize = true;
this.radioButtonCaseSensitive.Location = new System.Drawing.Point(86, 68);
this.radioButtonCaseSensitive.Name = "radioButtonCaseSensitive";
this.radioButtonCaseSensitive.Size = new System.Drawing.Size(93, 17);
this.radioButtonCaseSensitive.TabIndex = 5;
this.radioButtonCaseSensitive.Text = "Case sensitive";
this.radioButtonCaseSensitive.UseVisualStyleBackColor = true;
this.radioButtonCaseSensitive.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonNormal
//
this.radioButtonNormal.AutoSize = true;
this.radioButtonNormal.Checked = true;
this.radioButtonNormal.Location = new System.Drawing.Point(22, 68);
this.radioButtonNormal.Name = "radioButtonNormal";
this.radioButtonNormal.Size = new System.Drawing.Size(58, 17);
this.radioButtonNormal.TabIndex = 4;
this.radioButtonNormal.TabStop = true;
this.radioButtonNormal.Text = "Normal";
this.radioButtonNormal.UseVisualStyleBackColor = true;
this.radioButtonNormal.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// textBoxFind
//
this.textBoxFind.Location = new System.Drawing.Point(20, 42);
this.textBoxFind.Name = "textBoxFind";
this.textBoxFind.Size = new System.Drawing.Size(224, 20);
this.textBoxFind.TabIndex = 1;
//
// listViewReplaceList
//
this.listViewReplaceList.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.listViewReplaceList.CheckBoxes = true;
this.listViewReplaceList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader6});
this.listViewReplaceList.ContextMenuStrip = this.contextMenuStrip1;
this.listViewReplaceList.FullRowSelect = true;
this.listViewReplaceList.HideSelection = false;
this.listViewReplaceList.Location = new System.Drawing.Point(6, 115);
this.listViewReplaceList.Name = "listViewReplaceList";
this.listViewReplaceList.Size = new System.Drawing.Size(714, 163);
this.listViewReplaceList.TabIndex = 7;
this.listViewReplaceList.UseCompatibleStateImageBehavior = false;
this.listViewReplaceList.View = System.Windows.Forms.View.Details;
this.listViewReplaceList.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.ListViewReplaceListItemChecked);
this.listViewReplaceList.SelectedIndexChanged += new System.EventHandler(this.ListViewReplaceListSelectedIndexChanged);
this.listViewReplaceList.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListViewReplaceListKeyDown);
//
// columnHeader1
//
this.columnHeader1.Text = "Enabled";
this.columnHeader1.Width = 70;
//
// columnHeader2
//
this.columnHeader2.Text = "Find what";
this.columnHeader2.Width = 210;
//
// columnHeader3
//
this.columnHeader3.Text = "Replace with";
this.columnHeader3.Width = 210;
//
// columnHeader6
//
this.columnHeader6.Text = "Search type";
this.columnHeader6.Width = 200;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.deleteToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(117, 26);
//
// deleteToolStripMenuItem
//
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.deleteToolStripMenuItem.Text = "Delete";
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.DeleteToolStripMenuItemClick);
//
// buttonOK
//
this.buttonOK.Location = new System.Drawing.Point(576, 569);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 10;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(657, 569);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 11;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// MultipleReplace
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(743, 597);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.groupBoxReplaces);
this.Controls.Add(this.groupBoxLinesFound);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MultipleReplace";
this.ShowIcon = false;
this.Text = "Multiple replace";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MultipleReplace_KeyDown);
this.groupBoxLinesFound.ResumeLayout(false);
this.groupBoxReplaces.ResumeLayout(false);
this.groupBoxReplaces.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
private System.Windows.Forms.GroupBox groupBoxReplaces;
private System.Windows.Forms.ListView listViewReplaceList;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader6;
private System.Windows.Forms.Label labelFindWhat;
private System.Windows.Forms.Label labelReplaceWith;
private System.Windows.Forms.TextBox textBoxReplace;
private System.Windows.Forms.RadioButton radioButtonRegEx;
private System.Windows.Forms.RadioButton radioButtonCaseSensitive;
private System.Windows.Forms.RadioButton radioButtonNormal;
private System.Windows.Forms.TextBox textBoxFind;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonAdd;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
private System.Windows.Forms.Button buttonUpdate;
}
}

View File

@ -0,0 +1,317 @@
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class MultipleReplace : Form
{
public const string SearchTypeNormal = "Normal";
public const string SearchTypeCaseSensitive = "CaseSensitive";
public const string SearchTypeRegularExpression = "RegularExpression";
Subtitle _subtitle;
public Subtitle FixedSubtitle { get; private set; }
public int FixCount { get; private set; }
public MultipleReplace()
{
InitializeComponent();
textBoxReplace.ContextMenu = FindReplaceDialogHelper.GetReplaceTextContextMenu(textBoxReplace);
buttonUpdate.Enabled = false;
Text = Configuration.Settings.Language.MultipleReplace.Title;
labelFindWhat.Text = Configuration.Settings.Language.MultipleReplace.FindWhat;
labelReplaceWith.Text = Configuration.Settings.Language.MultipleReplace.ReplaceWith;
radioButtonNormal.Text = Configuration.Settings.Language.MultipleReplace.Normal;
radioButtonRegEx.Text = Configuration.Settings.Language.MultipleReplace.RegularExpression;
radioButtonCaseSensitive.Text = Configuration.Settings.Language.MultipleReplace.CaseSensitive;
buttonAdd.Text = Configuration.Settings.Language.MultipleReplace.Add;
buttonUpdate.Text = Configuration.Settings.Language.MultipleReplace.Update;
listViewReplaceList.Columns[0].Text = Configuration.Settings.Language.MultipleReplace.Enabled;
listViewReplaceList.Columns[1].Text = Configuration.Settings.Language.MultipleReplace.FindWhat;
listViewReplaceList.Columns[2].Text = Configuration.Settings.Language.MultipleReplace.ReplaceWith;
listViewReplaceList.Columns[3].Text = Configuration.Settings.Language.MultipleReplace.SearchType;
groupBoxLinesFound.Text = string.Empty;
listViewFixes.Columns[0].Text = Configuration.Settings.Language.General.Apply;
listViewFixes.Columns[1].Text = Configuration.Settings.Language.MultipleReplace.LineNumber;
listViewFixes.Columns[2].Text = Configuration.Settings.Language.MultipleReplace.Before;
listViewFixes.Columns[3].Text = Configuration.Settings.Language.MultipleReplace.After;
deleteToolStripMenuItem.Text = Configuration.Settings.Language.MultipleReplace.Delete;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public void Initialize(Subtitle subtitle)
{
_subtitle = subtitle;
foreach (var item in Configuration.Settings.MultipleSearchAndReplaceList)
{
AddToReplaceListView(item.Enabled, item.FindWhat, item.ReplaceWith, EnglishSearchTypeToLocal(item.SearchType));
}
GeneratePreview();
}
private void MultipleReplace_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void RadioButtonCheckedChanged(object sender, EventArgs e)
{
if (sender == radioButtonRegEx)
textBoxFind.ContextMenu = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
else
textBoxFind.ContextMenuStrip = null;
}
private void ButtonAddClick(object sender, EventArgs e)
{
if (textBoxFind.Text.Length > 0)
{
string searchType = SearchTypeNormal;
if (radioButtonCaseSensitive.Checked)
searchType = SearchTypeCaseSensitive;
else if (radioButtonRegEx.Checked)
{
searchType = SearchTypeRegularExpression;
if (!Utilities.IsValidRegex(textBoxFind.Text))
{
MessageBox.Show(Configuration.Settings.Language.General.RegularExpressionIsNotValid);
textBoxFind.Select();
return;
}
}
AddToReplaceListView(true, textBoxFind.Text, textBoxReplace.Text, EnglishSearchTypeToLocal(searchType));
GeneratePreview();
textBoxFind.Text = string.Empty;
textBoxReplace.Text = string.Empty;
textBoxFind.Select();
SaveReplaceList();
}
}
private void GeneratePreview()
{
Cursor = Cursors.WaitCursor;
FixedSubtitle = new Subtitle(_subtitle);
listViewFixes.BeginUpdate();
listViewFixes.Items.Clear();
FixCount = 0;
foreach (Paragraph p in _subtitle.Paragraphs)
{
bool hit = false;
string newText = p.Text;
foreach (ListViewItem item in listViewReplaceList.Items)
{
if (item.Checked && item.SubItems[1].Text.Length > 0)
{
string findWhat = item.SubItems[1].Text;
string replaceWith = item.SubItems[2].Text.Replace(@"\n", Environment.NewLine);
string searchType = item.SubItems[3].Text;
if (searchType == Configuration.Settings.Language.MultipleReplace.CaseSensitive)
{
if (newText.Contains(findWhat))
{
hit = true;
newText = newText.Replace(findWhat, replaceWith);
}
}
else if (searchType == Configuration.Settings.Language.MultipleReplace.RegularExpression)
{
Regex regex = new Regex(findWhat);
if (regex.IsMatch(newText))
{
hit = true;
newText = regex.Replace(newText, replaceWith);
}
}
else
{
int index = newText.ToLower().IndexOf(findWhat.ToLower());
while (index >= 0)
{
if (index < newText.Length)
newText = newText.Substring(0, index) + replaceWith + newText.Substring(index + findWhat.Length);
else
newText = newText.Substring(0, index) + replaceWith;
hit = true;
index = newText.ToLower().IndexOf(findWhat.ToLower(), index+replaceWith.Length);
}
}
}
}
if (hit)
{
FixCount++;
AddToPreviewListView(p, newText);
FixedSubtitle.Paragraphs[_subtitle.GetIndex(p)].Text = newText;
hit = false;
}
}
listViewFixes.EndUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.MultipleReplace.LinesFoundX, FixCount);
Cursor = Cursors.Default;
}
private void AddToReplaceListView(bool enabled, string findWhat, string replaceWith, string searchType)
{
var item = new ListViewItem("");
item.Checked = enabled;
var subItem = new ListViewItem.ListViewSubItem(item, findWhat);
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, replaceWith);
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, searchType);
item.SubItems.Add(subItem);
listViewReplaceList.Items.Add(item);
}
private void AddToPreviewListView(Paragraph p, string newText)
{
var item = new ListViewItem("");
item.Tag = p;
item.Checked = true;
var subItem = new ListViewItem.ListViewSubItem(item, p.Number.ToString());
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, p.Text);
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText);
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
private static string LocalSearchTypeToEnglish(string searchType)
{
if (searchType == Configuration.Settings.Language.MultipleReplace.RegularExpression)
return SearchTypeRegularExpression;
if (searchType == Configuration.Settings.Language.MultipleReplace.CaseSensitive)
return SearchTypeCaseSensitive;
return SearchTypeNormal;
}
private static string EnglishSearchTypeToLocal(string searchType)
{
if (searchType == SearchTypeRegularExpression)
return Configuration.Settings.Language.MultipleReplace.RegularExpression;
if (searchType == SearchTypeCaseSensitive)
return Configuration.Settings.Language.MultipleReplace.CaseSensitive;
return Configuration.Settings.Language.MultipleReplace.Normal;
}
private void ButtonOkClick(object sender, EventArgs e)
{
ResetUncheckLines();
SaveReplaceList();
DialogResult = DialogResult.OK;
}
private void SaveReplaceList()
{
Configuration.Settings.MultipleSearchAndReplaceList = new List<MultipleSearchAndReplaceSetting>();
foreach (ListViewItem item in listViewReplaceList.Items)
{
Configuration.Settings.MultipleSearchAndReplaceList.Add(new MultipleSearchAndReplaceSetting
{
Enabled = item.Checked,
FindWhat = item.SubItems[1].Text,
ReplaceWith = item.SubItems[2].Text,
SearchType = LocalSearchTypeToEnglish(item.SubItems[3].Text)
});
}
Configuration.Settings.Save();
}
private void ResetUncheckLines()
{
foreach (ListViewItem item in listViewFixes.Items)
{
if (!item.Checked)
{
int index = _subtitle.GetIndex(item.Tag as Paragraph);
FixedSubtitle.Paragraphs[index].Text = _subtitle.Paragraphs[index].Text;
}
}
}
private void ListViewReplaceListItemChecked(object sender, ItemCheckedEventArgs e)
{
GeneratePreview();
}
private void DeleteToolStripMenuItemClick(object sender, EventArgs e)
{
for (int i = listViewReplaceList.Items.Count - 1; i >= 0; i--)
{
ListViewItem item = listViewReplaceList.Items[i];
if (item.Selected)
item.Remove();
}
GeneratePreview();
SaveReplaceList();
}
private void ListViewReplaceListKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
DeleteToolStripMenuItemClick(null, null);
}
private void ButtonUpdateClick(object sender, EventArgs e)
{
if (textBoxFind.Text.Length > 0)
{
if (radioButtonRegEx.Checked && !Utilities.IsValidRegex(textBoxFind.Text))
{
MessageBox.Show(Configuration.Settings.Language.General.RegularExpressionIsNotValid);
textBoxFind.Select();
return;
}
DeleteToolStripMenuItemClick(null, null);
ButtonAddClick(null, null);
}
}
private void ListViewReplaceListSelectedIndexChanged(object sender, EventArgs e)
{
if (listViewReplaceList.SelectedItems.Count == 1)
{
buttonUpdate.Enabled = true;
textBoxFind.Text = listViewReplaceList.SelectedItems[0].SubItems[1].Text;
textBoxReplace.Text = listViewReplaceList.SelectedItems[0].SubItems[2].Text;
string searchType = LocalSearchTypeToEnglish(listViewReplaceList.SelectedItems[0].SubItems[3].Text);
if (searchType == SearchTypeRegularExpression)
radioButtonRegEx.Checked = true;
else if (searchType == SearchTypeCaseSensitive)
radioButtonCaseSensitive.Checked = true;
else
radioButtonNormal.Checked = true;
}
else
{
buttonUpdate.Enabled = false;
}
}
private void TextBoxReplaceKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter && textBoxFind.Text.Length > 0 && textBoxReplace.Text.Length > 0)
ButtonAddClick(null, null);
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

380
src/Forms/OCRSpellCheck.Designer.cs generated Normal file
View File

@ -0,0 +1,380 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class OcrSpellCheck
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonAbort = new System.Windows.Forms.Button();
this.labelWordNotFound = new System.Windows.Forms.Label();
this.groupBoxSuggestions = new System.Windows.Forms.GroupBox();
this.buttonUseSuggestionAlways = new System.Windows.Forms.Button();
this.buttonUseSuggestion = new System.Windows.Forms.Button();
this.listBoxSuggestions = new System.Windows.Forms.ListBox();
this.GroupBoxEditWord = new System.Windows.Forms.GroupBox();
this.buttonAddToDictionary = new System.Windows.Forms.Button();
this.buttonChangeAll = new System.Windows.Forms.Button();
this.buttonChange = new System.Windows.Forms.Button();
this.buttonSkipAll = new System.Windows.Forms.Button();
this.textBoxWord = new System.Windows.Forms.TextBox();
this.buttonSkipOnce = new System.Windows.Forms.Button();
this.buttonAddToNames = new System.Windows.Forms.Button();
this.groupBoxEditWholeText = new System.Windows.Forms.GroupBox();
this.buttonSkipText = new System.Windows.Forms.Button();
this.buttonChangeWholeText = new System.Windows.Forms.Button();
this.textBoxWholeText = new System.Windows.Forms.TextBox();
this.groupBoxTextAsImage = new System.Windows.Forms.GroupBox();
this.pictureBoxText = new System.Windows.Forms.PictureBox();
this.groupBoxText = new System.Windows.Forms.GroupBox();
this.richTextBoxParagraph = new System.Windows.Forms.RichTextBox();
this.buttonEditWholeText = new System.Windows.Forms.Button();
this.buttonEditWord = new System.Windows.Forms.Button();
this.groupBoxSuggestions.SuspendLayout();
this.GroupBoxEditWord.SuspendLayout();
this.groupBoxEditWholeText.SuspendLayout();
this.groupBoxTextAsImage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxText)).BeginInit();
this.groupBoxText.SuspendLayout();
this.SuspendLayout();
//
// buttonAbort
//
this.buttonAbort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAbort.Location = new System.Drawing.Point(512, 404);
this.buttonAbort.Name = "buttonAbort";
this.buttonAbort.Size = new System.Drawing.Size(85, 21);
this.buttonAbort.TabIndex = 24;
this.buttonAbort.Text = "Abort";
this.buttonAbort.UseVisualStyleBackColor = true;
this.buttonAbort.Click += new System.EventHandler(this.ButtonAbortClick);
//
// labelWordNotFound
//
this.labelWordNotFound.AutoSize = true;
this.labelWordNotFound.Location = new System.Drawing.Point(9, 112);
this.labelWordNotFound.Name = "labelWordNotFound";
this.labelWordNotFound.Size = new System.Drawing.Size(0, 13);
this.labelWordNotFound.TabIndex = 23;
//
// groupBoxSuggestions
//
this.groupBoxSuggestions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxSuggestions.Controls.Add(this.buttonUseSuggestionAlways);
this.groupBoxSuggestions.Controls.Add(this.buttonUseSuggestion);
this.groupBoxSuggestions.Controls.Add(this.listBoxSuggestions);
this.groupBoxSuggestions.Location = new System.Drawing.Point(320, 211);
this.groupBoxSuggestions.Name = "groupBoxSuggestions";
this.groupBoxSuggestions.Size = new System.Drawing.Size(277, 187);
this.groupBoxSuggestions.TabIndex = 32;
this.groupBoxSuggestions.TabStop = false;
this.groupBoxSuggestions.Text = "Suggestions";
//
// buttonUseSuggestionAlways
//
this.buttonUseSuggestionAlways.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonUseSuggestionAlways.Location = new System.Drawing.Point(180, 16);
this.buttonUseSuggestionAlways.Name = "buttonUseSuggestionAlways";
this.buttonUseSuggestionAlways.Size = new System.Drawing.Size(87, 21);
this.buttonUseSuggestionAlways.TabIndex = 33;
this.buttonUseSuggestionAlways.Text = "Use always";
this.buttonUseSuggestionAlways.UseVisualStyleBackColor = true;
this.buttonUseSuggestionAlways.Click += new System.EventHandler(this.ButtonUseSuggestionAlwaysClick);
//
// buttonUseSuggestion
//
this.buttonUseSuggestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonUseSuggestion.Location = new System.Drawing.Point(95, 16);
this.buttonUseSuggestion.Name = "buttonUseSuggestion";
this.buttonUseSuggestion.Size = new System.Drawing.Size(79, 21);
this.buttonUseSuggestion.TabIndex = 32;
this.buttonUseSuggestion.Text = "Use";
this.buttonUseSuggestion.UseVisualStyleBackColor = true;
this.buttonUseSuggestion.Click += new System.EventHandler(this.ButtonUseSuggestionClick);
//
// listBoxSuggestions
//
this.listBoxSuggestions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listBoxSuggestions.FormattingEnabled = true;
this.listBoxSuggestions.Location = new System.Drawing.Point(6, 39);
this.listBoxSuggestions.Name = "listBoxSuggestions";
this.listBoxSuggestions.Size = new System.Drawing.Size(261, 134);
this.listBoxSuggestions.TabIndex = 30;
//
// GroupBoxEditWord
//
this.GroupBoxEditWord.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.GroupBoxEditWord.Controls.Add(this.buttonAddToDictionary);
this.GroupBoxEditWord.Controls.Add(this.buttonChangeAll);
this.GroupBoxEditWord.Controls.Add(this.buttonChange);
this.GroupBoxEditWord.Controls.Add(this.buttonSkipAll);
this.GroupBoxEditWord.Controls.Add(this.textBoxWord);
this.GroupBoxEditWord.Controls.Add(this.buttonSkipOnce);
this.GroupBoxEditWord.Controls.Add(this.buttonAddToNames);
this.GroupBoxEditWord.Location = new System.Drawing.Point(12, 211);
this.GroupBoxEditWord.Name = "GroupBoxEditWord";
this.GroupBoxEditWord.Size = new System.Drawing.Size(302, 187);
this.GroupBoxEditWord.TabIndex = 33;
this.GroupBoxEditWord.TabStop = false;
this.GroupBoxEditWord.Text = "Word not found";
//
// buttonAddToDictionary
//
this.buttonAddToDictionary.Location = new System.Drawing.Point(6, 151);
this.buttonAddToDictionary.Name = "buttonAddToDictionary";
this.buttonAddToDictionary.Size = new System.Drawing.Size(290, 21);
this.buttonAddToDictionary.TabIndex = 35;
this.buttonAddToDictionary.Text = "Add to user dictionary (not case sensitive)";
this.buttonAddToDictionary.UseVisualStyleBackColor = true;
this.buttonAddToDictionary.Click += new System.EventHandler(this.ButtonAddToDictionaryClick);
//
// buttonChangeAll
//
this.buttonChangeAll.Location = new System.Drawing.Point(6, 45);
this.buttonChangeAll.Name = "buttonChangeAll";
this.buttonChangeAll.Size = new System.Drawing.Size(290, 21);
this.buttonChangeAll.TabIndex = 34;
this.buttonChangeAll.Text = "Change and add to ocr fix list (case sensitive)";
this.buttonChangeAll.UseVisualStyleBackColor = true;
this.buttonChangeAll.Click += new System.EventHandler(this.ButtonChangeAllClick);
//
// buttonChange
//
this.buttonChange.Location = new System.Drawing.Point(6, 72);
this.buttonChange.Name = "buttonChange";
this.buttonChange.Size = new System.Drawing.Size(141, 21);
this.buttonChange.TabIndex = 33;
this.buttonChange.Text = "Change once";
this.buttonChange.UseVisualStyleBackColor = true;
this.buttonChange.Click += new System.EventHandler(this.ButtonChangeClick);
//
// buttonSkipAll
//
this.buttonSkipAll.Location = new System.Drawing.Point(155, 97);
this.buttonSkipAll.Name = "buttonSkipAll";
this.buttonSkipAll.Size = new System.Drawing.Size(141, 21);
this.buttonSkipAll.TabIndex = 32;
this.buttonSkipAll.Text = "&Skip all";
this.buttonSkipAll.UseVisualStyleBackColor = true;
this.buttonSkipAll.Click += new System.EventHandler(this.ButtonSkipAllClick);
//
// textBoxWord
//
this.textBoxWord.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxWord.Location = new System.Drawing.Point(6, 19);
this.textBoxWord.Name = "textBoxWord";
this.textBoxWord.Size = new System.Drawing.Size(290, 21);
this.textBoxWord.TabIndex = 31;
this.textBoxWord.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxWordKeyDown);
//
// buttonSkipOnce
//
this.buttonSkipOnce.Location = new System.Drawing.Point(155, 72);
this.buttonSkipOnce.Name = "buttonSkipOnce";
this.buttonSkipOnce.Size = new System.Drawing.Size(141, 21);
this.buttonSkipOnce.TabIndex = 30;
this.buttonSkipOnce.Text = "Skip &once";
this.buttonSkipOnce.UseVisualStyleBackColor = true;
this.buttonSkipOnce.Click += new System.EventHandler(this.ButtonSkipOnceClick);
//
// buttonAddToNames
//
this.buttonAddToNames.Location = new System.Drawing.Point(6, 124);
this.buttonAddToNames.Name = "buttonAddToNames";
this.buttonAddToNames.Size = new System.Drawing.Size(290, 21);
this.buttonAddToNames.TabIndex = 29;
this.buttonAddToNames.Text = "Add to names/noise list (case sensitive)";
this.buttonAddToNames.UseVisualStyleBackColor = true;
this.buttonAddToNames.Click += new System.EventHandler(this.ButtonAddToNamesClick);
//
// groupBoxEditWholeText
//
this.groupBoxEditWholeText.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBoxEditWholeText.Controls.Add(this.buttonSkipText);
this.groupBoxEditWholeText.Controls.Add(this.buttonChangeWholeText);
this.groupBoxEditWholeText.Controls.Add(this.textBoxWholeText);
this.groupBoxEditWholeText.Location = new System.Drawing.Point(12, 210);
this.groupBoxEditWholeText.Name = "groupBoxEditWholeText";
this.groupBoxEditWholeText.Size = new System.Drawing.Size(302, 188);
this.groupBoxEditWholeText.TabIndex = 37;
this.groupBoxEditWholeText.TabStop = false;
this.groupBoxEditWholeText.Text = "Edit whole text";
//
// buttonSkipText
//
this.buttonSkipText.Location = new System.Drawing.Point(156, 88);
this.buttonSkipText.Name = "buttonSkipText";
this.buttonSkipText.Size = new System.Drawing.Size(139, 21);
this.buttonSkipText.TabIndex = 35;
this.buttonSkipText.Text = "Skip text";
this.buttonSkipText.UseVisualStyleBackColor = true;
this.buttonSkipText.Click += new System.EventHandler(this.ButtonSkipTextClick);
//
// buttonChangeWholeText
//
this.buttonChangeWholeText.Location = new System.Drawing.Point(6, 88);
this.buttonChangeWholeText.Name = "buttonChangeWholeText";
this.buttonChangeWholeText.Size = new System.Drawing.Size(143, 21);
this.buttonChangeWholeText.TabIndex = 34;
this.buttonChangeWholeText.Text = "Change";
this.buttonChangeWholeText.UseVisualStyleBackColor = true;
this.buttonChangeWholeText.Click += new System.EventHandler(this.ButtonChangeWholeTextClick);
//
// textBoxWholeText
//
this.textBoxWholeText.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBoxWholeText.Location = new System.Drawing.Point(6, 19);
this.textBoxWholeText.Multiline = true;
this.textBoxWholeText.Name = "textBoxWholeText";
this.textBoxWholeText.Size = new System.Drawing.Size(290, 63);
this.textBoxWholeText.TabIndex = 31;
//
// groupBoxTextAsImage
//
this.groupBoxTextAsImage.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.groupBoxTextAsImage.Controls.Add(this.pictureBoxText);
this.groupBoxTextAsImage.Location = new System.Drawing.Point(12, 12);
this.groupBoxTextAsImage.Name = "groupBoxTextAsImage";
this.groupBoxTextAsImage.Size = new System.Drawing.Size(585, 114);
this.groupBoxTextAsImage.TabIndex = 34;
this.groupBoxTextAsImage.TabStop = false;
this.groupBoxTextAsImage.Text = "Image text";
//
// pictureBoxText
//
this.pictureBoxText.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.pictureBoxText.Location = new System.Drawing.Point(6, 18);
this.pictureBoxText.Name = "pictureBoxText";
this.pictureBoxText.Size = new System.Drawing.Size(573, 89);
this.pictureBoxText.TabIndex = 32;
this.pictureBoxText.TabStop = false;
//
// groupBoxText
//
this.groupBoxText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxText.Controls.Add(this.richTextBoxParagraph);
this.groupBoxText.Controls.Add(this.buttonEditWholeText);
this.groupBoxText.Controls.Add(this.buttonEditWord);
this.groupBoxText.Location = new System.Drawing.Point(12, 132);
this.groupBoxText.Name = "groupBoxText";
this.groupBoxText.Size = new System.Drawing.Size(585, 72);
this.groupBoxText.TabIndex = 38;
this.groupBoxText.TabStop = false;
this.groupBoxText.Text = "Text";
//
// richTextBoxParagraph
//
this.richTextBoxParagraph.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.richTextBoxParagraph.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.richTextBoxParagraph.Location = new System.Drawing.Point(6, 12);
this.richTextBoxParagraph.Name = "richTextBoxParagraph";
this.richTextBoxParagraph.ReadOnly = true;
this.richTextBoxParagraph.Size = new System.Drawing.Size(296, 54);
this.richTextBoxParagraph.TabIndex = 39;
this.richTextBoxParagraph.Text = "";
//
// buttonEditWholeText
//
this.buttonEditWholeText.Location = new System.Drawing.Point(308, 17);
this.buttonEditWholeText.Name = "buttonEditWholeText";
this.buttonEditWholeText.Size = new System.Drawing.Size(128, 21);
this.buttonEditWholeText.TabIndex = 38;
this.buttonEditWholeText.Text = "Edit whole text";
this.buttonEditWholeText.UseVisualStyleBackColor = true;
this.buttonEditWholeText.Click += new System.EventHandler(this.ButtonEditWholeTextClick);
//
// buttonEditWord
//
this.buttonEditWord.Location = new System.Drawing.Point(308, 43);
this.buttonEditWord.Name = "buttonEditWord";
this.buttonEditWord.Size = new System.Drawing.Size(128, 21);
this.buttonEditWord.TabIndex = 37;
this.buttonEditWord.Text = "Edit word";
this.buttonEditWord.UseVisualStyleBackColor = true;
this.buttonEditWord.Click += new System.EventHandler(this.ButtonEditWordClick);
//
// OcrSpellCheck
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(609, 435);
this.Controls.Add(this.groupBoxText);
this.Controls.Add(this.groupBoxTextAsImage);
this.Controls.Add(this.buttonAbort);
this.Controls.Add(this.labelWordNotFound);
this.Controls.Add(this.groupBoxSuggestions);
this.Controls.Add(this.GroupBoxEditWord);
this.Controls.Add(this.groupBoxEditWholeText);
this.Name = "OcrSpellCheck";
this.ShowIcon = false;
this.Text = "OCR spellcheck";
this.groupBoxSuggestions.ResumeLayout(false);
this.GroupBoxEditWord.ResumeLayout(false);
this.GroupBoxEditWord.PerformLayout();
this.groupBoxEditWholeText.ResumeLayout(false);
this.groupBoxEditWholeText.PerformLayout();
this.groupBoxTextAsImage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBoxText)).EndInit();
this.groupBoxText.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonAbort;
private System.Windows.Forms.Label labelWordNotFound;
private System.Windows.Forms.GroupBox groupBoxSuggestions;
private System.Windows.Forms.Button buttonUseSuggestionAlways;
private System.Windows.Forms.Button buttonUseSuggestion;
private System.Windows.Forms.ListBox listBoxSuggestions;
private System.Windows.Forms.GroupBox GroupBoxEditWord;
private System.Windows.Forms.Button buttonChangeAll;
private System.Windows.Forms.Button buttonChange;
private System.Windows.Forms.Button buttonSkipAll;
private System.Windows.Forms.TextBox textBoxWord;
private System.Windows.Forms.Button buttonSkipOnce;
private System.Windows.Forms.Button buttonAddToNames;
private System.Windows.Forms.GroupBox groupBoxTextAsImage;
private System.Windows.Forms.PictureBox pictureBoxText;
private System.Windows.Forms.GroupBox groupBoxEditWholeText;
private System.Windows.Forms.Button buttonChangeWholeText;
private System.Windows.Forms.TextBox textBoxWholeText;
private System.Windows.Forms.GroupBox groupBoxText;
private System.Windows.Forms.Button buttonEditWord;
private System.Windows.Forms.Button buttonEditWholeText;
private System.Windows.Forms.RichTextBox richTextBoxParagraph;
private System.Windows.Forms.Button buttonAddToDictionary;
private System.Windows.Forms.Button buttonSkipText;
}
}

229
src/Forms/OCRSpellCheck.cs Normal file
View File

@ -0,0 +1,229 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class OcrSpellCheck : Form
{
public enum Action
{
Abort,
AddToUserDictionary,
AddToNames,
AllwaysUseSuggestion,
ChangeAndSave,
ChangeOnce,
ChangeWholeText,
SkipAll,
SkipWholeText,
SkipOnce,
UseSuggestion,
}
public Action ActionResult { get; private set; }
public string Word { get; private set; }
public string Paragraph { get; private set; }
private string _originalWord;
public OcrSpellCheck()
{
InitializeComponent();
Text = Configuration.Settings.Language.SpellCheck.Title;
buttonAddToDictionary.Text = Configuration.Settings.Language.SpellCheck.AddToUserDictionary;
buttonChange.Text = Configuration.Settings.Language.SpellCheck.Change;
buttonChangeAll.Text = Configuration.Settings.Language.SpellCheck.ChangeAll;
buttonSkipAll.Text = Configuration.Settings.Language.SpellCheck.SkipAll;
buttonSkipOnce.Text = Configuration.Settings.Language.SpellCheck.SkipOnce;
buttonUseSuggestion.Text = Configuration.Settings.Language.SpellCheck.Use;
buttonUseSuggestionAlways.Text = Configuration.Settings.Language.SpellCheck.UseAlways;
buttonAbort.Text = Configuration.Settings.Language.SpellCheck.Abort;
groupBoxEditWholeText.Text = Configuration.Settings.Language.SpellCheck.EditWholeText;
buttonChangeWholeText.Text = Configuration.Settings.Language.SpellCheck.Change;
buttonSkipText.Text = Configuration.Settings.Language.SpellCheck.SkipOnce;
buttonEditWholeText.Text = Configuration.Settings.Language.SpellCheck.EditWholeText;
buttonEditWord.Text = Configuration.Settings.Language.SpellCheck.EditWordOnly;
groupBoxText.Text = Configuration.Settings.Language.General.Text;
GroupBoxEditWord.Text = Configuration.Settings.Language.SpellCheck.WordNotFound;
groupBoxSuggestions.Text = Configuration.Settings.Language.SpellCheck.Suggestions;
groupBoxTextAsImage.Text = Configuration.Settings.Language.SpellCheck.ImageText;
buttonAddToNames.Text = Configuration.Settings.Language.SpellCheck.AddToNamesAndIgnoreList;
}
private void ButtonAbortClick(object sender, EventArgs e)
{
ActionResult = Action.Abort;
DialogResult = DialogResult.Abort;
}
internal void Initialize(string word, List<string> suggestions, string line, string[] words, int i, Bitmap bitmap)
{
_originalWord = word;
pictureBoxText.Image = bitmap;
textBoxWord.Text = word;
richTextBoxParagraph.Text = line;
textBoxWholeText.Text = line;
listBoxSuggestions.Items.Clear();
foreach (string suggestion in suggestions)
listBoxSuggestions.Items.Add(suggestion);
if (listBoxSuggestions.Items.Count > 0)
listBoxSuggestions.SelectedIndex = 0;
HighLightWord(richTextBoxParagraph, word);
ButtonEditWordClick(null, null);
}
private static void HighLightWord(RichTextBox richTextBoxParagraph, string word)
{
Regex regex = Utilities.MakeWordSearchRegex(word);
Match match = regex.Match(richTextBoxParagraph.Text);
if (!match.Success)
{
regex = Utilities.MakeWordSearchRegexWithNumbers(word);
match = regex.Match(richTextBoxParagraph.Text);
}
while (match.Success)
{
richTextBoxParagraph.SelectionStart = match.Index+1;
richTextBoxParagraph.SelectionLength = match.Length;
while (richTextBoxParagraph.SelectedText != match.Value && richTextBoxParagraph.SelectionStart > 0)
{
richTextBoxParagraph.SelectionStart = richTextBoxParagraph.SelectionStart - 1;
richTextBoxParagraph.SelectionLength = match.Length;
}
richTextBoxParagraph.SelectionColor = Color.Red;
match = match.NextMatch();
}
richTextBoxParagraph.SelectionLength = 0;
richTextBoxParagraph.SelectionStart = 0;
}
private void ButtonEditWholeTextClick(object sender, EventArgs e)
{
groupBoxEditWholeText.BringToFront();
groupBoxEditWholeText.Enabled = true;
GroupBoxEditWord.SendToBack();
GroupBoxEditWord.Enabled = false;
buttonEditWord.Enabled = true;
buttonEditWholeText.Enabled = false;
textBoxWholeText.Focus();
}
private void ButtonEditWordClick(object sender, EventArgs e)
{
groupBoxEditWholeText.SendToBack();
groupBoxEditWholeText.Enabled = false;
GroupBoxEditWord.BringToFront();
GroupBoxEditWord.Enabled = true;
buttonEditWord.Enabled = false;
buttonEditWholeText.Enabled = true;
textBoxWord.Focus();
}
private void ButtonChangeAllClick(object sender, EventArgs e)
{
if (_originalWord == textBoxWord.Text.Trim())
{
MessageBox.Show("Word was not changed!");
return;
}
Word = textBoxWord.Text;
ActionResult = Action.ChangeAndSave;
DialogResult = DialogResult.OK;
}
private void ButtonChangeClick(object sender, EventArgs e)
{
Word = textBoxWord.Text;
ActionResult = Action.ChangeOnce;
DialogResult = DialogResult.OK;
}
private void ButtonSkipOnceClick(object sender, EventArgs e)
{
ActionResult = Action.SkipOnce;
DialogResult = DialogResult.OK;
}
private void ButtonSkipAllClick(object sender, EventArgs e)
{
Word = textBoxWord.Text;
ActionResult = Action.SkipAll;
DialogResult = DialogResult.OK;
}
private void ButtonUseSuggestionClick(object sender, EventArgs e)
{
if (listBoxSuggestions.SelectedIndex >= 0)
{
Word = listBoxSuggestions.SelectedItem.ToString();
ActionResult = Action.UseSuggestion;
DialogResult = DialogResult.OK;
}
}
private void ButtonUseSuggestionAlwaysClick(object sender, EventArgs e)
{
if (listBoxSuggestions.SelectedIndex >= 0)
{
Word = listBoxSuggestions.Items[listBoxSuggestions.SelectedIndex].ToString();
ActionResult = Action.AllwaysUseSuggestion;
DialogResult = DialogResult.OK;
}
}
private void ButtonChangeWholeTextClick(object sender, EventArgs e)
{
Paragraph = textBoxWholeText.Text.Trim();
ActionResult = Action.ChangeWholeText;
DialogResult = DialogResult.OK;
}
private void ButtonAddToNamesClick(object sender, EventArgs e)
{
Word = textBoxWord.Text.Trim();
ActionResult = Action.AddToNames;
DialogResult = DialogResult.OK;
}
private void ButtonAddToDictionaryClick(object sender, EventArgs e)
{
string s = textBoxWord.Text.Trim();
if (s.Length == 0 || s.Contains(" "))
{
MessageBox.Show("Word should be one single word");
return;
}
Word = s;
if (Word.Length == 0)
ActionResult = Action.SkipOnce;
else
ActionResult = Action.AddToUserDictionary;
DialogResult = DialogResult.OK;
}
private void ButtonSkipTextClick(object sender, EventArgs e)
{
Word = textBoxWord.Text;
ActionResult = Action.SkipWholeText;
DialogResult = DialogResult.OK;
}
private void TextBoxWordKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
ButtonChangeClick(null, null);
e.SuppressKeyPress = true;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,380 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class FormRemoveTextForHearImpaired
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.listViewFixes = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader8 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.checkBoxRemoveTextBeforeColon = new System.Windows.Forms.CheckBox();
this.groupBoxRemoveTextConditions = new System.Windows.Forms.GroupBox();
this.comboBoxRemoveIfTextContains = new System.Windows.Forms.ComboBox();
this.checkBoxRemoveWhereContains = new System.Windows.Forms.CheckBox();
this.comboBoxCustomEnd = new System.Windows.Forms.ComboBox();
this.comboBoxCustomStart = new System.Windows.Forms.ComboBox();
this.checkBoxRemoveTextBeforeColonOnlyUppercase = new System.Windows.Forms.CheckBox();
this.checkBoxOnlyIfInSeparateLine = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveTextBetweenCustomTags = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveTextBetweenQuestionMarks = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveTextBetweenParentheses = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveTextBetweenBrackets = new System.Windows.Forms.CheckBox();
this.checkBoxRemoveTextBetweenSquares = new System.Windows.Forms.CheckBox();
this.labelAnd = new System.Windows.Forms.Label();
this.labelRemoveTextBetween = new System.Windows.Forms.Label();
this.groupBoxLinesFound.SuspendLayout();
this.groupBoxRemoveTextConditions.SuspendLayout();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonOK.Location = new System.Drawing.Point(523, 477);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(604, 477);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.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.groupBoxLinesFound.Controls.Add(this.listViewFixes);
this.groupBoxLinesFound.Location = new System.Drawing.Point(12, 222);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(673, 249);
this.groupBoxLinesFound.TabIndex = 1;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Lines found";
//
// listViewFixes
//
this.listViewFixes.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.listViewFixes.CheckBoxes = true;
this.listViewFixes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader4,
this.columnHeader5,
this.columnHeader7,
this.columnHeader8});
this.listViewFixes.FullRowSelect = true;
this.listViewFixes.Location = new System.Drawing.Point(6, 13);
this.listViewFixes.Name = "listViewFixes";
this.listViewFixes.Size = new System.Drawing.Size(661, 230);
this.listViewFixes.TabIndex = 0;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
//
// columnHeader4
//
this.columnHeader4.Text = "Apply";
this.columnHeader4.Width = 45;
//
// columnHeader5
//
this.columnHeader5.Text = "Line#";
this.columnHeader5.Width = 61;
//
// columnHeader7
//
this.columnHeader7.Text = "Before";
this.columnHeader7.Width = 251;
//
// columnHeader8
//
this.columnHeader8.Text = "After";
this.columnHeader8.Width = 266;
//
// checkBoxRemoveTextBeforeColon
//
this.checkBoxRemoveTextBeforeColon.AutoSize = true;
this.checkBoxRemoveTextBeforeColon.Checked = true;
this.checkBoxRemoveTextBeforeColon.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBeforeColon.Location = new System.Drawing.Point(241, 26);
this.checkBoxRemoveTextBeforeColon.Name = "checkBoxRemoveTextBeforeColon";
this.checkBoxRemoveTextBeforeColon.Size = new System.Drawing.Size(169, 17);
this.checkBoxRemoveTextBeforeColon.TabIndex = 9;
this.checkBoxRemoveTextBeforeColon.Text = "Remove text before a colon (:)";
this.checkBoxRemoveTextBeforeColon.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBeforeColon.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// groupBoxRemoveTextConditions
//
this.groupBoxRemoveTextConditions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxRemoveTextConditions.Controls.Add(this.labelRemoveTextBetween);
this.groupBoxRemoveTextConditions.Controls.Add(this.comboBoxRemoveIfTextContains);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveWhereContains);
this.groupBoxRemoveTextConditions.Controls.Add(this.comboBoxCustomEnd);
this.groupBoxRemoveTextConditions.Controls.Add(this.comboBoxCustomStart);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBeforeColonOnlyUppercase);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBeforeColon);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxOnlyIfInSeparateLine);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBetweenCustomTags);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBetweenQuestionMarks);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBetweenParentheses);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBetweenBrackets);
this.groupBoxRemoveTextConditions.Controls.Add(this.checkBoxRemoveTextBetweenSquares);
this.groupBoxRemoveTextConditions.Controls.Add(this.labelAnd);
this.groupBoxRemoveTextConditions.Location = new System.Drawing.Point(12, 12);
this.groupBoxRemoveTextConditions.Name = "groupBoxRemoveTextConditions";
this.groupBoxRemoveTextConditions.Size = new System.Drawing.Size(673, 204);
this.groupBoxRemoveTextConditions.TabIndex = 0;
this.groupBoxRemoveTextConditions.TabStop = false;
this.groupBoxRemoveTextConditions.Text = "Remove text conditions";
//
// comboBoxRemoveIfTextContains
//
this.comboBoxRemoveIfTextContains.FormattingEnabled = true;
this.comboBoxRemoveIfTextContains.Items.AddRange(new object[] {
"¶",
"♪",
"♫"});
this.comboBoxRemoveIfTextContains.Location = new System.Drawing.Point(395, 135);
this.comboBoxRemoveIfTextContains.MaxLength = 10;
this.comboBoxRemoveIfTextContains.Name = "comboBoxRemoveIfTextContains";
this.comboBoxRemoveIfTextContains.Size = new System.Drawing.Size(100, 21);
this.comboBoxRemoveIfTextContains.TabIndex = 12;
this.comboBoxRemoveIfTextContains.Text = "¶";
this.comboBoxRemoveIfTextContains.TextChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveWhereContains
//
this.checkBoxRemoveWhereContains.AutoSize = true;
this.checkBoxRemoveWhereContains.Location = new System.Drawing.Point(241, 137);
this.checkBoxRemoveWhereContains.Name = "checkBoxRemoveWhereContains";
this.checkBoxRemoveWhereContains.Size = new System.Drawing.Size(148, 17);
this.checkBoxRemoveWhereContains.TabIndex = 11;
this.checkBoxRemoveWhereContains.Text = "Remove text if it contains:";
this.checkBoxRemoveWhereContains.UseVisualStyleBackColor = true;
this.checkBoxRemoveWhereContains.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// comboBoxCustomEnd
//
this.comboBoxCustomEnd.FormattingEnabled = true;
this.comboBoxCustomEnd.Items.AddRange(new object[] {
"¶",
"♪",
"♫"});
this.comboBoxCustomEnd.Location = new System.Drawing.Point(116, 135);
this.comboBoxCustomEnd.MaxLength = 2;
this.comboBoxCustomEnd.Name = "comboBoxCustomEnd";
this.comboBoxCustomEnd.Size = new System.Drawing.Size(38, 21);
this.comboBoxCustomEnd.TabIndex = 7;
this.comboBoxCustomEnd.Text = "¶";
this.comboBoxCustomEnd.TextChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// comboBoxCustomStart
//
this.comboBoxCustomStart.FormattingEnabled = true;
this.comboBoxCustomStart.Items.AddRange(new object[] {
"¶",
"♪",
"♫"});
this.comboBoxCustomStart.Location = new System.Drawing.Point(41, 135);
this.comboBoxCustomStart.MaxLength = 2;
this.comboBoxCustomStart.Name = "comboBoxCustomStart";
this.comboBoxCustomStart.Size = new System.Drawing.Size(38, 21);
this.comboBoxCustomStart.TabIndex = 5;
this.comboBoxCustomStart.Text = "¶";
this.comboBoxCustomStart.TextChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBeforeColonOnlyUppercase
//
this.checkBoxRemoveTextBeforeColonOnlyUppercase.AutoSize = true;
this.checkBoxRemoveTextBeforeColonOnlyUppercase.Location = new System.Drawing.Point(260, 44);
this.checkBoxRemoveTextBeforeColonOnlyUppercase.Name = "checkBoxRemoveTextBeforeColonOnlyUppercase";
this.checkBoxRemoveTextBeforeColonOnlyUppercase.Size = new System.Drawing.Size(153, 17);
this.checkBoxRemoveTextBeforeColonOnlyUppercase.TabIndex = 10;
this.checkBoxRemoveTextBeforeColonOnlyUppercase.Text = "Only if text is UPPERCASE";
this.checkBoxRemoveTextBeforeColonOnlyUppercase.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBeforeColonOnlyUppercase.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxOnlyIfInSeparateLine
//
this.checkBoxOnlyIfInSeparateLine.AutoSize = true;
this.checkBoxOnlyIfInSeparateLine.Location = new System.Drawing.Point(11, 169);
this.checkBoxOnlyIfInSeparateLine.Name = "checkBoxOnlyIfInSeparateLine";
this.checkBoxOnlyIfInSeparateLine.Size = new System.Drawing.Size(133, 17);
this.checkBoxOnlyIfInSeparateLine.TabIndex = 8;
this.checkBoxOnlyIfInSeparateLine.Text = "Only if on separate line";
this.checkBoxOnlyIfInSeparateLine.UseVisualStyleBackColor = true;
this.checkBoxOnlyIfInSeparateLine.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBetweenCustomTags
//
this.checkBoxRemoveTextBetweenCustomTags.AutoSize = true;
this.checkBoxRemoveTextBetweenCustomTags.Checked = true;
this.checkBoxRemoveTextBetweenCustomTags.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBetweenCustomTags.Location = new System.Drawing.Point(20, 138);
this.checkBoxRemoveTextBetweenCustomTags.Name = "checkBoxRemoveTextBetweenCustomTags";
this.checkBoxRemoveTextBetweenCustomTags.Size = new System.Drawing.Size(15, 14);
this.checkBoxRemoveTextBetweenCustomTags.TabIndex = 4;
this.checkBoxRemoveTextBetweenCustomTags.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBetweenCustomTags.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBetweenQuestionMarks
//
this.checkBoxRemoveTextBetweenQuestionMarks.AutoSize = true;
this.checkBoxRemoveTextBetweenQuestionMarks.Checked = true;
this.checkBoxRemoveTextBetweenQuestionMarks.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBetweenQuestionMarks.Location = new System.Drawing.Point(20, 115);
this.checkBoxRemoveTextBetweenQuestionMarks.Name = "checkBoxRemoveTextBetweenQuestionMarks";
this.checkBoxRemoveTextBetweenQuestionMarks.Size = new System.Drawing.Size(82, 17);
this.checkBoxRemoveTextBetweenQuestionMarks.TabIndex = 3;
this.checkBoxRemoveTextBetweenQuestionMarks.Text = "\"?\" and \"?\"";
this.checkBoxRemoveTextBetweenQuestionMarks.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBetweenQuestionMarks.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBetweenParentheses
//
this.checkBoxRemoveTextBetweenParentheses.AutoSize = true;
this.checkBoxRemoveTextBetweenParentheses.Checked = true;
this.checkBoxRemoveTextBetweenParentheses.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBetweenParentheses.Location = new System.Drawing.Point(20, 69);
this.checkBoxRemoveTextBetweenParentheses.Name = "checkBoxRemoveTextBetweenParentheses";
this.checkBoxRemoveTextBetweenParentheses.Size = new System.Drawing.Size(76, 17);
this.checkBoxRemoveTextBetweenParentheses.TabIndex = 1;
this.checkBoxRemoveTextBetweenParentheses.Text = "\"(\" and \")\"";
this.checkBoxRemoveTextBetweenParentheses.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBetweenParentheses.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBetweenBrackets
//
this.checkBoxRemoveTextBetweenBrackets.AutoSize = true;
this.checkBoxRemoveTextBetweenBrackets.Checked = true;
this.checkBoxRemoveTextBetweenBrackets.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBetweenBrackets.Location = new System.Drawing.Point(20, 92);
this.checkBoxRemoveTextBetweenBrackets.Name = "checkBoxRemoveTextBetweenBrackets";
this.checkBoxRemoveTextBetweenBrackets.Size = new System.Drawing.Size(78, 17);
this.checkBoxRemoveTextBetweenBrackets.TabIndex = 2;
this.checkBoxRemoveTextBetweenBrackets.Text = "\"{\" and \"}\"";
this.checkBoxRemoveTextBetweenBrackets.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBetweenBrackets.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// checkBoxRemoveTextBetweenSquares
//
this.checkBoxRemoveTextBetweenSquares.AutoSize = true;
this.checkBoxRemoveTextBetweenSquares.Checked = true;
this.checkBoxRemoveTextBetweenSquares.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxRemoveTextBetweenSquares.Location = new System.Drawing.Point(20, 45);
this.checkBoxRemoveTextBetweenSquares.Name = "checkBoxRemoveTextBetweenSquares";
this.checkBoxRemoveTextBetweenSquares.Size = new System.Drawing.Size(76, 17);
this.checkBoxRemoveTextBetweenSquares.TabIndex = 0;
this.checkBoxRemoveTextBetweenSquares.Text = "\"[\" and \"]\"";
this.checkBoxRemoveTextBetweenSquares.UseVisualStyleBackColor = true;
this.checkBoxRemoveTextBetweenSquares.CheckedChanged += new System.EventHandler(this.CheckBoxRemoveTextBetweenCheckedChanged);
//
// labelAnd
//
this.labelAnd.AutoSize = true;
this.labelAnd.Location = new System.Drawing.Point(85, 141);
this.labelAnd.Name = "labelAnd";
this.labelAnd.Size = new System.Drawing.Size(25, 13);
this.labelAnd.TabIndex = 6;
this.labelAnd.Text = "and";
//
// labelRemoveTextBetween
//
this.labelRemoveTextBetween.AutoSize = true;
this.labelRemoveTextBetween.Location = new System.Drawing.Point(8, 26);
this.labelRemoveTextBetween.Name = "labelRemoveTextBetween";
this.labelRemoveTextBetween.Size = new System.Drawing.Size(111, 13);
this.labelRemoveTextBetween.TabIndex = 13;
this.labelRemoveTextBetween.Text = "Remove text between";
//
// FormRemoveTextForHearImpaired
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(697, 503);
this.Controls.Add(this.groupBoxRemoveTextConditions);
this.Controls.Add(this.groupBoxLinesFound);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(705, 514);
this.Name = "FormRemoveTextForHearImpaired";
this.ShowIcon = false;
this.Text = "Remove text for hearing impaired";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormRemoveTextForHearImpaired_KeyDown);
this.groupBoxLinesFound.ResumeLayout(false);
this.groupBoxRemoveTextConditions.ResumeLayout(false);
this.groupBoxRemoveTextConditions.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.ListView listViewFixes;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
private System.Windows.Forms.ColumnHeader columnHeader7;
private System.Windows.Forms.ColumnHeader columnHeader8;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBeforeColon;
private System.Windows.Forms.GroupBox groupBoxRemoveTextConditions;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBetweenCustomTags;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBetweenQuestionMarks;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBetweenParentheses;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBetweenBrackets;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBetweenSquares;
private System.Windows.Forms.Label labelAnd;
private System.Windows.Forms.CheckBox checkBoxRemoveTextBeforeColonOnlyUppercase;
private System.Windows.Forms.CheckBox checkBoxOnlyIfInSeparateLine;
private System.Windows.Forms.ComboBox comboBoxCustomStart;
private System.Windows.Forms.ComboBox comboBoxCustomEnd;
private System.Windows.Forms.ComboBox comboBoxRemoveIfTextContains;
private System.Windows.Forms.CheckBox checkBoxRemoveWhereContains;
private System.Windows.Forms.Label labelRemoveTextBetween;
}
}

View File

@ -0,0 +1,460 @@
using System;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Collections.Generic;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class FormRemoveTextForHearImpaired : Form
{
Subtitle _subtitle;
readonly LanguageStructure.RemoveTextFromHearImpaired _language;
public FormRemoveTextForHearImpaired()
{
InitializeComponent();
_language = Configuration.Settings.Language.RemoveTextFromHearImpaired;
Text = _language.Title;
groupBoxRemoveTextConditions.Text = _language.RemoveTextConditions;
labelAnd.Text = _language.And;
labelRemoveTextBetween.Text = _language.RemoveTextBetween;
checkBoxRemoveTextBeforeColon.Text = _language.RemoveTextBeforeColon;
checkBoxRemoveTextBeforeColonOnlyUppercase.Text = _language.OnlyIfTextIsUppercase;
checkBoxOnlyIfInSeparateLine.Text = _language.OnlyIfInSeparateLine;
checkBoxRemoveTextBetweenBrackets.Text = _language.Brackets;
checkBoxRemoveTextBetweenParentheses.Text = _language.Parentheses;
checkBoxRemoveTextBetweenQuestionMarks.Text = _language.QuestionMarks;
checkBoxRemoveTextBetweenSquares.Text = _language.SquareBrackets;
checkBoxRemoveWhereContains.Text = _language.RemoveTextIfContains;
listViewFixes.Columns[0].Text = Configuration.Settings.Language.General.Apply;
listViewFixes.Columns[1].Text = _language.LineNumber;
listViewFixes.Columns[2].Text = _language.Before;
listViewFixes.Columns[3].Text = _language.After;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
}
public static string RemoveStartEndNoise(string text)
{
string s = text.Trim();
if (s.StartsWith("<b>") && s.Length > 3)
s = s.Substring(3);
if (s.StartsWith("<i>") && s.Length > 3)
s = s.Substring(3);
if (s.StartsWith("<u>") && s.Length > 3)
s = s.Substring(3);
if (s.StartsWith("<B>") && s.Length > 3)
s = s.Substring(3);
if (s.StartsWith("<I>") && s.Length > 3)
s = s.Substring(3);
if (s.StartsWith("<U>") && s.Length > 3)
s = s.Substring(3);
if (s.EndsWith("</b>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.EndsWith("</i>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.EndsWith("</u>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.EndsWith("</B>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.EndsWith("</I>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.EndsWith("</U>") && s.Length > 4)
s = s.Substring(0, s.Length-4);
if (s.StartsWith("-") && s.Length > 2)
s = s.TrimStart('-');
return s.Trim();
}
public bool HasHearImpariedTagsAtStart(string text)
{
if (checkBoxOnlyIfInSeparateLine.Checked)
return StartAndEndsWithHearImpariedTags(text);
return (text.StartsWith("[") && text.IndexOf("]") > 0 && checkBoxRemoveTextBetweenSquares.Checked) ||
(text.StartsWith("{") && text.IndexOf("}") > 0 && checkBoxRemoveTextBetweenBrackets.Checked) ||
(text.StartsWith("?") && text.IndexOf("?", 1) > 0 && checkBoxRemoveTextBetweenQuestionMarks.Checked) ||
(text.StartsWith("(") && text.IndexOf(")") > 0 && checkBoxRemoveTextBetweenParentheses.Checked) ||
(text.StartsWith("[") && text.IndexOf("]:") > 0 && checkBoxRemoveTextBetweenSquares.Checked) ||
(text.StartsWith("{") && text.IndexOf("}:") > 0 && checkBoxRemoveTextBetweenBrackets.Checked) ||
(text.StartsWith("?") && text.IndexOf("?:", 1) > 0 && checkBoxRemoveTextBetweenQuestionMarks.Checked) ||
(text.StartsWith("(") && text.IndexOf("):") > 0 && checkBoxRemoveTextBetweenParentheses.Checked) ||
(checkBoxRemoveTextBetweenCustomTags.Checked &&
comboBoxCustomStart.Text.Length > 0 && comboBoxCustomEnd.Text.Length > 0 &&
text.StartsWith(comboBoxCustomStart.Text) && text.IndexOf(comboBoxCustomEnd.Text, 1) > 0);
}
public bool HasHearImpariedTagsAtEnd(string text)
{
if (checkBoxOnlyIfInSeparateLine.Checked)
return StartAndEndsWithHearImpariedTags(text);
return (text.EndsWith("]") && text.IndexOf("[") > 0 && checkBoxRemoveTextBetweenSquares.Checked) ||
(text.EndsWith("}") && text.IndexOf("{") > 0 && checkBoxRemoveTextBetweenBrackets.Checked) ||
(text.EndsWith(")") && text.IndexOf("(") > 0 && checkBoxRemoveTextBetweenParentheses.Checked) ||
(checkBoxRemoveTextBetweenCustomTags.Checked &&
comboBoxCustomStart.Text.Length > 0 && comboBoxCustomEnd.Text.Length > 0 &&
text.EndsWith(comboBoxCustomEnd.Text) && text.IndexOf(comboBoxCustomStart.Text) > 0);
}
private bool StartAndEndsWithHearImpariedTags(string text)
{
return (text.StartsWith("[") && text.EndsWith("]") && checkBoxRemoveTextBetweenSquares.Checked) ||
(text.StartsWith("{") && text.EndsWith("}") && checkBoxRemoveTextBetweenBrackets.Checked) ||
(text.StartsWith("?") && text.EndsWith("?") && checkBoxRemoveTextBetweenQuestionMarks.Checked) ||
(text.StartsWith("(") && text.EndsWith(")") && checkBoxRemoveTextBetweenParentheses.Checked) ||
(text.StartsWith("[") && text.EndsWith("]:") && checkBoxRemoveTextBetweenSquares.Checked) ||
(text.StartsWith("{") && text.EndsWith("}:") && checkBoxRemoveTextBetweenBrackets.Checked) ||
(text.StartsWith("?") && text.EndsWith("?:") && checkBoxRemoveTextBetweenQuestionMarks.Checked) ||
(text.StartsWith("(") && text.EndsWith("):") && checkBoxRemoveTextBetweenParentheses.Checked) ||
(checkBoxRemoveTextBetweenCustomTags.Checked &&
comboBoxCustomStart.Text.Length > 0 && comboBoxCustomEnd.Text.Length > 0 &&
text.StartsWith(comboBoxCustomStart.Text) && text.EndsWith(comboBoxCustomEnd.Text));
}
public void Initialize(Subtitle subtitle)
{
if (Environment.OSVersion.Version.Major < 6) // 6 == Vista/Win2008Server/Win7
{
string unicodeFontName = "Lucida Sans Unicode";
float fontSize = comboBoxCustomStart.Font.Size;
comboBoxCustomStart.Font = new System.Drawing.Font(unicodeFontName, fontSize);
comboBoxCustomEnd.Font = new System.Drawing.Font(unicodeFontName, fontSize);
comboBoxRemoveIfTextContains.Font = new System.Drawing.Font(unicodeFontName, fontSize);
}
comboBoxRemoveIfTextContains.Left = checkBoxRemoveWhereContains.Left + checkBoxRemoveWhereContains.Width;
_subtitle = subtitle;
GeneratePreview();
}
private void GeneratePreview()
{
listViewFixes.BeginUpdate();
listViewFixes.Items.Clear();
int count = 0;
foreach (Paragraph p in _subtitle.Paragraphs)
{
bool hit = false;
if (HasHearImpariedTagsAtStart(RemoveStartEndNoise(p.Text)))
hit = true;
if (HasHearImpariedTagsAtEnd(RemoveStartEndNoise(p.Text)))
hit = true;
if (!hit && checkBoxRemoveWhereContains.Checked && comboBoxRemoveIfTextContains.Text.Length > 0 && p.Text.Contains(comboBoxRemoveIfTextContains.Text))
hit = true;
if (!hit)
{
foreach (string s in p.Text.Trim().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
if (HasHearImpariedTagsAtStart(RemoveStartEndNoise(s)))
hit = true;
}
}
if (RemoveColon(p.Text) != p.Text.Trim())
{
hit = true;
}
if (hit)
{
count++;
string newText = RemoveTextFromHearImpaired(p.Text);
AddToListView(p, newText);
}
}
listViewFixes.EndUpdate();
groupBoxLinesFound.Text = string.Format(_language.LinesFoundX, count);
}
private string RemoveColon(string text)
{
// House 7x01 line 52: and she would like you to do three things:
// Okay or remove???
if (text.IndexOf(':') > 0 && text.IndexOf(':') == text.Length - 1 && text != text.ToUpper())
return text;
List<int> removedAtLine = new List<int>();
var sb = new StringBuilder();
string[] parts = text.Trim().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
// two ppl talking - add a "- " before text
if (parts.Length == 2 && parts[0].Contains(": ") && parts[1].Contains(": ") && !text.Contains("-"))
{
parts[0] = parts[0].Replace(": ", ": - ");
parts[1] = parts[1].Replace(": ", ": - ");
}
int lineNo = 1;
foreach (string s in parts)
{
string s2 = s;
if (checkBoxRemoveTextBeforeColon.Checked &&
(s2.Contains(": ") || s2.EndsWith(":")))
{
if (!s2.StartsWith(s2.Substring(0, s2.IndexOf(":")).ToUpper()) &&
checkBoxRemoveTextBeforeColonOnlyUppercase.Checked)
{
sb.AppendLine(s2);
}
else if (s2.Contains(": "))
{
s2 = s2.Remove(0, s2.IndexOf(": ") + 2);
removedAtLine.Add(lineNo);
if (!s2.Trim().StartsWith("-") &&
sb.ToString().Length == 0 &&
text.Contains(Environment.NewLine + "- "))
s2 = "- " + s2;
if (!s2.Trim().StartsWith("-") &&
sb.ToString().Length > 0 &&
sb.ToString().StartsWith("- "))
s2 = "- " + s2;
for (int k = 0; k < 2; k++)
{
if (s2.Contains(":"))
{
int colonIndex = s2.IndexOf(":");
string start = s2.Substring(0, colonIndex);
int periodIndex = start.LastIndexOf(".");
int questIndex = start.LastIndexOf("?");
int exclaIndex = start.LastIndexOf("!");
int endIndex = periodIndex;
if (endIndex == -1 || questIndex > endIndex)
endIndex = questIndex;
if (endIndex == -1 || exclaIndex > endIndex)
endIndex = exclaIndex;
if (endIndex > 0)
{
s2 = s2.Remove(endIndex + 1, colonIndex - endIndex);
}
}
}
sb.AppendLine(s2);
}
else if (s2.Contains("!") || s2.Contains("?") || s2.Contains("."))
{
int index = s2.LastIndexOf("!");
if (index == -1 || s2.LastIndexOf("?") > index)
index = s2.LastIndexOf("?");
if (index == -1 || s2.LastIndexOf(".") > index)
index = s2.LastIndexOf(".");
if (index > 3)
sb.AppendLine(s2.Substring(0, index+1));
}
}
else
{
sb.AppendLine(s2);
}
lineNo++;
}
string newText = sb.ToString().Trim();
if (text != newText)
{
parts = newText.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 2)
{
if (parts[0].Contains("-") && parts[1].IndexOf("-") > 6)
parts[1] = "- " + parts[1];
else if (removedAtLine.Count == 1 && removedAtLine[0] > 1)
{
if (parts[0].IndexOf("-") < 0 || parts[0].IndexOf("-") > 6)
parts[0] = "- " + parts[0];
if (parts[1].IndexOf("-") < 0 || parts[1].IndexOf("-") > 6)
parts[1] = "- " + parts[1];
}
newText = parts[0] + Environment.NewLine + parts[1];
}
}
return newText;
}
private string RemoveTextFromHearImpaired(string text)
{
if (checkBoxRemoveWhereContains.Checked && comboBoxRemoveIfTextContains.Text.Length > 0 && text.Contains(comboBoxRemoveIfTextContains.Text))
{
return string.Empty;
}
string oldText = text;
text = RemoveColon(text);
StripableText st = new StripableText(text, " >-\"'`´♪¿¡.", " -\"'`´♪.!?:");
var sb = new StringBuilder();
string[] parts = st.StrippedText.Trim().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
foreach (string s in parts)
{
StripableText stSub = new StripableText(s, " >-\"'`´♪¿¡.", " -\"'`´♪.!?:");
if (!StartAndEndsWithHearImpariedTags(stSub.StrippedText))
{
string newText = stSub.StrippedText;
if (HasHearImpariedTagsAtStart(newText))
newText = RemoveStartEndTags(newText);
if (HasHearImpariedTagsAtEnd(newText))
newText = RemoveEndTags(newText);
sb.AppendLine(stSub.Pre + newText + stSub.Post);
}
else if (st.Pre.Contains("<i>") && stSub.Post.Contains("</i>"))
{
st.Pre = st.Pre.Replace("<i>", string.Empty);
}
}
text = st.Pre + sb.ToString().Trim() + st.Post;
text = RemoveColon(text);
st = new StripableText(text, " >-\"'`´♪¿¡.", " -\"'`´♪.!?:");
text = st.StrippedText;
if (StartAndEndsWithHearImpariedTags(text))
{
string newText = text;
text = RemoveStartEndTags(text);
}
if (!string.IsNullOrEmpty(text))
text = st.Pre + text + st.Post;
if (oldText.Trim().StartsWith("- ") &&
(oldText.Contains(Environment.NewLine + "- ") || oldText.Contains(Environment.NewLine + " - ")) &&
text != null && !text.Contains(Environment.NewLine))
{
text = text.TrimStart().TrimStart('-').TrimStart();
}
return text;
}
private string RemoveEndTags(string newText)
{
string s = newText;
if (s.EndsWith("]") && s.LastIndexOf("[") > 0 && checkBoxRemoveTextBetweenSquares.Checked)
newText = s.Remove(s.LastIndexOf("["));
else if (s.EndsWith("}") && s.LastIndexOf("{") > 0 && checkBoxRemoveTextBetweenBrackets.Checked)
newText = s.Remove(s.LastIndexOf("}"));
else if (s.EndsWith(")") && s.LastIndexOf("(") > 0 && checkBoxRemoveTextBetweenParentheses.Checked)
newText = s.Remove(s.LastIndexOf("("));
else if (checkBoxRemoveTextBetweenCustomTags.Checked &&
s.Length > 0 && comboBoxCustomEnd.Text.Length > 0 && comboBoxCustomStart.Text.Length > 0 &&
s.EndsWith(comboBoxCustomEnd.Text) && s.LastIndexOf(comboBoxCustomStart.Text) > 0)
newText = s.Remove(s.LastIndexOf(comboBoxCustomStart.Text));
if (newText != s)
newText = newText.TrimEnd(' ');
return newText;
}
private string RemoveStartEndTags(string text)
{
string newText = text;
string s = text;
if (s.StartsWith("[") && s.IndexOf("]") > 0 && checkBoxRemoveTextBetweenSquares.Checked)
newText = s.Remove(0, s.IndexOf("]") + 1);
else if (s.StartsWith("{") && s.IndexOf("}") > 0 && checkBoxRemoveTextBetweenBrackets.Checked)
newText = s.Remove(0, s.IndexOf("}") + 1);
else if (s.StartsWith("?") && s.IndexOf("?", 1) > 0 && checkBoxRemoveTextBetweenQuestionMarks.Checked)
newText = s.Remove(0, s.IndexOf("?", 1) + 1);
else if (s.StartsWith("(") && s.IndexOf(")") > 0 && checkBoxRemoveTextBetweenParentheses.Checked)
newText = s.Remove(0, s.IndexOf(")") + 1);
else if (s.StartsWith("[") && s.IndexOf("]:") > 0 && checkBoxRemoveTextBetweenSquares.Checked)
newText = s.Remove(0, s.IndexOf("]:") + 2);
else if (s.StartsWith("{") && s.IndexOf("}:") > 0 && checkBoxRemoveTextBetweenBrackets.Checked)
newText = s.Remove(0, s.IndexOf("}:") + 2);
else if (s.StartsWith("?") && s.IndexOf("?:", 1) > 0 && checkBoxRemoveTextBetweenQuestionMarks.Checked)
newText = s.Remove(0, s.IndexOf("?:") + 2);
else if (s.StartsWith("(") && s.IndexOf("):") > 0 && checkBoxRemoveTextBetweenParentheses.Checked)
newText = s.Remove(0, s.IndexOf("):") + 2);
else if (checkBoxRemoveTextBetweenCustomTags.Checked &&
s.Length > 0 && comboBoxCustomEnd.Text.Length > 0 && comboBoxCustomStart.Text.Length > 0 &&
s.StartsWith(comboBoxCustomStart.Text) && s.LastIndexOf(comboBoxCustomEnd.Text) > 0)
newText = s.Remove(0, s.LastIndexOf(comboBoxCustomEnd.Text) + comboBoxCustomEnd.Text.Length);
if (newText != text)
newText = newText.TrimStart(' ');
return newText;
}
private void AddToListView(Paragraph p, string newText)
{
var item = new ListViewItem(string.Empty) {Tag = p, Checked = true};
var subItem = new ListViewItem.ListViewSubItem(item, p.Number.ToString());
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, p.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
listViewFixes.Items.Add(item);
}
private void FormRemoveTextForHearImpaired_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
}
private void ButtonOkClick(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
public int RemoveTextFromHearImpaired()
{
int count = 0;
for (int i = _subtitle.Paragraphs.Count - 1; i >= 0; i--)
{
Paragraph p = _subtitle.Paragraphs[i];
if (IsFixAllowed(p))
{
string newText = RemoveTextFromHearImpaired(p.Text);
if (string.IsNullOrEmpty(newText))
{
_subtitle.Paragraphs.RemoveAt(i);
}
else
{
p.Text = newText;
}
count++;
}
}
return count;
}
private bool IsFixAllowed(Paragraph p)
{
foreach (ListViewItem item in listViewFixes.Items)
{
if (item.Tag.ToString() == p.ToString())
return item.Checked;
}
return false;
}
private void CheckBoxRemoveTextBetweenCheckedChanged(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
GeneratePreview();
Cursor = Cursors.Default;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

187
src/Forms/ReplaceDialog.Designer.cs generated Normal file
View File

@ -0,0 +1,187 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ReplaceDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReplaceDialog));
this.radioButtonRegEx = new System.Windows.Forms.RadioButton();
this.radioButtonCaseSensitive = new System.Windows.Forms.RadioButton();
this.radioButtonNormal = new System.Windows.Forms.RadioButton();
this.buttonReplace = new System.Windows.Forms.Button();
this.textBoxFind = new System.Windows.Forms.TextBox();
this.buttonReplaceAll = new System.Windows.Forms.Button();
this.textBoxReplace = new System.Windows.Forms.TextBox();
this.labelReplaceWith = new System.Windows.Forms.Label();
this.labelFindWhat = new System.Windows.Forms.Label();
this.buttonFind = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// radioButtonRegEx
//
this.radioButtonRegEx.AutoSize = true;
this.radioButtonRegEx.Location = new System.Drawing.Point(182, 51);
this.radioButtonRegEx.Name = "radioButtonRegEx";
this.radioButtonRegEx.Size = new System.Drawing.Size(57, 17);
this.radioButtonRegEx.TabIndex = 3;
this.radioButtonRegEx.Text = "RegEx";
this.radioButtonRegEx.UseVisualStyleBackColor = true;
this.radioButtonRegEx.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonCaseSensitive
//
this.radioButtonCaseSensitive.AutoSize = true;
this.radioButtonCaseSensitive.Location = new System.Drawing.Point(81, 51);
this.radioButtonCaseSensitive.Name = "radioButtonCaseSensitive";
this.radioButtonCaseSensitive.Size = new System.Drawing.Size(93, 17);
this.radioButtonCaseSensitive.TabIndex = 2;
this.radioButtonCaseSensitive.Text = "Case sensitive";
this.radioButtonCaseSensitive.UseVisualStyleBackColor = true;
this.radioButtonCaseSensitive.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// radioButtonNormal
//
this.radioButtonNormal.AutoSize = true;
this.radioButtonNormal.Checked = true;
this.radioButtonNormal.Location = new System.Drawing.Point(17, 51);
this.radioButtonNormal.Name = "radioButtonNormal";
this.radioButtonNormal.Size = new System.Drawing.Size(58, 17);
this.radioButtonNormal.TabIndex = 1;
this.radioButtonNormal.TabStop = true;
this.radioButtonNormal.Text = "Normal";
this.radioButtonNormal.UseVisualStyleBackColor = true;
this.radioButtonNormal.CheckedChanged += new System.EventHandler(this.RadioButtonCheckedChanged);
//
// buttonReplace
//
this.buttonReplace.Location = new System.Drawing.Point(124, 140);
this.buttonReplace.Name = "buttonReplace";
this.buttonReplace.Size = new System.Drawing.Size(75, 21);
this.buttonReplace.TabIndex = 6;
this.buttonReplace.Text = "Replace";
this.buttonReplace.UseVisualStyleBackColor = true;
this.buttonReplace.Click += new System.EventHandler(this.ButtonReplaceClick);
//
// textBoxFind
//
this.textBoxFind.Location = new System.Drawing.Point(15, 25);
this.textBoxFind.Name = "textBoxFind";
this.textBoxFind.Size = new System.Drawing.Size(262, 20);
this.textBoxFind.TabIndex = 0;
this.textBoxFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxFindKeyDown);
//
// buttonReplaceAll
//
this.buttonReplaceAll.Location = new System.Drawing.Point(205, 140);
this.buttonReplaceAll.Name = "buttonReplaceAll";
this.buttonReplaceAll.Size = new System.Drawing.Size(75, 21);
this.buttonReplaceAll.TabIndex = 7;
this.buttonReplaceAll.Text = "Replace all";
this.buttonReplaceAll.UseVisualStyleBackColor = true;
this.buttonReplaceAll.Click += new System.EventHandler(this.ButtonReplaceAllClick);
//
// textBoxReplace
//
this.textBoxReplace.Location = new System.Drawing.Point(15, 103);
this.textBoxReplace.Name = "textBoxReplace";
this.textBoxReplace.Size = new System.Drawing.Size(265, 20);
this.textBoxReplace.TabIndex = 4;
this.textBoxReplace.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxFindKeyDown);
//
// labelReplaceWith
//
this.labelReplaceWith.AutoSize = true;
this.labelReplaceWith.Location = new System.Drawing.Point(12, 87);
this.labelReplaceWith.Name = "labelReplaceWith";
this.labelReplaceWith.Size = new System.Drawing.Size(72, 13);
this.labelReplaceWith.TabIndex = 14;
this.labelReplaceWith.Text = "Replace with:";
//
// labelFindWhat
//
this.labelFindWhat.AutoSize = true;
this.labelFindWhat.Location = new System.Drawing.Point(12, 9);
this.labelFindWhat.Name = "labelFindWhat";
this.labelFindWhat.Size = new System.Drawing.Size(56, 13);
this.labelFindWhat.TabIndex = 15;
this.labelFindWhat.Text = "Find what:";
//
// buttonFind
//
this.buttonFind.Location = new System.Drawing.Point(43, 140);
this.buttonFind.Name = "buttonFind";
this.buttonFind.Size = new System.Drawing.Size(75, 21);
this.buttonFind.TabIndex = 5;
this.buttonFind.Text = "Find";
this.buttonFind.UseVisualStyleBackColor = true;
this.buttonFind.Click += new System.EventHandler(this.ButtonFindClick);
//
// ReplaceDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(301, 170);
this.Controls.Add(this.buttonFind);
this.Controls.Add(this.labelFindWhat);
this.Controls.Add(this.labelReplaceWith);
this.Controls.Add(this.textBoxReplace);
this.Controls.Add(this.buttonReplaceAll);
this.Controls.Add(this.radioButtonRegEx);
this.Controls.Add(this.radioButtonCaseSensitive);
this.Controls.Add(this.radioButtonNormal);
this.Controls.Add(this.buttonReplace);
this.Controls.Add(this.textBoxFind);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ReplaceDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Replace";
this.Shown += new System.EventHandler(this.FormReplaceDialog_Shown);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormReplaceDialog_KeyDown);
this.Move += new System.EventHandler(this.FormReplaceDialog_Move);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RadioButton radioButtonRegEx;
private System.Windows.Forms.RadioButton radioButtonCaseSensitive;
private System.Windows.Forms.RadioButton radioButtonNormal;
private System.Windows.Forms.Button buttonReplace;
private System.Windows.Forms.TextBox textBoxFind;
private System.Windows.Forms.Button buttonReplaceAll;
private System.Windows.Forms.TextBox textBoxReplace;
private System.Windows.Forms.Label labelReplaceWith;
private System.Windows.Forms.Label labelFindWhat;
private System.Windows.Forms.Button buttonFind;
}
}

169
src/Forms/ReplaceDialog.cs Normal file
View File

@ -0,0 +1,169 @@
using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.Enums;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ReplaceDialog : Form
{
Regex _regEx;
int _left;
int _top;
public ReplaceDialog()
{
InitializeComponent();
Text = Configuration.Settings.Language.ReplaceDialog.Title;
labelFindWhat.Text = Configuration.Settings.Language.ReplaceDialog.FindWhat;
radioButtonNormal.Text = Configuration.Settings.Language.ReplaceDialog.Normal;
radioButtonCaseSensitive.Text = Configuration.Settings.Language.ReplaceDialog.CaseSensitive;
radioButtonRegEx.Text = Configuration.Settings.Language.ReplaceDialog.RegularExpression;
labelReplaceWith.Text = Configuration.Settings.Language.ReplaceDialog.ReplaceWith;
buttonFind.Text = Configuration.Settings.Language.ReplaceDialog.Find;
buttonReplace.Text = Configuration.Settings.Language.ReplaceDialog.Replace;
buttonReplaceAll.Text = Configuration.Settings.Language.ReplaceDialog.ReplaceAll;
}
public bool ReplaceAll { get; set; }
public bool FindOnly { get; set; }
public FindType GetFindType()
{
if (radioButtonNormal.Checked)
return FindType.Normal;
if (radioButtonCaseSensitive.Checked)
return FindType.CaseSensitive;
return FindType.RegEx;
}
public FindReplaceDialogHelper GetFindDialogHelper(int startLineIndex)
{
return new FindReplaceDialogHelper(GetFindType(), textBoxFind.Text, _regEx, textBoxReplace.Text, _left, _top, startLineIndex);
}
private void FormReplaceDialog_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
}
internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper)
{
textBoxFind.Text = selectedText;
//if we are searching for the same thing, then keep the replace text the same.
if (selectedText == findHelper.FindText)
textBoxReplace.Text = findHelper.ReplaceText;
textBoxFind.SelectAll();
_left = findHelper.WindowPositionLeft;
_top = findHelper.WindowPositionTop;
if (findHelper != null)
{
if (findHelper.FindType == FindType.RegEx)
radioButtonRegEx.Checked = true;
else if (findHelper.FindType == FindType.CaseSensitive)
radioButtonCaseSensitive.Checked = true;
else
radioButtonNormal.Checked = true;
}
}
private void ButtonReplaceClick(object sender, EventArgs e)
{
ReplaceAll = false;
FindOnly = false;
Validate(textBoxFind.Text);
}
private void ButtonReplaceAllClick(object sender, EventArgs e)
{
ReplaceAll = true;
FindOnly = false;
Validate(textBoxFind.Text);
}
private void Validate(string searchText)
{
if (searchText.Length == 0)
{
DialogResult = DialogResult.Cancel;
}
else if (radioButtonNormal.Checked)
{
DialogResult = DialogResult.OK;
}
else if (radioButtonCaseSensitive.Checked)
{
DialogResult = DialogResult.OK;
}
else if (radioButtonRegEx.Checked)
{
try
{
_regEx = new Regex(textBoxFind.Text, RegexOptions.Compiled);
DialogResult = DialogResult.OK;
}
catch (Exception exception)
{
MessageBox.Show(exception.Message);
}
}
}
private void ButtonFindClick(object sender, EventArgs e)
{
ReplaceAll = false;
FindOnly = true;
Validate(textBoxFind.Text);
}
private void FormReplaceDialog_Shown(object sender, EventArgs e)
{
if (_left > 0 && _top > 0)
{
Left = _left;
Top = _top;
}
else
{
_left = Left;
_top = Top;
}
}
private void FormReplaceDialog_Move(object sender, EventArgs e)
{
if (Left > 0 && Top > 0)
{
_left = Left;
_top = Top;
}
}
private void RadioButtonCheckedChanged(object sender, EventArgs e)
{
if (sender == radioButtonRegEx)
textBoxFind.ContextMenu = FindReplaceDialogHelper.GetRegExContextMenu(textBoxFind);
else
textBoxFind.ContextMenuStrip = null;
}
private void TextBoxFindKeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
ButtonFindClick(null, null);
e.SuppressKeyPress = true;
}
}
}
}

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAgBAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAPv7
+wTv7+8Q6+vrFOzs7BP29vYJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA////5////4P///+D///5A///8Af/8BAP/kAAH/wAAA/4AAAP+AAAD/AA
AB/wAAAf8AAAP+AAAB/gAAAf4AAAH8AAAB/AAAAfwAAAH8AAAAPAAAADwAAAE+AAAAPgAAAD4AAAA/AA
AGP4AABz+AAA4+AAAAPgAAAH/4AP///wf/8=
</value>
</data>
</root>

View File

@ -0,0 +1,170 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class SetMinimumDisplayTimeBetweenParagraphs
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBoxLinesFound = new System.Windows.Forms.GroupBox();
this.numericUpDownMinMillisecondsBetweenLines = new System.Windows.Forms.NumericUpDown();
this.labelMaxMillisecondsBetweenLines = new System.Windows.Forms.Label();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.checkBoxShowOnlyChangedLines = new System.Windows.Forms.CheckBox();
this.SubtitleListview1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.groupBoxLinesFound.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinMillisecondsBetweenLines)).BeginInit();
this.SuspendLayout();
//
// groupBoxLinesFound
//
this.groupBoxLinesFound.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.groupBoxLinesFound.Controls.Add(this.SubtitleListview1);
this.groupBoxLinesFound.Location = new System.Drawing.Point(18, 75);
this.groupBoxLinesFound.Name = "groupBoxLinesFound";
this.groupBoxLinesFound.Size = new System.Drawing.Size(726, 366);
this.groupBoxLinesFound.TabIndex = 14;
this.groupBoxLinesFound.TabStop = false;
this.groupBoxLinesFound.Text = "Preview";
//
// numericUpDownMinMillisecondsBetweenLines
//
this.numericUpDownMinMillisecondsBetweenLines.Location = new System.Drawing.Point(18, 34);
this.numericUpDownMinMillisecondsBetweenLines.Maximum = new decimal(new int[] {
1000,
0,
0,
0});
this.numericUpDownMinMillisecondsBetweenLines.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownMinMillisecondsBetweenLines.Name = "numericUpDownMinMillisecondsBetweenLines";
this.numericUpDownMinMillisecondsBetweenLines.Size = new System.Drawing.Size(64, 20);
this.numericUpDownMinMillisecondsBetweenLines.TabIndex = 34;
this.numericUpDownMinMillisecondsBetweenLines.Value = new decimal(new int[] {
50,
0,
0,
0});
this.numericUpDownMinMillisecondsBetweenLines.ValueChanged += new System.EventHandler(this.numericUpDownMinMillisecondsBetweenLines_ValueChanged);
//
// labelMaxMillisecondsBetweenLines
//
this.labelMaxMillisecondsBetweenLines.AutoSize = true;
this.labelMaxMillisecondsBetweenLines.Location = new System.Drawing.Point(15, 18);
this.labelMaxMillisecondsBetweenLines.Name = "labelMaxMillisecondsBetweenLines";
this.labelMaxMillisecondsBetweenLines.Size = new System.Drawing.Size(173, 13);
this.labelMaxMillisecondsBetweenLines.TabIndex = 35;
this.labelMaxMillisecondsBetweenLines.Text = "Mininum milliseconds between lines";
//
// 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(595, 447);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 36;
this.buttonOK.Text = "&OK";
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.Location = new System.Drawing.Point(676, 447);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 37;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// checkBoxShowOnlyChangedLines
//
this.checkBoxShowOnlyChangedLines.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxShowOnlyChangedLines.AutoSize = true;
this.checkBoxShowOnlyChangedLines.Location = new System.Drawing.Point(18, 448);
this.checkBoxShowOnlyChangedLines.Name = "checkBoxShowOnlyChangedLines";
this.checkBoxShowOnlyChangedLines.Size = new System.Drawing.Size(141, 17);
this.checkBoxShowOnlyChangedLines.TabIndex = 38;
this.checkBoxShowOnlyChangedLines.Text = "Show only modified lines";
this.checkBoxShowOnlyChangedLines.UseVisualStyleBackColor = true;
this.checkBoxShowOnlyChangedLines.CheckedChanged += new System.EventHandler(this.checkBoxShowOnlyChangedLines_CheckedChanged);
//
// SubtitleListview1
//
this.SubtitleListview1.AllowDrop = true;
this.SubtitleListview1.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.SubtitleListview1.FirstVisibleIndex = -1;
this.SubtitleListview1.FullRowSelect = true;
this.SubtitleListview1.GridLines = true;
this.SubtitleListview1.HideSelection = false;
this.SubtitleListview1.Location = new System.Drawing.Point(6, 19);
this.SubtitleListview1.Name = "SubtitleListview1";
this.SubtitleListview1.Size = new System.Drawing.Size(714, 341);
this.SubtitleListview1.TabIndex = 5;
this.SubtitleListview1.UseCompatibleStateImageBehavior = false;
this.SubtitleListview1.View = System.Windows.Forms.View.Details;
//
// SetMinimumDisplayTimeBetweenParagraphs
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(754, 480);
this.Controls.Add(this.checkBoxShowOnlyChangedLines);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.numericUpDownMinMillisecondsBetweenLines);
this.Controls.Add(this.labelMaxMillisecondsBetweenLines);
this.Controls.Add(this.groupBoxLinesFound);
this.Name = "SetMinimumDisplayTimeBetweenParagraphs";
this.Text = "Set minimum display time between paragraphs";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SetMinimalDisplayTimeDifference_KeyDown);
this.groupBoxLinesFound.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMinMillisecondsBetweenLines)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBoxLinesFound;
private System.Windows.Forms.NumericUpDown numericUpDownMinMillisecondsBetweenLines;
private System.Windows.Forms.Label labelMaxMillisecondsBetweenLines;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private Controls.SubtitleListView SubtitleListview1;
private System.Windows.Forms.CheckBox checkBoxShowOnlyChangedLines;
}
}

View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms
{
public partial class SetMinimumDisplayTimeBetweenParagraphs : Form
{
Subtitle _subtitle;
private Subtitle _fixedSubtitle;
public int FixCount { get; private set; }
public SetMinimumDisplayTimeBetweenParagraphs()
{
InitializeComponent();
Text = Configuration.Settings.Language.SetMinimumDisplayTimeBetweenParagraphs.Title;
labelMaxMillisecondsBetweenLines.Text = Configuration.Settings.Language.SetMinimumDisplayTimeBetweenParagraphs.MinimumMillisecondsBetweenParagraphs;
checkBoxShowOnlyChangedLines.Text = Configuration.Settings.Language.SetMinimumDisplayTimeBetweenParagraphs.ShowOnlyModifiedLines;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
SubtitleListview1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
public Subtitle FixedSubtitle
{
get { return _fixedSubtitle; }
private set { _fixedSubtitle = value; }
}
public void Initialize(Subtitle subtitle)
{
_subtitle = subtitle;
GeneratePreview();
}
private void GeneratePreview()
{
List<int> fixes = new List<int>();
if (_subtitle == null)
return;
FixedSubtitle = new Subtitle(_subtitle);
var onlyFixedSubtitle = new Subtitle();
double minumumMillisecondsBetweenLines = (double)numericUpDownMinMillisecondsBetweenLines.Value;
for (int i = 0; i < FixedSubtitle.Paragraphs.Count - 2; i++)
{
Paragraph p = FixedSubtitle.GetParagraphOrDefault(i);
Paragraph next = FixedSubtitle.GetParagraphOrDefault(i + 1);
if (next.StartTime.TotalMilliseconds - p.EndTime.TotalMilliseconds < minumumMillisecondsBetweenLines)
{
p.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds - minumumMillisecondsBetweenLines;
fixes.Add(i);
onlyFixedSubtitle.Paragraphs.Add(new Paragraph(p));
}
}
SubtitleListview1.BeginUpdate();
groupBoxLinesFound.Text = string.Format(Configuration.Settings.Language.SetMinimumDisplayTimeBetweenParagraphs.PreviewLinesModifiedX, fixes.Count);
if (checkBoxShowOnlyChangedLines.Checked)
{
SubtitleListview1.Fill(onlyFixedSubtitle);
}
else
{
SubtitleListview1.Fill(FixedSubtitle);
foreach (int index in fixes)
SubtitleListview1.SetBackgroundColor(index, Color.Silver);
}
SubtitleListview1.EndUpdate();
FixCount = fixes.Count;
}
private void buttonOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void SetMinimalDisplayTimeDifference_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
e.SuppressKeyPress = true;
}
}
private void numericUpDownMinMillisecondsBetweenLines_ValueChanged(object sender, EventArgs e)
{
GeneratePreview();
}
private void checkBoxShowOnlyChangedLines_CheckedChanged(object sender, EventArgs e)
{
GeneratePreview();
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

296
src/Forms/SetSyncPoint.Designer.cs generated Normal file
View File

@ -0,0 +1,296 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class SetSyncPoint
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBoxSyncPointTimeCode = new System.Windows.Forms.GroupBox();
this.timeUpDownLine = new Nikse.SubtitleEdit.Controls.TimeUpDown();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonSetSyncPoint = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.buttonOpenMovie = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.labelVideoFileName = new System.Windows.Forms.Label();
this.buttonHalfASecondBack = new System.Windows.Forms.Button();
this.buttonThreeSecondsBack = new System.Windows.Forms.Button();
this.buttonThreeSecondsAhead = new System.Windows.Forms.Button();
this.buttonHalfASecondAhead = new System.Windows.Forms.Button();
this.buttonVerify = new System.Windows.Forms.Button();
this.labelSubtitle = new System.Windows.Forms.Label();
this.videoPlayerContainer1 = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.groupBoxSyncPointTimeCode.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBoxSyncPointTimeCode
//
this.groupBoxSyncPointTimeCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBoxSyncPointTimeCode.Controls.Add(this.timeUpDownLine);
this.groupBoxSyncPointTimeCode.Location = new System.Drawing.Point(12, 12);
this.groupBoxSyncPointTimeCode.Name = "groupBoxSyncPointTimeCode";
this.groupBoxSyncPointTimeCode.Size = new System.Drawing.Size(172, 183);
this.groupBoxSyncPointTimeCode.TabIndex = 1;
this.groupBoxSyncPointTimeCode.TabStop = false;
this.groupBoxSyncPointTimeCode.Text = "Sync point time code";
//
// timeUpDownLine
//
this.timeUpDownLine.AutoSize = true;
this.timeUpDownLine.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownLine.Location = new System.Drawing.Point(18, 19);
this.timeUpDownLine.Name = "timeUpDownLine";
this.timeUpDownLine.Size = new System.Drawing.Size(89, 24);
this.timeUpDownLine.TabIndex = 1;
//
// groupBox2
//
this.groupBox2.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.groupBox2.Controls.Add(this.subtitleListView1);
this.groupBox2.Location = new System.Drawing.Point(190, 13);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(554, 182);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
//
// subtitleListView1
//
this.subtitleListView1.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.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(6, 18);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.Size = new System.Drawing.Size(542, 158);
this.subtitleListView1.TabIndex = 11;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.subtitleListView1_MouseDoubleClick);
//
// buttonCancel
//
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(662, 542);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 31;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// buttonSetSyncPoint
//
this.buttonSetSyncPoint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonSetSyncPoint.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonSetSyncPoint.Location = new System.Drawing.Point(533, 542);
this.buttonSetSyncPoint.Name = "buttonSetSyncPoint";
this.buttonSetSyncPoint.Size = new System.Drawing.Size(123, 21);
this.buttonSetSyncPoint.TabIndex = 30;
this.buttonSetSyncPoint.Text = "&Set sync point";
this.buttonSetSyncPoint.UseVisualStyleBackColor = true;
this.buttonSetSyncPoint.Click += new System.EventHandler(this.buttonOK_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// buttonOpenMovie
//
this.buttonOpenMovie.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOpenMovie.Location = new System.Drawing.Point(631, 200);
this.buttonOpenMovie.Name = "buttonOpenMovie";
this.buttonOpenMovie.Size = new System.Drawing.Size(109, 21);
this.buttonOpenMovie.TabIndex = 12;
this.buttonOpenMovie.Text = "Open movie...";
this.buttonOpenMovie.UseVisualStyleBackColor = true;
this.buttonOpenMovie.Click += new System.EventHandler(this.buttonOpenMovie_Click);
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// labelVideoFileName
//
this.labelVideoFileName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.labelVideoFileName.AutoSize = true;
this.labelVideoFileName.Location = new System.Drawing.Point(12, 211);
this.labelVideoFileName.Name = "labelVideoFileName";
this.labelVideoFileName.Size = new System.Drawing.Size(100, 13);
this.labelVideoFileName.TabIndex = 21;
this.labelVideoFileName.Text = "labelVideoFileName";
//
// buttonHalfASecondBack
//
this.buttonHalfASecondBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonHalfASecondBack.Location = new System.Drawing.Point(12, 526);
this.buttonHalfASecondBack.Name = "buttonHalfASecondBack";
this.buttonHalfASecondBack.Size = new System.Drawing.Size(77, 21);
this.buttonHalfASecondBack.TabIndex = 20;
this.buttonHalfASecondBack.Text = "&½ second <";
this.buttonHalfASecondBack.UseVisualStyleBackColor = true;
this.buttonHalfASecondBack.Click += new System.EventHandler(this.buttonStartHalfASecondBack_Click);
//
// buttonThreeSecondsBack
//
this.buttonThreeSecondsBack.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonThreeSecondsBack.Location = new System.Drawing.Point(95, 526);
this.buttonThreeSecondsBack.Name = "buttonThreeSecondsBack";
this.buttonThreeSecondsBack.Size = new System.Drawing.Size(77, 21);
this.buttonThreeSecondsBack.TabIndex = 21;
this.buttonThreeSecondsBack.Text = "&3 seconds <";
this.buttonThreeSecondsBack.UseVisualStyleBackColor = true;
this.buttonThreeSecondsBack.Click += new System.EventHandler(this.buttonStartThreeSecondsBack_Click);
//
// buttonThreeSecondsAhead
//
this.buttonThreeSecondsAhead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonThreeSecondsAhead.Location = new System.Drawing.Point(303, 526);
this.buttonThreeSecondsAhead.Name = "buttonThreeSecondsAhead";
this.buttonThreeSecondsAhead.Size = new System.Drawing.Size(77, 21);
this.buttonThreeSecondsAhead.TabIndex = 23;
this.buttonThreeSecondsAhead.Text = "3 seconds >";
this.buttonThreeSecondsAhead.UseVisualStyleBackColor = true;
this.buttonThreeSecondsAhead.Click += new System.EventHandler(this.buttonStartThreeSecondsAhead_Click);
//
// buttonHalfASecondAhead
//
this.buttonHalfASecondAhead.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonHalfASecondAhead.Location = new System.Drawing.Point(386, 526);
this.buttonHalfASecondAhead.Name = "buttonHalfASecondAhead";
this.buttonHalfASecondAhead.Size = new System.Drawing.Size(77, 21);
this.buttonHalfASecondAhead.TabIndex = 24;
this.buttonHalfASecondAhead.Text = "½ second >";
this.buttonHalfASecondAhead.UseVisualStyleBackColor = true;
this.buttonHalfASecondAhead.Click += new System.EventHandler(this.buttonStartHalfASecondAhead_Click);
//
// buttonVerify
//
this.buttonVerify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonVerify.Location = new System.Drawing.Point(178, 526);
this.buttonVerify.Name = "buttonVerify";
this.buttonVerify.Size = new System.Drawing.Size(119, 21);
this.buttonVerify.TabIndex = 22;
this.buttonVerify.Text = "Play 2 secs and back";
this.buttonVerify.UseVisualStyleBackColor = true;
this.buttonVerify.Click += new System.EventHandler(this.buttonStartVerify_Click);
//
// labelSubtitle
//
this.labelSubtitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.labelSubtitle.BackColor = System.Drawing.Color.Black;
this.labelSubtitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelSubtitle.ForeColor = System.Drawing.Color.White;
this.labelSubtitle.Location = new System.Drawing.Point(12, 492);
this.labelSubtitle.Name = "labelSubtitle";
this.labelSubtitle.Size = new System.Drawing.Size(728, 28);
this.labelSubtitle.TabIndex = 27;
this.labelSubtitle.Text = "labelSubtitle";
this.labelSubtitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// videoPlayerContainer1
//
this.videoPlayerContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.videoPlayerContainer1.BackColor = System.Drawing.Color.Black;
this.videoPlayerContainer1.CurrentPosition = 0D;
this.videoPlayerContainer1.Location = new System.Drawing.Point(12, 226);
this.videoPlayerContainer1.Name = "videoPlayerContainer1";
this.videoPlayerContainer1.ShowStopButton = true;
this.videoPlayerContainer1.Size = new System.Drawing.Size(728, 265);
this.videoPlayerContainer1.TabIndex = 13;
this.videoPlayerContainer1.VideoPlayer = null;
this.videoPlayerContainer1.Volume = 0D;
//
// SetSyncPoint
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(749, 568);
this.Controls.Add(this.labelSubtitle);
this.Controls.Add(this.buttonVerify);
this.Controls.Add(this.buttonHalfASecondBack);
this.Controls.Add(this.buttonThreeSecondsBack);
this.Controls.Add(this.buttonThreeSecondsAhead);
this.Controls.Add(this.buttonHalfASecondAhead);
this.Controls.Add(this.labelVideoFileName);
this.Controls.Add(this.buttonOpenMovie);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSetSyncPoint);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBoxSyncPointTimeCode);
this.Controls.Add(this.videoPlayerContainer1);
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(700, 600);
this.Name = "SetSyncPoint";
this.ShowIcon = false;
this.Text = "Set sync point";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GetTime_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GetTime_FormClosed);
this.Load += new System.EventHandler(this.GetTime_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GetTime_KeyDown);
this.groupBoxSyncPointTimeCode.ResumeLayout(false);
this.groupBoxSyncPointTimeCode.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Controls.VideoPlayerContainer videoPlayerContainer1;
private Controls.TimeUpDown timeUpDownLine;
private System.Windows.Forms.GroupBox groupBoxSyncPointTimeCode;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonSetSyncPoint;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button buttonOpenMovie;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label labelVideoFileName;
private System.Windows.Forms.Button buttonHalfASecondBack;
private System.Windows.Forms.Button buttonThreeSecondsBack;
private System.Windows.Forms.Button buttonThreeSecondsAhead;
private System.Windows.Forms.Button buttonHalfASecondAhead;
private System.Windows.Forms.Button buttonVerify;
private System.Windows.Forms.Label labelSubtitle;
private Controls.SubtitleListView subtitleListView1;
}
}

288
src/Forms/SetSyncPoint.cs Normal file
View File

@ -0,0 +1,288 @@
using System;
using System.IO;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.VideoPlayers;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class SetSyncPoint : Form
{
private double _lastPosition;
private TimeSpan _guess;
double _goBackPosition;
double _stopPosition = -1.0;
Subtitle _subtitle;
public string VideoFileName { get; private set; }
public SetSyncPoint()
{
InitializeComponent();
groupBoxSyncPointTimeCode.Text = Configuration.Settings.Language.SetSyncPoint.SyncPointTimeCode;
buttonThreeSecondsBack.Text = Configuration.Settings.Language.SetSyncPoint.ThreeSecondsBack;
buttonHalfASecondBack.Text = Configuration.Settings.Language.SetSyncPoint.HalfASecondBack;
buttonVerify.Text = string.Format(Configuration.Settings.Language.VisualSync.PlayXSecondsAndBack, Configuration.Settings.Tools.VerifyPlaySeconds);
buttonHalfASecondAhead.Text = Configuration.Settings.Language.SetSyncPoint.HalfASecondForward;
buttonThreeSecondsAhead.Text = Configuration.Settings.Language.SetSyncPoint.ThreeSecondsForward;
buttonOpenMovie.Text = Configuration.Settings.Language.General.OpenVideoFile;
buttonSetSyncPoint.Text = Configuration.Settings.Language.PointSync.SetSyncPoint;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
public TimeSpan SyncronizationPoint
{
get { return timeUpDownLine.TimeCode.TimeSpan; }
}
public void Initialize(Subtitle subtitle, string subtitleFileName, int index, string videoFileName)
{
_subtitle = subtitle;
subtitleListView1.Fill(subtitle);
_guess = subtitle.Paragraphs[index].StartTime.TimeSpan;
subtitleListView1.Items[index].Selected = true;
Text = string.Format(Configuration.Settings.Language.SetSyncPoint.Title, subtitle.Paragraphs[index].Number.ToString() + ": " + subtitle.Paragraphs[index].ToString());
labelSubtitle.Text = string.Empty;
labelVideoFileName.Text = Configuration.Settings.Language.General.NoVideoLoaded;
timeUpDownLine.TimeCode = subtitle.Paragraphs[index].StartTime;
if (!string.IsNullOrEmpty(videoFileName) && File.Exists(videoFileName))
OpenVideo(videoFileName);
else if (!string.IsNullOrEmpty(subtitleFileName))
TryToFindAndOpenVideoFile(Path.GetDirectoryName(subtitleFileName) + Path.DirectorySeparatorChar +
Path.GetFileNameWithoutExtension(subtitleFileName));
}
private void TryToFindAndOpenVideoFile(string fileNameNoExtension)
{
string movieFileName = null;
foreach (string extension in Utilities.GetMovieFileExtensions())
{
movieFileName = fileNameNoExtension + extension;
if (File.Exists(movieFileName))
break;
}
if (movieFileName != null && File.Exists(movieFileName))
{
OpenVideo(movieFileName);
}
else if (fileNameNoExtension.Contains("."))
{
fileNameNoExtension = fileNameNoExtension.Substring(0, fileNameNoExtension.LastIndexOf("."));
TryToFindAndOpenVideoFile(fileNameNoExtension);
}
}
private void buttonOpenMovie_Click(object sender, EventArgs e)
{
openFileDialog1.Title = Configuration.Settings.Language.General.OpenVideoFile;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = Utilities.GetVideoFileFilter();
openFileDialog1.FileName = string.Empty;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
openFileDialog1.InitialDirectory = Path.GetDirectoryName(openFileDialog1.FileName);
OpenVideo(openFileDialog1.FileName);
}
}
private void OpenVideo(string fileName)
{
if (File.Exists(fileName))
{
labelVideoFileName.Text = fileName;
VideoFileName = fileName;
if (videoPlayerContainer1.VideoPlayer != null)
{
videoPlayerContainer1.Pause();
videoPlayerContainer1.VideoPlayer.DisposeVideoPlayer();
}
VideoInfo videoInfo = Utilities.GetVideoInfo(fileName, delegate { Application.DoEvents(); });
Utilities.InitializeVideoPlayerAndContainer(fileName, videoInfo, videoPlayerContainer1, VideoStartLoaded, VideoStartEnded);
}
}
void VideoStartEnded(object sender, EventArgs e)
{
videoPlayerContainer1.Pause();
}
void VideoStartLoaded(object sender, EventArgs e)
{
timer1.Start();
videoPlayerContainer1.Pause();
if (_guess != null && _guess.TotalMilliseconds > 0 && _guess.TotalMilliseconds / 1000.0 < videoPlayerContainer1.VideoPlayer.Duration)
{
videoPlayerContainer1.VideoPlayer.CurrentPosition = _guess.TotalMilliseconds / 1000.0;
videoPlayerContainer1.RefreshProgressBar();
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (videoPlayerContainer1 != null)
{
double pos = 0;
if (_stopPosition >= 0 && videoPlayerContainer1.CurrentPosition > _stopPosition)
{
videoPlayerContainer1.Pause();
videoPlayerContainer1.CurrentPosition = _goBackPosition;
_stopPosition = -1;
}
if (!videoPlayerContainer1.IsPaused)
{
videoPlayerContainer1.RefreshProgressBar();
pos = videoPlayerContainer1.CurrentPosition;
}
else
{
pos = videoPlayerContainer1.CurrentPosition;
}
if (pos != _lastPosition)
{
Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, videoPlayerContainer1.VideoPlayer);
timeUpDownLine.TimeCode = new TimeCode(TimeSpan.FromSeconds(pos));
_lastPosition = pos;
}
}
}
private void buttonOK_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
private void GetTime_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
DialogResult = DialogResult.Cancel;
else if (e.KeyCode == Keys.F1)
Utilities.ShowHelp(string.Empty);
else if (e.KeyCode == Keys.S && e.Modifiers == Keys.Control)
{
videoPlayerContainer1.Pause();
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.P && e.Control)
{
videoPlayerContainer1.VideoPlayer.Pause();
e.SuppressKeyPress = true;
}
else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.Left)
{
GoBackSeconds(0.5, videoPlayerContainer1.VideoPlayer);
e.SuppressKeyPress = true;
}
else if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.Right)
{
GoBackSeconds(-0.5, videoPlayerContainer1.VideoPlayer);
e.SuppressKeyPress = true;
}
else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Left)
{
GoBackSeconds(0.1, videoPlayerContainer1.VideoPlayer);
e.SuppressKeyPress = true;
}
else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Right)
{
GoBackSeconds(-0.1, videoPlayerContainer1.VideoPlayer);
e.SuppressKeyPress = true;
}
}
private void GetTime_FormClosing(object sender, FormClosingEventArgs e)
{
timer1.Stop();
if (videoPlayerContainer1 != null)
videoPlayerContainer1.Pause();
}
private void GetTime_FormClosed(object sender, FormClosedEventArgs e)
{
if (videoPlayerContainer1.VideoPlayer != null) // && videoPlayerContainer1.VideoPlayer.GetType() == typeof(Nikse.SubtitleEdit.Logic.VideoPlayers.QuartsPlayer))
{
videoPlayerContainer1.VideoPlayer.DisposeVideoPlayer();
}
}
private void GoBackSeconds(double seconds, VideoPlayer mediaPlayer)
{
if (mediaPlayer != null)
{
if (mediaPlayer.CurrentPosition > seconds)
mediaPlayer.CurrentPosition -= seconds;
else
mediaPlayer.CurrentPosition = 0;
videoPlayerContainer1.RefreshProgressBar();
}
}
private void buttonStartHalfASecondBack_Click(object sender, EventArgs e)
{
GoBackSeconds(0.5, videoPlayerContainer1.VideoPlayer);
}
private void buttonStartThreeSecondsBack_Click(object sender, EventArgs e)
{
GoBackSeconds(3, videoPlayerContainer1.VideoPlayer);
}
private void buttonStartThreeSecondsAhead_Click(object sender, EventArgs e)
{
GoBackSeconds(-3.0, videoPlayerContainer1.VideoPlayer);
}
private void buttonStartHalfASecondAhead_Click(object sender, EventArgs e)
{
GoBackSeconds(-0.5, videoPlayerContainer1.VideoPlayer);
}
private void buttonStartVerify_Click(object sender, EventArgs e)
{
if (videoPlayerContainer1 != null && videoPlayerContainer1.VideoPlayer != null)
{
_goBackPosition = videoPlayerContainer1.CurrentPosition;
_stopPosition = _goBackPosition + Configuration.Settings.Tools.VerifyPlaySeconds;
videoPlayerContainer1.Play();
}
}
private void GetTime_Load(object sender, EventArgs e)
{
if (subtitleListView1.SelectedItems.Count == 1)
{
subtitleListView1.SelectIndexAndEnsureVisible(subtitleListView1.SelectedItems[0].Index);
}
}
private void subtitleListView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (subtitleListView1.SelectedItems.Count == 1)
{
int index = subtitleListView1.SelectedItems[0].Index;
videoPlayerContainer1.Pause();
videoPlayerContainer1.CurrentPosition = _subtitle.Paragraphs[index].StartTime.TotalMilliseconds / 1000.0;
}
}
}
}

126
src/Forms/SetSyncPoint.resx Normal file
View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>157, 17</value>
</metadata>
</root>

2114
src/Forms/Settings.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

1267
src/Forms/Settings.cs Normal file

File diff suppressed because it is too large Load Diff

126
src/Forms/Settings.resx Normal file
View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colorDialogSSAStyle.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="fontDialogSSAStyle.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
</root>

203
src/Forms/ShowEarlierLater.Designer.cs generated Normal file
View File

@ -0,0 +1,203 @@
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ShowEarlierLater
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.labelHoursMinSecsMilliSecs = new System.Windows.Forms.Label();
this.buttonShowLater = new System.Windows.Forms.Button();
this.buttonShowEarlier = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.labelTotalAdjustment = new System.Windows.Forms.Label();
this.labelSubtitle = new System.Windows.Forms.Label();
this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timeUpDownAdjust = new Nikse.SubtitleEdit.Controls.TimeUpDown();
this.SuspendLayout();
//
// labelHoursMinSecsMilliSecs
//
this.labelHoursMinSecsMilliSecs.AutoSize = true;
this.labelHoursMinSecsMilliSecs.Location = new System.Drawing.Point(11, 383);
this.labelHoursMinSecsMilliSecs.Name = "labelHoursMinSecsMilliSecs";
this.labelHoursMinSecsMilliSecs.Size = new System.Drawing.Size(107, 13);
this.labelHoursMinSecsMilliSecs.TabIndex = 18;
this.labelHoursMinSecsMilliSecs.Text = "Hours:min:sec.msecs";
//
// buttonShowLater
//
this.buttonShowLater.Location = new System.Drawing.Point(14, 456);
this.buttonShowLater.Name = "buttonShowLater";
this.buttonShowLater.Size = new System.Drawing.Size(119, 21);
this.buttonShowLater.TabIndex = 20;
this.buttonShowLater.Text = "Show later";
this.buttonShowLater.UseVisualStyleBackColor = true;
this.buttonShowLater.Click += new System.EventHandler(this.ButtonShowLaterClick);
//
// buttonShowEarlier
//
this.buttonShowEarlier.Location = new System.Drawing.Point(14, 429);
this.buttonShowEarlier.Name = "buttonShowEarlier";
this.buttonShowEarlier.Size = new System.Drawing.Size(120, 21);
this.buttonShowEarlier.TabIndex = 19;
this.buttonShowEarlier.Text = "Show earlier";
this.buttonShowEarlier.UseVisualStyleBackColor = true;
this.buttonShowEarlier.Click += new System.EventHandler(this.ButtonShowEarlierClick);
//
// 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(715, 630);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 37;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(634, 630);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 36;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// subtitleListView1
//
this.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(14, 13);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.Size = new System.Drawing.Size(776, 329);
this.subtitleListView1.TabIndex = 35;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.subtitleListView1_MouseDoubleClick);
//
// labelTotalAdjustment
//
this.labelTotalAdjustment.AutoSize = true;
this.labelTotalAdjustment.Location = new System.Drawing.Point(11, 348);
this.labelTotalAdjustment.Name = "labelTotalAdjustment";
this.labelTotalAdjustment.Size = new System.Drawing.Size(105, 13);
this.labelTotalAdjustment.TabIndex = 38;
this.labelTotalAdjustment.Text = "labelTotalAdjustment";
//
// labelSubtitle
//
this.labelSubtitle.BackColor = System.Drawing.Color.Black;
this.labelSubtitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelSubtitle.ForeColor = System.Drawing.Color.White;
this.labelSubtitle.Location = new System.Drawing.Point(387, 582);
this.labelSubtitle.Name = "labelSubtitle";
this.labelSubtitle.Size = new System.Drawing.Size(403, 28);
this.labelSubtitle.TabIndex = 39;
this.labelSubtitle.Text = "labelSubtitle";
this.labelSubtitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// mediaPlayer
//
this.mediaPlayer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.mediaPlayer.CurrentPosition = 0D;
this.mediaPlayer.Location = new System.Drawing.Point(387, 348);
this.mediaPlayer.Name = "mediaPlayer";
this.mediaPlayer.ShowStopButton = true;
this.mediaPlayer.Size = new System.Drawing.Size(403, 234);
this.mediaPlayer.TabIndex = 40;
this.mediaPlayer.VideoPlayer = null;
this.mediaPlayer.Volume = 0D;
//
// timer1
//
this.timer1.Interval = 250;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// timeUpDownAdjust
//
this.timeUpDownAdjust.AutoSize = true;
this.timeUpDownAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownAdjust.Location = new System.Drawing.Point(12, 399);
this.timeUpDownAdjust.Name = "timeUpDownAdjust";
this.timeUpDownAdjust.Size = new System.Drawing.Size(89, 24);
this.timeUpDownAdjust.TabIndex = 21;
//
// ShowEarlierLater
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(804, 663);
this.Controls.Add(this.labelSubtitle);
this.Controls.Add(this.mediaPlayer);
this.Controls.Add(this.labelTotalAdjustment);
this.Controls.Add(this.subtitleListView1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.timeUpDownAdjust);
this.Controls.Add(this.labelHoursMinSecsMilliSecs);
this.Controls.Add(this.buttonShowLater);
this.Controls.Add(this.buttonShowEarlier);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ShowEarlierLater";
this.Text = "Show selected lines earlier/later";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShowEarlierLater_FormClosing);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ShowEarlierLater_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private Nikse.SubtitleEdit.Controls.TimeUpDown timeUpDownAdjust;
private System.Windows.Forms.Label labelHoursMinSecsMilliSecs;
private System.Windows.Forms.Button buttonShowLater;
private System.Windows.Forms.Button buttonShowEarlier;
private SubtitleListView subtitleListView1;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Label labelTotalAdjustment;
private System.Windows.Forms.Label labelSubtitle;
private VideoPlayerContainer mediaPlayer;
private System.Windows.Forms.Timer timer1;
}
}

View File

@ -0,0 +1,205 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.IO;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class ShowEarlierLater : Form
{
Subtitle _subtitle;
TimeSpan _totalAdjustment = TimeSpan.FromMilliseconds(0);
VideoInfo _videoInfo;
public List<Paragraph> Paragraphs
{
get
{
return _subtitle.Paragraphs;
}
}
public string VideoFileName { get; set; }
public ShowEarlierLater()
{
InitializeComponent();
labelTotalAdjustment.Text = string.Empty;
timeUpDownAdjust.MaskedTextBox.Text = "000000000";
labelSubtitle.Text = string.Empty;
Text = Configuration.Settings.Language.ShowEarlierLater.Title;
labelHoursMinSecsMilliSecs.Text = Configuration.Settings.Language.General.HourMinutesSecondsMilliseconds;
buttonShowEarlier.Text = Configuration.Settings.Language.ShowEarlierLater.ShowEarlier;
buttonShowLater.Text = Configuration.Settings.Language.ShowEarlierLater.ShowLater;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
}
private void ShowEarlierLater_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
else if (e.KeyCode == Keys.Right && e.Modifiers == Keys.Control)
{
mediaPlayer.CurrentPosition += 0.10;
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Left && e.Modifiers == Keys.Control)
{
mediaPlayer.CurrentPosition -= 0.10;
e.SuppressKeyPress = true;
}
else if (e.KeyCode == Keys.Right && e.Modifiers == Keys.Alt)
{
if (mediaPlayer.VideoPlayer != null)
{
mediaPlayer.CurrentPosition += 0.5;
e.SuppressKeyPress = true;
}
}
else if (e.KeyCode == Keys.Left && e.Modifiers == Keys.Alt)
{
if (mediaPlayer.VideoPlayer != null)
{
mediaPlayer.CurrentPosition -= 0.5;
e.SuppressKeyPress = true;
}
}
else if (e.Modifiers == Keys.None && e.KeyCode == Keys.Space)
{
mediaPlayer.TooglePlayPause();
e.SuppressKeyPress = true;
}
}
internal void Initialize(Subtitle subtitle, string videoFileName)
{
_subtitle = subtitle;
subtitleListView1.Fill(subtitle);
timeUpDownAdjust.TimeCode = new TimeCode(TimeSpan.FromMilliseconds(Configuration.Settings.General.DefaultAdjustMilliseconds));
VideoFileName = videoFileName;
OpenVideo(videoFileName);
}
private void OpenVideo(string fileName)
{
if (File.Exists(fileName))
{
FileInfo fi = new FileInfo(fileName);
if (fi.Length < 1000)
return;
VideoFileName = fileName;
if (mediaPlayer.VideoPlayer != null)
{
mediaPlayer.Pause();
mediaPlayer.VideoPlayer.DisposeVideoPlayer();
}
VideoInfo videoInfo = ShowVideoInfo(fileName);
Utilities.InitializeVideoPlayerAndContainer(fileName, videoInfo, mediaPlayer, VideoLoaded, VideoEnded);
}
else
{
Height = buttonShowLater.Top + buttonShowLater.Height + 40;
mediaPlayer.Visible = false;
labelSubtitle.Visible = false;
}
}
private VideoInfo ShowVideoInfo(string fileName)
{
_videoInfo = Utilities.GetVideoInfo(fileName, delegate { Application.DoEvents(); });
var info = new FileInfo(fileName);
long fileSizeInBytes = info.Length;
return _videoInfo;
}
void VideoLoaded(object sender, EventArgs e)
{
mediaPlayer.Stop();
timer1.Start();
}
void VideoEnded(object sender, EventArgs e)
{
mediaPlayer.Pause();
}
private void ButtonShowEarlierClick(object sender, EventArgs e)
{
TimeCode tc = timeUpDownAdjust.TimeCode;
if (tc != null && tc.TotalMilliseconds > 0)
{
_totalAdjustment = TimeSpan.FromMilliseconds(_totalAdjustment.TotalMilliseconds - tc.TotalMilliseconds);
ShowTotalAdjustMent();
_subtitle.AddTimeToAllParagraphs(-tc.TimeSpan);
subtitleListView1.Fill(_subtitle);
}
}
private void ShowTotalAdjustMent()
{
TimeCode tc = new TimeCode(_totalAdjustment);
labelTotalAdjustment.Text = string.Format(Configuration.Settings.Language.ShowEarlierLater.TotalAdjustmentX, tc.ToShortString());
}
private void ButtonShowLaterClick(object sender, EventArgs e)
{
TimeCode tc = timeUpDownAdjust.TimeCode;
if (tc != null && tc.TotalMilliseconds > 0)
{
_totalAdjustment = TimeSpan.FromMilliseconds(_totalAdjustment.TotalMilliseconds + tc.TotalMilliseconds);
ShowTotalAdjustMent();
_subtitle.AddTimeToAllParagraphs(tc.TimeSpan);
subtitleListView1.Fill(_subtitle);
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (mediaPlayer != null && mediaPlayer.VideoPlayer != null)
{
if (!mediaPlayer.IsPaused)
{
mediaPlayer.RefreshProgressBar();
int index = Utilities.ShowSubtitle(_subtitle.Paragraphs, labelSubtitle, mediaPlayer.VideoPlayer);
}
}
}
private void subtitleListView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (subtitleListView1.SelectedItems.Count > 0 && VideoFileName != null)
{
int index = subtitleListView1.SelectedItems[0].Index;
mediaPlayer.Pause();
double pos = _subtitle.Paragraphs[index].StartTime.TotalSeconds;
if (pos > 1)
mediaPlayer.CurrentPosition = (_subtitle.Paragraphs[index].StartTime.TotalSeconds) - 0.5;
else
mediaPlayer.CurrentPosition = _subtitle.Paragraphs[index].StartTime.TotalSeconds;
mediaPlayer.Play();
}
}
private void ShowEarlierLater_FormClosing(object sender, FormClosingEventArgs e)
{
if (mediaPlayer.VideoPlayer != null)
{
mediaPlayer.VideoPlayer.Pause();
mediaPlayer.VideoPlayer.DisposeVideoPlayer();
}
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

155
src/Forms/ShowHistory.Designer.cs generated Normal file
View File

@ -0,0 +1,155 @@
namespace Nikse.SubtitleEdit.Forms
{
sealed partial class ShowHistory
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.listViewHistory = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.buttonRollback = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.buttonCompare = new System.Windows.Forms.Button();
this.buttonCompareHistory = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// listViewHistory
//
this.listViewHistory.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.listViewHistory.FullRowSelect = true;
this.listViewHistory.HideSelection = false;
this.listViewHistory.Location = new System.Drawing.Point(12, 37);
this.listViewHistory.Name = "listViewHistory";
this.listViewHistory.Size = new System.Drawing.Size(472, 327);
this.listViewHistory.TabIndex = 0;
this.listViewHistory.UseCompatibleStateImageBehavior = false;
this.listViewHistory.View = System.Windows.Forms.View.Details;
this.listViewHistory.SelectedIndexChanged += new System.EventHandler(this.ListViewHistorySelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "Time";
this.columnHeader1.Width = 80;
//
// columnHeader2
//
this.columnHeader2.Text = "Description";
this.columnHeader2.Width = 365;
//
// buttonRollback
//
this.buttonRollback.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonRollback.Location = new System.Drawing.Point(490, 343);
this.buttonRollback.Name = "buttonRollback";
this.buttonRollback.Size = new System.Drawing.Size(98, 21);
this.buttonRollback.TabIndex = 6;
this.buttonRollback.Text = "&Rollback";
this.buttonRollback.UseVisualStyleBackColor = true;
this.buttonRollback.Click += new System.EventHandler(this.ButtonOkClick);
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(594, 343);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 8;
this.buttonCancel.Text = "C&ancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(170, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Select time/description for rollback";
//
// buttonCompare
//
this.buttonCompare.Enabled = false;
this.buttonCompare.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCompare.Location = new System.Drawing.Point(490, 198);
this.buttonCompare.Name = "buttonCompare";
this.buttonCompare.Size = new System.Drawing.Size(179, 21);
this.buttonCompare.TabIndex = 4;
this.buttonCompare.Text = "&Compare with current";
this.buttonCompare.UseVisualStyleBackColor = true;
this.buttonCompare.Click += new System.EventHandler(this.ButtonCompareClick);
//
// buttonCompareHistory
//
this.buttonCompareHistory.Enabled = false;
this.buttonCompareHistory.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCompareHistory.Location = new System.Drawing.Point(490, 171);
this.buttonCompareHistory.Name = "buttonCompareHistory";
this.buttonCompareHistory.Size = new System.Drawing.Size(179, 21);
this.buttonCompareHistory.TabIndex = 2;
this.buttonCompareHistory.Text = "&Compare history items";
this.buttonCompareHistory.UseVisualStyleBackColor = true;
this.buttonCompareHistory.Click += new System.EventHandler(this.ButtonCompareHistoryClick);
//
// ShowHistory
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(680, 373);
this.Controls.Add(this.buttonCompareHistory);
this.Controls.Add(this.buttonCompare);
this.Controls.Add(this.label1);
this.Controls.Add(this.buttonRollback);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.listViewHistory);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ShowHistory";
this.Text = "History (for undo)";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormShowHistory_KeyDown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListView listViewHistory;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.Button buttonRollback;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button buttonCompare;
private System.Windows.Forms.Button buttonCompareHistory;
}
}

Some files were not shown because too many files have changed in this diff Show More