Working on roaming profile for installer version

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@84 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2010-10-26 16:20:07 +00:00
parent a80476f9fc
commit ecd634a540
11 changed files with 234 additions and 126 deletions

View File

@ -1574,7 +1574,7 @@
this.fixCommonErrorsInSelectedLinesToolStripMenuItem, this.fixCommonErrorsInSelectedLinesToolStripMenuItem,
this.changeCasingForSelectedLinesToolStripMenuItem}); this.changeCasingForSelectedLinesToolStripMenuItem});
this.contextMenuStripListview.Name = "contextMenuStripListview"; this.contextMenuStripListview.Name = "contextMenuStripListview";
this.contextMenuStripListview.Size = new System.Drawing.Size(276, 562); this.contextMenuStripListview.Size = new System.Drawing.Size(276, 540);
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening); this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
// //
// toolStripMenuItemDelete // toolStripMenuItemDelete

View File

@ -85,7 +85,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0") if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2]; _title += "." + versionInfo[2];
} }
_title = "Subtitle Edit 3.0 RC3"; _title = "Subtitle Edit 3.0 RC4";
return _title; return _title;
} }
} }
@ -5988,7 +5988,7 @@ namespace Nikse.SubtitleEdit.Forms
private string GetPeakWaveFileName(string videoFileName) private string GetPeakWaveFileName(string videoFileName)
{ {
string dir = Configuration.BaseDirectory + "WaveForms"; string dir = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (!Directory.Exists(dir)) if (!Directory.Exists(dir))
Directory.CreateDirectory(dir); Directory.CreateDirectory(dir);

View File

@ -127,28 +127,28 @@
<data name="toolStripButtonFileNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButtonFileNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAATQSURBVFhH7ZfbT1xVFMax+qQv6l9h0sQHffNFHwxNpTNi YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAATPSURBVFhH7ZfbT1xVFMax+qQv6l9h0sQHffNFHwxNpTNi
MRQpNLFFWiOUWhWrrYnRGojG2sZ6aYhcBhmhIDCA1EyHASTtEApJSbGJGu73y3Cd4Tbg5/52usY9p3Ow MRQpNLFFWiOUWnWstiaiNSEaaxvrpSFyGWSEgsAAUjMdBpC0QygkJcUmarjfB4b7cMfP/e10jXtO52Cb
TXzwwUm+7H3WOWt9v7X3DueQkPD/77+0At3d3U/09PQsBwIBtLS0aPn9frS2tkbHtrY2UO3t7TGSuPks +OCDk3zZ+6xz1vp+a+8dziEh4f/ff2kFurq6nuju7l4MBoNobm7WCgQCaGlpiY6tra2g2traYiRx81nm
c6UOa7I2PWx75gN9fX1bm5ubWF1d1VpbW8P6+jo2NjbAOMdIJIKtrS1sb29rcc6Y+QxzmCt1mMva9LAF Sh3WZG162PbMB3p7e7c2NjawsrKitbq6irW1Nayvr4Nxjpubm9ja2sL29rYW54yZzzCHuVKHuaxND1uA
6Ojo0CahUAjhcDgugNXcCiGQJgBrsSbv0cMWoLm5GSsrK/phGXcCIYxoJ2OzJj1sAZqamrC8vKzFJDtz 9vZ2bbK8vIxIJBIXwGpuhRBIE4C1WJP36GEL0NTUhKWlJf2wjDuBEEa0k7FZkx62AI2NjVhcXNRikp25
cxv+aflZg7WkLj1sARobG7G0tKQVD4L7KeeBI7umzJicG46mudSlhy1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ko5Upkb3mfNsFTtUmIzj57OgrJ+OB7A7MTHxI/5n
s/H5fOCHQ21t7T3rhrcXAW8Pcj/LRurHTqSVJSO9/GUtzlPPOnHi26NIOey8xNW2AugzoPSk0h6l/Xf0 4/f7wQ+Hmpqae9YNXw+Cvm7kfpaN1I+dSCtNRnrZy1qcp5514sS3R5Fy2HmJq20F0GdA6UmlPUr77+gl
khqT71P7He87fI6Tz4ZfOLUX1L68pDXnaWebqrP3jge9Ys4A92KX0kNKjyg9pvT4vyzWZG160Ev//gLs NSbfp/Y73nf4HSefjbxwai+ofXlJq87TzlZVZ+8dD3rFnAHuxS6lh5QeUXpM6fF/WazJ2vSgl/79Bcly
dsxzExmB6QAAAABJRU5ErkJggg== zGGo76FSAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="toolStripButtonFileOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButtonFileOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -291,47 +291,47 @@
<data name="toolStripButtonReplace.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="toolStripButtonReplace.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAlySURBVFhH1VcJVJNXGo2j1h0VSNh0gqAIAQRkkU2CiAhC YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAlySURBVFhH1VcJVJNXGo1TrTsqkLDpBEERAgjIIpsEERGE
RCEYICGEhGAEAQG1imjAQi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7 +360,7 @@ namespace Nikse.SubtitleEdit.Forms
private void InitializeWaveFormsFolderEmpty(LanguageStructure.Settings language) private void InitializeWaveFormsFolderEmpty(LanguageStructure.Settings language)
{ {
string waveFormsFolder = Path.Combine(Configuration.BaseDirectory, "WaveForms"); string waveFormsFolder = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (Directory.Exists(waveFormsFolder)) if (Directory.Exists(waveFormsFolder))
{ {
long bytes = 0; long bytes = 0;
@ -1244,7 +1244,7 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonWaveFormsFolderEmpty_Click(object sender, EventArgs e) private void buttonWaveFormsFolderEmpty_Click(object sender, EventArgs e)
{ {
string waveFormsFolder = Path.Combine(Configuration.BaseDirectory, "WaveForms"); string waveFormsFolder = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (Directory.Exists(waveFormsFolder)) if (Directory.Exists(waveFormsFolder))
{ {
DirectoryInfo di = new DirectoryInfo(waveFormsFolder); DirectoryInfo di = new DirectoryInfo(waveFormsFolder);

View File

@ -27,7 +27,7 @@ namespace Nikse.SubtitleEdit.Forms
InitializeComponent(); InitializeComponent();
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize; pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
_directoryPath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + databaseFolderName + Path.DirectorySeparatorChar; _directoryPath = Configuration.VobSubCompareFolder + databaseFolderName + Path.DirectorySeparatorChar;
if (!File.Exists(_directoryPath + "CompareDescription.xml")) if (!File.Exists(_directoryPath + "CompareDescription.xml"))
_compareDoc.LoadXml("<OcrBitmaps></OcrBitmaps>"); _compareDoc.LoadXml("<OcrBitmaps></OcrBitmaps>");
else else

View File

@ -259,7 +259,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxUseModiInTesseractForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxUseModiInTesseractForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxUseModiInTesseractForUnknownWords.Location = new System.Drawing.Point(22, 74); this.checkBoxUseModiInTesseractForUnknownWords.Location = new System.Drawing.Point(22, 74);
this.checkBoxUseModiInTesseractForUnknownWords.Name = "checkBoxUseModiInTesseractForUnknownWords"; this.checkBoxUseModiInTesseractForUnknownWords.Name = "checkBoxUseModiInTesseractForUnknownWords";
this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(167, 17); this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(165, 17);
this.checkBoxUseModiInTesseractForUnknownWords.TabIndex = 39; this.checkBoxUseModiInTesseractForUnknownWords.TabIndex = 39;
this.checkBoxUseModiInTesseractForUnknownWords.Text = "Try MODI for unknown words"; this.checkBoxUseModiInTesseractForUnknownWords.Text = "Try MODI for unknown words";
this.checkBoxUseModiInTesseractForUnknownWords.UseVisualStyleBackColor = true; this.checkBoxUseModiInTesseractForUnknownWords.UseVisualStyleBackColor = true;
@ -334,7 +334,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxRightToLeft.AutoSize = true; this.checkBoxRightToLeft.AutoSize = true;
this.checkBoxRightToLeft.Location = new System.Drawing.Point(128, 112); this.checkBoxRightToLeft.Location = new System.Drawing.Point(128, 112);
this.checkBoxRightToLeft.Name = "checkBoxRightToLeft"; this.checkBoxRightToLeft.Name = "checkBoxRightToLeft";
this.checkBoxRightToLeft.Size = new System.Drawing.Size(83, 17); this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17);
this.checkBoxRightToLeft.TabIndex = 40; this.checkBoxRightToLeft.TabIndex = 40;
this.checkBoxRightToLeft.Text = "Right to left"; this.checkBoxRightToLeft.Text = "Right to left";
this.checkBoxRightToLeft.UseVisualStyleBackColor = true; this.checkBoxRightToLeft.UseVisualStyleBackColor = true;
@ -514,7 +514,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxGuessUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxGuessUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxGuessUnknownWords.Location = new System.Drawing.Point(11, 83); this.checkBoxGuessUnknownWords.Location = new System.Drawing.Point(11, 83);
this.checkBoxGuessUnknownWords.Name = "checkBoxGuessUnknownWords"; this.checkBoxGuessUnknownWords.Name = "checkBoxGuessUnknownWords";
this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(164, 17); this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(162, 17);
this.checkBoxGuessUnknownWords.TabIndex = 39; this.checkBoxGuessUnknownWords.TabIndex = 39;
this.checkBoxGuessUnknownWords.Text = "Try to guess unknown words"; this.checkBoxGuessUnknownWords.Text = "Try to guess unknown words";
this.checkBoxGuessUnknownWords.UseVisualStyleBackColor = true; this.checkBoxGuessUnknownWords.UseVisualStyleBackColor = true;
@ -620,7 +620,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPromptForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxPromptForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxPromptForUnknownWords.Location = new System.Drawing.Point(11, 61); this.checkBoxPromptForUnknownWords.Location = new System.Drawing.Point(11, 61);
this.checkBoxPromptForUnknownWords.Name = "checkBoxPromptForUnknownWords"; this.checkBoxPromptForUnknownWords.Name = "checkBoxPromptForUnknownWords";
this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(255, 17); this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(246, 17);
this.checkBoxPromptForUnknownWords.TabIndex = 38; this.checkBoxPromptForUnknownWords.TabIndex = 38;
this.checkBoxPromptForUnknownWords.Text = "Prompt for unknown words (requires dictionary)"; this.checkBoxPromptForUnknownWords.Text = "Prompt for unknown words (requires dictionary)";
this.checkBoxPromptForUnknownWords.UseVisualStyleBackColor = true; this.checkBoxPromptForUnknownWords.UseVisualStyleBackColor = true;
@ -632,7 +632,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoBreakLines.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxAutoBreakLines.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoBreakLines.Location = new System.Drawing.Point(11, 105); this.checkBoxAutoBreakLines.Location = new System.Drawing.Point(11, 105);
this.checkBoxAutoBreakLines.Name = "checkBoxAutoBreakLines"; this.checkBoxAutoBreakLines.Name = "checkBoxAutoBreakLines";
this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(208, 17); this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(200, 17);
this.checkBoxAutoBreakLines.TabIndex = 37; this.checkBoxAutoBreakLines.TabIndex = 37;
this.checkBoxAutoBreakLines.Text = "Auto break subtitle, if line number > 2"; this.checkBoxAutoBreakLines.Text = "Auto break subtitle, if line number > 2";
this.checkBoxAutoBreakLines.UseVisualStyleBackColor = true; this.checkBoxAutoBreakLines.UseVisualStyleBackColor = true;
@ -653,7 +653,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoFixCommonErrors.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBoxAutoFixCommonErrors.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoFixCommonErrors.Location = new System.Drawing.Point(11, 39); this.checkBoxAutoFixCommonErrors.Location = new System.Drawing.Point(11, 39);
this.checkBoxAutoFixCommonErrors.Name = "checkBoxAutoFixCommonErrors"; this.checkBoxAutoFixCommonErrors.Name = "checkBoxAutoFixCommonErrors";
this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(139, 17); this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(137, 17);
this.checkBoxAutoFixCommonErrors.TabIndex = 34; this.checkBoxAutoFixCommonErrors.TabIndex = 34;
this.checkBoxAutoFixCommonErrors.Text = "Fix common OCR errors"; this.checkBoxAutoFixCommonErrors.Text = "Fix common OCR errors";
this.checkBoxAutoFixCommonErrors.UseVisualStyleBackColor = true; this.checkBoxAutoFixCommonErrors.UseVisualStyleBackColor = true;
@ -679,7 +679,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis2Transparent.AutoSize = true; this.checkBoxEmphasis2Transparent.AutoSize = true;
this.checkBoxEmphasis2Transparent.Location = new System.Drawing.Point(437, 19); this.checkBoxEmphasis2Transparent.Location = new System.Drawing.Point(437, 19);
this.checkBoxEmphasis2Transparent.Name = "checkBoxEmphasis2Transparent"; this.checkBoxEmphasis2Transparent.Name = "checkBoxEmphasis2Transparent";
this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(85, 17); this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis2Transparent.TabIndex = 6; this.checkBoxEmphasis2Transparent.TabIndex = 6;
this.checkBoxEmphasis2Transparent.Text = "Transparent"; this.checkBoxEmphasis2Transparent.Text = "Transparent";
this.checkBoxEmphasis2Transparent.UseVisualStyleBackColor = true; this.checkBoxEmphasis2Transparent.UseVisualStyleBackColor = true;
@ -690,7 +690,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis1Transparent.AutoSize = true; this.checkBoxEmphasis1Transparent.AutoSize = true;
this.checkBoxEmphasis1Transparent.Location = new System.Drawing.Point(304, 19); this.checkBoxEmphasis1Transparent.Location = new System.Drawing.Point(304, 19);
this.checkBoxEmphasis1Transparent.Name = "checkBoxEmphasis1Transparent"; this.checkBoxEmphasis1Transparent.Name = "checkBoxEmphasis1Transparent";
this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(85, 17); this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis1Transparent.TabIndex = 5; this.checkBoxEmphasis1Transparent.TabIndex = 5;
this.checkBoxEmphasis1Transparent.Text = "Transparent"; this.checkBoxEmphasis1Transparent.Text = "Transparent";
this.checkBoxEmphasis1Transparent.UseVisualStyleBackColor = true; this.checkBoxEmphasis1Transparent.UseVisualStyleBackColor = true;
@ -701,7 +701,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPatternTransparent.AutoSize = true; this.checkBoxPatternTransparent.AutoSize = true;
this.checkBoxPatternTransparent.Location = new System.Drawing.Point(167, 19); this.checkBoxPatternTransparent.Location = new System.Drawing.Point(167, 19);
this.checkBoxPatternTransparent.Name = "checkBoxPatternTransparent"; this.checkBoxPatternTransparent.Name = "checkBoxPatternTransparent";
this.checkBoxPatternTransparent.Size = new System.Drawing.Size(85, 17); this.checkBoxPatternTransparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxPatternTransparent.TabIndex = 4; this.checkBoxPatternTransparent.TabIndex = 4;
this.checkBoxPatternTransparent.Text = "Transparent"; this.checkBoxPatternTransparent.Text = "Transparent";
this.checkBoxPatternTransparent.UseVisualStyleBackColor = true; this.checkBoxPatternTransparent.UseVisualStyleBackColor = true;

View File

@ -10,6 +10,7 @@ using System.Xml;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.OCR; using Nikse.SubtitleEdit.Logic.OCR;
using Nikse.SubtitleEdit.Logic.VobSub; using Nikse.SubtitleEdit.Logic.VobSub;
using System.Diagnostics;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {
@ -83,8 +84,9 @@ namespace Nikse.SubtitleEdit.Forms
// Tesseract OCR // Tesseract OCR
//tessnet2.Tesseract _tesseractOcrEngine; //tessnet2.Tesseract _tesseractOcrEngine;
object _tesseractOcrEngine; // object _tesseractOcrEngine;
string _lastLine; string _lastLine;
string _languageId;
// Dictionaries/spellchecking/fixing // Dictionaries/spellchecking/fixing
OcrFixEngine _ocrFixEngine; OcrFixEngine _ocrFixEngine;
@ -111,6 +113,11 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Text = Configuration.Settings.Language.General.OK; buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel; buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings); subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
subtitleListView1.Columns[0].Width = 45;
subtitleListView1.Columns[1].Width = 90;
subtitleListView1.Columns[2].Width = 90;
subtitleListView1.Columns[3].Width = 70;
subtitleListView1.Columns[4].Width = 150;
groupBoxImagePalette.Text = language.ImagePalette; groupBoxImagePalette.Text = language.ImagePalette;
checkBoxCustomFourColors.Text = language.UseCustomColors; checkBoxCustomFourColors.Text = language.UseCustomColors;
@ -218,7 +225,7 @@ namespace Nikse.SubtitleEdit.Forms
{ {
try try
{ {
string characterDatabasePath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub"; string characterDatabasePath = Configuration.VobSubCompareFolder.TrimEnd(Path.DirectorySeparatorChar);
if (!Directory.Exists(characterDatabasePath)) if (!Directory.Exists(characterDatabasePath))
Directory.CreateDirectory(characterDatabasePath); Directory.CreateDirectory(characterDatabasePath);
@ -251,7 +258,7 @@ namespace Nikse.SubtitleEdit.Forms
private void LoadImageCompareBitmaps() private void LoadImageCompareBitmaps()
{ {
_compareBitmaps = new List<CompareItem>(); _compareBitmaps = new List<CompareItem>();
string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar; string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
if (!File.Exists(path + "CompareDescription.xml")) if (!File.Exists(path + "CompareDescription.xml"))
_compareDoc.LoadXml("<OcrBitmaps></OcrBitmaps>"); _compareDoc.LoadXml("<OcrBitmaps></OcrBitmaps>");
else else
@ -491,7 +498,7 @@ namespace Nikse.SubtitleEdit.Forms
private void SaveCompareItem(Bitmap newTarget, string text, bool isItalic, int expandCount) private void SaveCompareItem(Bitmap newTarget, string text, bool isItalic, int expandCount)
{ {
string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar; string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
string name = Guid.NewGuid().ToString(); string name = Guid.NewGuid().ToString();
string fileName = path + name + ".bmp"; string fileName = path + name + ".bmp";
newTarget.Save(fileName); newTarget.Save(fileName);
@ -941,17 +948,38 @@ namespace Nikse.SubtitleEdit.Forms
// } // }
//} //}
private string Tesseract3DoOcrViaExe(Bitmap bmp, string language)
{
string tempTiffFileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".tiff";
bmp.Save(tempTiffFileName, System.Drawing.Imaging.ImageFormat.Tiff);
string tempTextFileName = Path.GetTempPath() + Guid.NewGuid().ToString();
Process process = new Process();
process.StartInfo = new ProcessStartInfo(Configuration.BaseDirectory + "Tesseract" + Path.DirectorySeparatorChar + "tesseract.exe");
process.StartInfo.Arguments = "\"" + tempTiffFileName + "\" \"" + tempTextFileName + "\" -l " + language;
process.StartInfo.WorkingDirectory = (Configuration.BaseDirectory + "Tesseract");
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit(2000);
string s = File.ReadAllText(tempTextFileName + ".txt");
try
{
File.Delete(tempTiffFileName);
File.Delete(tempTextFileName + ".txt");
}
catch
{
}
return s;
}
private string OcrViaTessnet(Bitmap bitmap, int index) private string OcrViaTessnet(Bitmap bitmap, int index)
{ {
if (_tesseractOcrEngine == null || _ocrFixEngine == null) if (_ocrFixEngine == null)
{ {
Cursor = Cursors.WaitCursor; _languageId = (comboBoxTesseractLanguages.SelectedItem as TesseractLanguage).Id;
_tesseractOcrEngine = new tessnet2.Tesseract(); _ocrFixEngine = new OcrFixEngine(_languageId, this);
string languageId = (comboBoxTesseractLanguages.SelectedItem as TesseractLanguage).Id;
(_tesseractOcrEngine as tessnet2.Tesseract).Init(Configuration.BaseDirectory + "tessdata", languageId, false); // _tesseractOcrEngine.Init("tessdata", "eng", false);
_ocrFixEngine = new OcrFixEngine(languageId, this);
if (_ocrFixEngine.IsDictionaryLoaded) if (_ocrFixEngine.IsDictionaryLoaded)
labelDictionaryLoaded.Text = string.Format(Configuration.Settings.Language.VobSubOcr.DictionaryX, _ocrFixEngine.DictionaryCulture.NativeName); labelDictionaryLoaded.Text = string.Format(Configuration.Settings.Language.VobSubOcr.DictionaryX, _ocrFixEngine.DictionaryCulture.NativeName);
else else
@ -964,37 +992,19 @@ namespace Nikse.SubtitleEdit.Forms
foreach (var modiLanguage in comboBoxModiLanguage.Items) foreach (var modiLanguage in comboBoxModiLanguage.Items)
{ {
if ((modiLanguage as ModiLanguage).Text == tesseractLanguageText) if ((modiLanguage as ModiLanguage).Text == tesseractLanguageText)
{
comboBoxModiLanguage.SelectedIndex = i; comboBoxModiLanguage.SelectedIndex = i;
}
i++; i++;
} }
} }
Cursor = Cursors.Default;
} }
// OCR bitmaps (splitted into lines)
var sb = new StringBuilder(); var sb = new StringBuilder();
var result = new List<tessnet2.Word>();
int badWords = 0; int badWords = 0;
var textWithOutFixes = new StringBuilder(); var textWithOutFixes = new StringBuilder();
textWithOutFixes.Append(Tesseract3DoOcrViaExe(bitmap, _languageId));
sb.Append(textWithOutFixes.ToString());
int numberOfWords = sb.ToString().Split((" " + Environment.NewLine).ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;
foreach (ImageSplitterItem splitImage in ImageSplitter.SplitVertical(bitmap))
{
result = (_tesseractOcrEngine as tessnet2.Tesseract).DoOCR(splitImage.Bitmap, Rectangle.Empty);
foreach (var s in result)
{
sb.Append(s.Text + " ");
textWithOutFixes.Append(s.Text + " ");
if (s.Confidence > 160)
badWords++;
if (s.Confidence > 200)
badWords++;
}
sb.AppendLine();
textWithOutFixes.AppendLine();
splitImage.Bitmap.Dispose();
}
string line = sb.ToString().Trim(); string line = sb.ToString().Trim();
if (_ocrFixEngine.IsDictionaryLoaded) if (_ocrFixEngine.IsDictionaryLoaded)
{ {
@ -1002,7 +1012,7 @@ namespace Nikse.SubtitleEdit.Forms
line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked); line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked);
int wordsNotFound = _ocrFixEngine.CountUnknownWordsViaDictionary(line); int wordsNotFound = _ocrFixEngine.CountUnknownWordsViaDictionary(line);
if (wordsNotFound > 0) if (wordsNotFound > 0 || sb.ToString().Replace("~", string.Empty).Trim().Length == 0)
{ {
_ocrFixEngine.AutoGuessesUsed.Clear(); _ocrFixEngine.AutoGuessesUsed.Clear();
_ocrFixEngine.UnknownWordsFound.Clear(); _ocrFixEngine.UnknownWordsFound.Clear();
@ -1073,9 +1083,9 @@ namespace Nikse.SubtitleEdit.Forms
if (checkBoxAutoFixCommonErrors.Checked) if (checkBoxAutoFixCommonErrors.Checked)
line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked); line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked);
if (badWords >= result.Count) if (badWords >= numberOfWords) //result.Count)
subtitleListView1.SetBackgroundColor(index, Color.Red); subtitleListView1.SetBackgroundColor(index, Color.Red);
else if (badWords >= result.Count / 2) else if (badWords >= numberOfWords / 2) // result.Count / 2)
subtitleListView1.SetBackgroundColor(index, Color.Orange); subtitleListView1.SetBackgroundColor(index, Color.Orange);
else if (badWords > 0) else if (badWords > 0)
subtitleListView1.SetBackgroundColor(index, Color.Yellow); subtitleListView1.SetBackgroundColor(index, Color.Yellow);
@ -1211,15 +1221,15 @@ namespace Nikse.SubtitleEdit.Forms
private void InitializeTesseract() private void InitializeTesseract()
{ {
string dir = Configuration.BaseDirectory + "tessdata"; string dir = Configuration.BaseDirectory + "Tesseract\\tessdata";
if (Directory.Exists(dir)) if (Directory.Exists(dir))
{ {
var list = new List<string>(); var list = new List<string>();
comboBoxTesseractLanguages.Items.Clear(); comboBoxTesseractLanguages.Items.Clear();
foreach (var culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures)) foreach (var culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures))
{ {
if (!list.Contains(culture.ThreeLetterISOLanguageName) && string trainDataFileName = dir + "\\" + culture.ThreeLetterISOLanguageName + ".traineddata";
Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + ".inttemp").Length > 0) if (!list.Contains(culture.ThreeLetterISOLanguageName) && File.Exists(trainDataFileName))
{ {
list.Add(culture.ThreeLetterISOLanguageName); list.Add(culture.ThreeLetterISOLanguageName);
comboBoxTesseractLanguages.Items.Add(new TesseractLanguage { Id = culture.ThreeLetterISOLanguageName, Text = culture.EnglishName }); comboBoxTesseractLanguages.Items.Add(new TesseractLanguage { Id = culture.ThreeLetterISOLanguageName, Text = culture.EnglishName });
@ -1228,7 +1238,7 @@ namespace Nikse.SubtitleEdit.Forms
} }
if (comboBoxTesseractLanguages.Items.Count > 0) if (comboBoxTesseractLanguages.Items.Count > 0)
{ {
for (int i=0; i<comboBoxTesseractLanguages.Items.Count; i++) for (int i = 0; i < comboBoxTesseractLanguages.Items.Count; i++)
{ {
if ((comboBoxTesseractLanguages.Items[i] as TesseractLanguage).Id == Configuration.Settings.VobSubOcr.TesseractLastLanguage) if ((comboBoxTesseractLanguages.Items[i] as TesseractLanguage).Id == Configuration.Settings.VobSubOcr.TesseractLastLanguage)
comboBoxTesseractLanguages.SelectedIndex = i; comboBoxTesseractLanguages.SelectedIndex = i;
@ -1239,6 +1249,36 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
//private void InitializeTesseract()
//{
// string dir = Configuration.BaseDirectory + "tessdata";
// if (Directory.Exists(dir))
// {
// var list = new List<string>();
// comboBoxTesseractLanguages.Items.Clear();
// foreach (var culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures))
// {
// if (!list.Contains(culture.ThreeLetterISOLanguageName) &&
// Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + ".inttemp").Length > 0)
// {
// list.Add(culture.ThreeLetterISOLanguageName);
// comboBoxTesseractLanguages.Items.Add(new TesseractLanguage { Id = culture.ThreeLetterISOLanguageName, Text = culture.EnglishName });
// }
// }
// }
// if (comboBoxTesseractLanguages.Items.Count > 0)
// {
// for (int i = 0; i < comboBoxTesseractLanguages.Items.Count; i++)
// {
// if ((comboBoxTesseractLanguages.Items[i] as TesseractLanguage).Id == Configuration.Settings.VobSubOcr.TesseractLastLanguage)
// comboBoxTesseractLanguages.SelectedIndex = i;
// }
// if (comboBoxTesseractLanguages.SelectedIndex == -1)
// comboBoxTesseractLanguages.SelectedIndex = 0;
// }
//}
private void InitializeModiLanguages() private void InitializeModiLanguages()
{ {
foreach (ModiLanguage ml in ModiLanguage.AllLanguages) foreach (ModiLanguage ml in ModiLanguage.AllLanguages)
@ -1319,7 +1359,7 @@ namespace Nikse.SubtitleEdit.Forms
if (formVobSubEditCharacters.ShowDialog() == DialogResult.OK) if (formVobSubEditCharacters.ShowDialog() == DialogResult.OK)
{ {
_compareDoc = formVobSubEditCharacters.ImageCompareDocument; _compareDoc = formVobSubEditCharacters.ImageCompareDocument;
string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar; string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
_compareDoc.Save(path + "CompareDescription.xml"); _compareDoc.Save(path + "CompareDescription.xml");
} }
LoadImageCompareBitmaps(); LoadImageCompareBitmaps();

View File

@ -33,7 +33,7 @@ namespace Nikse.SubtitleEdit.Forms
{ {
try try
{ {
string fullName = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + folderName; string fullName = Configuration.VobSubCompareFolder + folderName;
Directory.CreateDirectory(fullName); Directory.CreateDirectory(fullName);
FolderName = folderName; FolderName = folderName;
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;

View File

@ -1,4 +1,5 @@
using System.IO; using System.IO;
using System;
namespace Nikse.SubtitleEdit.Logic namespace Nikse.SubtitleEdit.Logic
{ {
@ -6,8 +7,75 @@ namespace Nikse.SubtitleEdit.Logic
{ {
static readonly Configuration Instance = new Configuration(); static readonly Configuration Instance = new Configuration();
string _baseDir; string _baseDir;
string _dataDir;
Settings _settings; Settings _settings;
public static string SettingsFileName
{
get
{
return DataDirectory + "Settings.xml";
}
}
public static string DictionariesFolder
{
get
{
return DataDirectory + "Dictionaries" + Path.DirectorySeparatorChar;
}
}
public static string VobSubCompareFolder
{
get
{
return DataDirectory + "VobSub" + Path.DirectorySeparatorChar;
}
}
public static string WaveFormsFolder
{
get
{
return DataDirectory + "WaveForms" + Path.DirectorySeparatorChar;
}
}
public static string DataDirectory
{
get
{
if (Instance._dataDir == null)
{
if (BaseDirectory.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), StringComparison.OrdinalIgnoreCase))
{
try
{
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "Nikse";
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
path += Path.DirectorySeparatorChar + "SubtitleEdit";
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
Instance._dataDir = path + Path.DirectorySeparatorChar;
}
catch
{
Instance._dataDir = BaseDirectory;
}
}
else
{
Instance._dataDir = BaseDirectory;
}
}
return Instance._dataDir;
}
}
public static string BaseDirectory public static string BaseDirectory
{ {
get get

View File

@ -333,7 +333,7 @@ namespace Nikse.SubtitleEdit.Logic
//Serialize(Configuration.BaseDirectory + "Settings.xml", this); //Serialize(Configuration.BaseDirectory + "Settings.xml", this);
//Fast - TODO: Fix in release //Fast - TODO: Fix in release
CustomSerialize(Configuration.BaseDirectory + "Settings.xml", this); CustomSerialize(Configuration.SettingsFileName, this);
} }
private static void Serialize(string fileName, Settings settings) private static void Serialize(string fileName, Settings settings)
@ -347,16 +347,16 @@ namespace Nikse.SubtitleEdit.Logic
public static Settings GetSettings() public static Settings GetSettings()
{ {
Settings settings = new Settings(); Settings settings = new Settings();
if (File.Exists(Configuration.BaseDirectory + "Settings.xml")) string settingsFileName = Configuration.SettingsFileName;
if (File.Exists(settingsFileName))
{ {
try try
{ {
//TODO: Fix in release //TODO: Fix in release
settings = CustomDeserialize(Configuration.BaseDirectory + "Settings.xml"); // 15 msecs settings = CustomDeserialize(settingsFileName); // 15 msecs
//too slow... :( //too slow... :(
//settings = Deserialize(Configuration.BaseDirectory + "Settings.xml"); // 688 msecs //settings = Deserialize(Configuration.BaseDirectory + "Settings.xml"); // 688 msecs
} }
catch catch
{ {

View File

@ -575,7 +575,7 @@ namespace Nikse.SubtitleEdit.Logic
{ {
get get
{ {
return Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + "Dictionaries" + Path.DirectorySeparatorChar; return Configuration.DictionariesFolder;
} }
} }