This commit is contained in:
niksedk 2014-09-23 22:13:53 +02:00
commit b74dd6c8f5
19 changed files with 131 additions and 126 deletions

View File

@ -43,7 +43,7 @@
* Minor performance improvements
* Added ".mxf" to list of known video formats - thx Haroldo
* FIXED:
* Reverted "Framerate conversion fix" from 3.4.1
* Reverted "Frame rate conversion fix" from 3.4.1
* Fixed "Split line" button appear wrongly - thx Quetsbeek
* Changes to interjections now work instantly
* Detection of SSA/ASS tags in remove text for HI - thx Thunderbolt8
@ -78,7 +78,7 @@
* Export to image based formats now uses font from SSA/ASS - thx mariner
* Do not lock explorer when dropping files (for OCR) in Subtitle Edit's main list view - thx Jar
* Fixed dialog issue in "auto-break lines" - thx fred
* Framerate conversion - fix for time based subs
* Frame rate conversion - fix for time based subs
* Fixed issue regarding showing current vs original texts on previews - thx Krystian
* Fixed bug in break long lines - thx moob
* Fixed bug in export/boxing - thx mood
@ -821,7 +821,7 @@
* Bug in replace when showing original subtitle - thx Krystian
* Bug in auto break lines regarding italic tags - thx Majid
* Crash when merging lines (original sub) in some cases - thx Krystian
* Bug when saving framerate with "," instead of "." - thx yannick
* Bug when saving frame rate with "," instead of "." - thx yannick
* Wrong time codes when appending frame based subs - thx Klos
* MPlayer works much better now, also on Linux.
(Use MPlayer2 for precise seeking)

View File

@ -1498,6 +1498,8 @@ can edit in same subtitle file (collaboration)</Information>
<DirectShowDescription>quartz.dll in system32 folder</DirectShowDescription>
<ManagedDirectX>Managed DirectX</ManagedDirectX>
<ManagedDirectXDescription>Microsoft.DirectX.AudioVideoPlayback - .NET Managed code from DirectX</ManagedDirectXDescription>
<MpcHc>MPC-HC</MpcHc>
<MpcHcDescription>Media Player Classic - Home Cinema</MpcHcDescription>
<MPlayer>MPlayer</MPlayer>
<MPlayerDescription>MPlayer2/Mplayer</MPlayerDescription>
<VlcMediaPlayer>VLC media player</VlcMediaPlayer>

View File

@ -830,7 +830,7 @@ namespace Nikse.SubtitleEdit.Forms
if (double.TryParse(comboBoxFrameRateFrom.Text.Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out fromFrameRate) &&
double.TryParse(comboBoxFrameRateTo.Text.Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out toFrameRate))
{
sub.ChangeFramerate(fromFrameRate, toFrameRate);
sub.ChangeFrameRate(fromFrameRate, toFrameRate);
}
if (timeUpDownAdjust.TimeCode.TotalMilliseconds > 0.00001)

View File

@ -54,7 +54,7 @@
this.comboBoxBottomMargin = new System.Windows.Forms.ComboBox();
this.labelBottomMargin = new System.Windows.Forms.Label();
this.labelFrameRate = new System.Windows.Forms.Label();
this.comboBoxFramerate = new System.Windows.Forms.ComboBox();
this.comboBoxFrameRate = new System.Windows.Forms.ComboBox();
this.labelLanguage = new System.Windows.Forms.Label();
this.comboBoxLanguage = new System.Windows.Forms.ComboBox();
this.labelImageFormat = new System.Windows.Forms.Label();
@ -173,7 +173,7 @@
this.groupBoxImageSettings.Controls.Add(this.comboBoxBottomMargin);
this.groupBoxImageSettings.Controls.Add(this.labelBottomMargin);
this.groupBoxImageSettings.Controls.Add(this.labelFrameRate);
this.groupBoxImageSettings.Controls.Add(this.comboBoxFramerate);
this.groupBoxImageSettings.Controls.Add(this.comboBoxFrameRate);
this.groupBoxImageSettings.Controls.Add(this.labelLanguage);
this.groupBoxImageSettings.Controls.Add(this.comboBoxLanguage);
this.groupBoxImageSettings.Controls.Add(this.labelImageFormat);
@ -412,13 +412,13 @@
this.labelFrameRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.labelFrameRate.Visible = false;
//
// comboBoxFramerate
// comboBoxFrameRate
//
this.comboBoxFramerate.FormattingEnabled = true;
this.comboBoxFramerate.Location = new System.Drawing.Point(532, 134);
this.comboBoxFramerate.Name = "comboBoxFramerate";
this.comboBoxFramerate.Size = new System.Drawing.Size(121, 21);
this.comboBoxFramerate.TabIndex = 25;
this.comboBoxFrameRate.FormattingEnabled = true;
this.comboBoxFrameRate.Location = new System.Drawing.Point(532, 134);
this.comboBoxFrameRate.Name = "comboBoxFrameRate";
this.comboBoxFrameRate.Size = new System.Drawing.Size(121, 21);
this.comboBoxFrameRate.TabIndex = 25;
//
// labelLanguage
//
@ -916,7 +916,7 @@
private System.Windows.Forms.Label labelLanguage;
private System.Windows.Forms.ComboBox comboBoxLanguage;
private System.Windows.Forms.Label labelFrameRate;
private System.Windows.Forms.ComboBox comboBoxFramerate;
private System.Windows.Forms.ComboBox comboBoxFrameRate;
private System.Windows.Forms.ComboBox comboBoxBottomMargin;
private System.Windows.Forms.Label labelBottomMargin;
private System.Windows.Forms.CheckBox checkBoxSkipEmptyFrameAtStart;

View File

@ -97,10 +97,10 @@ namespace Nikse.SubtitleEdit.Forms
{
get
{
if (comboBoxFramerate.SelectedItem == null)
if (comboBoxFrameRate.SelectedItem == null)
return 25;
string s = comboBoxFramerate.SelectedItem.ToString();
string s = comboBoxFrameRate.SelectedItem.ToString();
s = s.Replace(",", ".").Trim();
double d;
if (double.TryParse(s, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d))
@ -654,17 +654,17 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
"NO\tINTIME\t\tOUTTIME\t\tXPOS\tYPOS\tFILENAME\tFADEIN\tFADEOUT";
string dropValue = "30000";
if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "23.98")
if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "23.98")
dropValue = "23976";
else if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "24")
else if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "24")
dropValue = "24000";
else if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "25")
else if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "25")
dropValue = "25000";
else if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "29.97")
else if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "29.97")
dropValue = "29970";
else if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "30")
else if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "30")
dropValue = "30000";
else if (comboBoxFramerate.Items[comboBoxFramerate.SelectedIndex].ToString() == "59.94")
else if (comboBoxFrameRate.Items[comboBoxFrameRate.SelectedIndex].ToString() == "59.94")
dropValue = "59940";
header = header.Replace("[DROPVALUE]", dropValue);
@ -2557,61 +2557,61 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
comboBoxImageFormat.Visible = showImageFormat;
labelImageFormat.Visible = showImageFormat;
labelFrameRate.Visible = exportType == "BDNXML" || exportType == "BLURAYSUP" || exportType == "DOST" || exportType == "IMAGE/FRAME";
comboBoxFramerate.Visible = exportType == "BDNXML" || exportType == "BLURAYSUP" || exportType == "DOST" || exportType == "IMAGE/FRAME";
comboBoxFrameRate.Visible = exportType == "BDNXML" || exportType == "BLURAYSUP" || exportType == "DOST" || exportType == "IMAGE/FRAME";
checkBoxTransAntiAliase.Visible = exportType == "VOBSUB";
if (exportType == "BDNXML")
{
labelFrameRate.Top = labelLanguage.Top;
comboBoxFramerate.Top = comboBoxLanguage.Top;
comboBoxFramerate.Items.Add("23.976");
comboBoxFramerate.Items.Add("24");
comboBoxFramerate.Items.Add("25");
comboBoxFramerate.Items.Add("29.97");
comboBoxFramerate.Items.Add("30");
comboBoxFramerate.Items.Add("50");
comboBoxFramerate.Items.Add("59.94");
comboBoxFramerate.SelectedIndex = 2;
comboBoxFrameRate.Top = comboBoxLanguage.Top;
comboBoxFrameRate.Items.Add("23.976");
comboBoxFrameRate.Items.Add("24");
comboBoxFrameRate.Items.Add("25");
comboBoxFrameRate.Items.Add("29.97");
comboBoxFrameRate.Items.Add("30");
comboBoxFrameRate.Items.Add("50");
comboBoxFrameRate.Items.Add("59.94");
comboBoxFrameRate.SelectedIndex = 2;
}
else if (exportType == "DOST")
{
labelFrameRate.Top = labelLanguage.Top;
comboBoxFramerate.Top = comboBoxLanguage.Top;
comboBoxFramerate.Items.Add("23.98");
comboBoxFramerate.Items.Add("24");
comboBoxFramerate.Items.Add("25");
comboBoxFramerate.Items.Add("29.97");
comboBoxFramerate.Items.Add("30");
comboBoxFramerate.Items.Add("59.94");
comboBoxFramerate.SelectedIndex = 2;
comboBoxFrameRate.Top = comboBoxLanguage.Top;
comboBoxFrameRate.Items.Add("23.98");
comboBoxFrameRate.Items.Add("24");
comboBoxFrameRate.Items.Add("25");
comboBoxFrameRate.Items.Add("29.97");
comboBoxFrameRate.Items.Add("30");
comboBoxFrameRate.Items.Add("59.94");
comboBoxFrameRate.SelectedIndex = 2;
}
else if (exportType == "IMAGE/FRAME")
{
labelFrameRate.Top = labelLanguage.Top;
comboBoxFramerate.Top = comboBoxLanguage.Top;
comboBoxFramerate.Items.Add("23.976");
comboBoxFramerate.Items.Add("24");
comboBoxFramerate.Items.Add("25");
comboBoxFramerate.Items.Add("29.97");
comboBoxFramerate.Items.Add("30");
comboBoxFramerate.Items.Add("50");
comboBoxFramerate.Items.Add("59.94");
comboBoxFramerate.Items.Add("60");
comboBoxFramerate.SelectedIndex = 2;
comboBoxFrameRate.Top = comboBoxLanguage.Top;
comboBoxFrameRate.Items.Add("23.976");
comboBoxFrameRate.Items.Add("24");
comboBoxFrameRate.Items.Add("25");
comboBoxFrameRate.Items.Add("29.97");
comboBoxFrameRate.Items.Add("30");
comboBoxFrameRate.Items.Add("50");
comboBoxFrameRate.Items.Add("59.94");
comboBoxFrameRate.Items.Add("60");
comboBoxFrameRate.SelectedIndex = 2;
}
else if (exportType == "BLURAYSUP")
{
labelFrameRate.Top = labelLanguage.Top;
comboBoxFramerate.Top = comboBoxLanguage.Top;
comboBoxFramerate.Items.Add("23.976");
comboBoxFramerate.Items.Add("24");
comboBoxFramerate.Items.Add("25");
comboBoxFramerate.Items.Add("29.97");
comboBoxFramerate.Items.Add("50");
comboBoxFramerate.Items.Add("59.94");
comboBoxFramerate.SelectedIndex = 1;
comboBoxFramerate.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxFrameRate.Top = comboBoxLanguage.Top;
comboBoxFrameRate.Items.Add("23.976");
comboBoxFrameRate.Items.Add("24");
comboBoxFrameRate.Items.Add("25");
comboBoxFrameRate.Items.Add("29.97");
comboBoxFrameRate.Items.Add("50");
comboBoxFrameRate.Items.Add("59.94");
comboBoxFrameRate.SelectedIndex = 1;
comboBoxFrameRate.DropDownStyle = ComboBoxStyle.DropDownList;
}
if (comboBoxFramerate.Items.Count >= 2)
if (comboBoxFrameRate.Items.Count >= 2)
{
SetLastFrameRate(Configuration.Settings.Tools.ExportLastFrameRate);
}
@ -2736,14 +2736,14 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
private void SetLastFrameRate(double lastFrameRate)
{
for (int i = 0; i < comboBoxFramerate.Items.Count; i++)
for (int i = 0; i < comboBoxFrameRate.Items.Count; i++)
{
double d;
if (double.TryParse(comboBoxFramerate.Items[i].ToString().Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d))
if (double.TryParse(comboBoxFrameRate.Items[i].ToString().Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d))
{
if (Math.Abs(lastFrameRate - d) < 0.01)
{
comboBoxFramerate.SelectedIndex = i;
comboBoxFrameRate.SelectedIndex = i;
return;
}
}

View File

@ -2030,8 +2030,8 @@
//
this.toolStripMenuItemChangeFrameRate2.Name = "toolStripMenuItemChangeFrameRate2";
this.toolStripMenuItemChangeFrameRate2.Size = new System.Drawing.Size(336, 22);
this.toolStripMenuItemChangeFrameRate2.Text = "Change framerate...";
this.toolStripMenuItemChangeFrameRate2.Click += new System.EventHandler(this.ToolStripMenuItemChangeFramerateClick);
this.toolStripMenuItemChangeFrameRate2.Text = "Change frame rate...";
this.toolStripMenuItemChangeFrameRate2.Click += new System.EventHandler(this.ToolStripMenuItemChangeFrameRateClick);
//
// changeSpeedInPercentToolStripMenuItem
//

View File

@ -10345,7 +10345,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void ToolStripMenuItemChangeFramerateClick(object sender, EventArgs e)
private void ToolStripMenuItemChangeFrameRateClick(object sender, EventArgs e)
{
if (IsSubtitleLoaded)
{
@ -10354,26 +10354,26 @@ namespace Nikse.SubtitleEdit.Forms
lastSelectedIndex = SubtitleListview1.SelectedItems[0].Index;
ReloadFromSourceView();
var changeFramerate = new ChangeFrameRate();
_formPositionsAndSizes.SetPositionAndSize(changeFramerate);
changeFramerate.Initialize(CurrentFrameRate.ToString());
if (changeFramerate.ShowDialog(this) == DialogResult.OK)
var changeFrameRate = new ChangeFrameRate();
_formPositionsAndSizes.SetPositionAndSize(changeFrameRate);
changeFrameRate.Initialize(CurrentFrameRate.ToString());
if (changeFrameRate.ShowDialog(this) == DialogResult.OK)
{
MakeHistoryForUndo(_language.BeforeChangeFrameRate);
double oldFramerate = changeFramerate.OldFrameRate;
double newFramerate = changeFramerate.NewFrameRate;
_subtitle.ChangeFramerate(oldFramerate, newFramerate);
double oldFrameRate = changeFrameRate.OldFrameRate;
double newFrameRate = changeFrameRate.NewFrameRate;
_subtitle.ChangeFrameRate(oldFrameRate, newFrameRate);
ShowStatus(string.Format(_language.FrameRateChangedFromXToY, oldFramerate, newFramerate));
toolStripComboBoxFrameRate.Text = newFramerate.ToString();
ShowStatus(string.Format(_language.FrameRateChangedFromXToY, oldFrameRate, newFrameRate));
toolStripComboBoxFrameRate.Text = newFrameRate.ToString();
ShowSource();
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
_subtitleListViewIndex = -1;
SubtitleListview1.SelectIndexAndEnsureVisible(lastSelectedIndex);
}
_formPositionsAndSizes.SavePositionAndSize(changeFramerate);
_formPositionsAndSizes.SavePositionAndSize(changeFrameRate);
}
else
{

View File

@ -79,7 +79,7 @@
this.comboBoxSubtitleFontSize = new System.Windows.Forms.ComboBox();
this.labelSubtitleFont = new System.Windows.Forms.Label();
this.labelDefaultFileEncoding = new System.Windows.Forms.Label();
this.comboBoxFramerate = new System.Windows.Forms.ComboBox();
this.comboBoxFrameRate = new System.Windows.Forms.ComboBox();
this.labelDefaultFrameRate = new System.Windows.Forms.Label();
this.tabPageToolBar = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
@ -442,7 +442,7 @@
this.groupBoxMiscellaneous.Controls.Add(this.comboBoxSubtitleFontSize);
this.groupBoxMiscellaneous.Controls.Add(this.labelSubtitleFont);
this.groupBoxMiscellaneous.Controls.Add(this.labelDefaultFileEncoding);
this.groupBoxMiscellaneous.Controls.Add(this.comboBoxFramerate);
this.groupBoxMiscellaneous.Controls.Add(this.comboBoxFrameRate);
this.groupBoxMiscellaneous.Controls.Add(this.labelDefaultFrameRate);
this.groupBoxMiscellaneous.Location = new System.Drawing.Point(6, 6);
this.groupBoxMiscellaneous.Name = "groupBoxMiscellaneous";
@ -976,13 +976,13 @@
this.labelDefaultFileEncoding.TabIndex = 2;
this.labelDefaultFileEncoding.Text = "Default file encoding";
//
// comboBoxFramerate
// comboBoxFrameRate
//
this.comboBoxFramerate.FormattingEnabled = true;
this.comboBoxFramerate.Location = new System.Drawing.Point(205, 23);
this.comboBoxFramerate.Name = "comboBoxFramerate";
this.comboBoxFramerate.Size = new System.Drawing.Size(121, 21);
this.comboBoxFramerate.TabIndex = 1;
this.comboBoxFrameRate.FormattingEnabled = true;
this.comboBoxFrameRate.Location = new System.Drawing.Point(205, 23);
this.comboBoxFrameRate.Name = "comboBoxFrameRate";
this.comboBoxFrameRate.Size = new System.Drawing.Size(121, 21);
this.comboBoxFrameRate.TabIndex = 1;
//
// labelDefaultFrameRate
//
@ -991,7 +991,7 @@
this.labelDefaultFrameRate.Name = "labelDefaultFrameRate";
this.labelDefaultFrameRate.Size = new System.Drawing.Size(93, 13);
this.labelDefaultFrameRate.TabIndex = 0;
this.labelDefaultFrameRate.Text = "Default framerate";
this.labelDefaultFrameRate.Text = "Default frame rate";
//
// tabPageToolBar
//
@ -3443,7 +3443,7 @@
private System.Windows.Forms.CheckBox checkBoxSettings;
private System.Windows.Forms.Label labelDefaultFrameRate;
private System.Windows.Forms.Label labelDefaultFileEncoding;
private System.Windows.Forms.ComboBox comboBoxFramerate;
private System.Windows.Forms.ComboBox comboBoxFrameRate;
private System.Windows.Forms.CheckBox checkBoxSubtitleFontBold;
private System.Windows.Forms.ComboBox comboBoxSubtitleFontSize;
private System.Windows.Forms.Label labelSubtitleFont;

View File

@ -72,13 +72,13 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxSpellCheck.Checked = gs.ShowToolbarSpellCheck;
checkBoxHelp.Checked = gs.ShowToolbarHelp;
comboBoxFramerate.Items.Add((23.976).ToString());
comboBoxFramerate.Items.Add((24.0).ToString());
comboBoxFramerate.Items.Add((25.0).ToString());
comboBoxFramerate.Items.Add((29.97).ToString());
comboBoxFrameRate.Items.Add((23.976).ToString());
comboBoxFrameRate.Items.Add((24.0).ToString());
comboBoxFrameRate.Items.Add((25.0).ToString());
comboBoxFrameRate.Items.Add((29.97).ToString());
checkBoxShowFrameRate.Checked = gs.ShowFrameRate;
comboBoxFramerate.Text = gs.DefaultFrameRate.ToString();
comboBoxFrameRate.Text = gs.DefaultFrameRate.ToString();
comboBoxEncoding.Items.Clear();
int encodingSelectedIndex = 0;
@ -1047,7 +1047,7 @@ namespace Nikse.SubtitleEdit.Forms
gs.ShowFrameRate = checkBoxShowFrameRate.Checked;
double outFrameRate;
if (double.TryParse(comboBoxFramerate.Text.Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out outFrameRate))
if (double.TryParse(comboBoxFrameRate.Text.Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out outFrameRate))
gs.DefaultFrameRate = outFrameRate;
gs.DefaultEncoding = Encoding.UTF8.BodyName;
@ -1800,7 +1800,7 @@ namespace Nikse.SubtitleEdit.Forms
_wordListNamesEtc.Sort();
return _wordListNamesEtc;
});
if (reloadListBox)
{
// reload the listbox on a continuation ui thead

View File

@ -15,7 +15,7 @@ namespace Nikse.SubtitleEdit.Forms
private VideoInfo _videoInfo;
private string _subtitleFileName;
private Subtitle _originalSubtitle;
private double _oldFramerate;
private double _oldFrameRate;
private bool _frameRateChanged;
private bool _isStartSceneActive;
private double _startGoBackPosition;
@ -157,7 +157,7 @@ namespace Nikse.SubtitleEdit.Forms
// be sure to match frames with movie
if (_originalSubtitle.WasLoadedWithFrameNumbers) // frame based subtitles like MicroDVD
{
if (Math.Abs(_videoInfo.FramesPerSecond - _oldFramerate) > 0.02)
if (Math.Abs(_videoInfo.FramesPerSecond - _oldFrameRate) > 0.02)
{
_originalSubtitle.CalculateTimeCodesFromFrameNumbers(_videoInfo.FramesPerSecond);
LoadAndShowOriginalSubtitle();
@ -318,7 +318,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
internal void Initialize(Bitmap bitmap, Subtitle subtitle, string fileName, string title, double framerate)
internal void Initialize(Bitmap bitmap, Subtitle subtitle, string fileName, string title, double frameRate)
{
if (bitmap != null)
{
@ -327,7 +327,7 @@ namespace Nikse.SubtitleEdit.Forms
}
_originalSubtitle = subtitle;
_oldFramerate = framerate;
_oldFrameRate = frameRate;
_subtitleFileName = fileName;
Text = title;
}

View File

@ -431,9 +431,9 @@ namespace Nikse.SubtitleEdit.Forms
this.comboBoxOcrMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxOcrMethod.FormattingEnabled = true;
this.comboBoxOcrMethod.Items.AddRange(new object[] {
"OCR via tesseract",
"OCR via Tesseract",
"OCR via image compare",
"OCR via Microsoftr MODI",
"OCR via Microsoft MODI",
"OCR via nOCR"});
this.comboBoxOcrMethod.Location = new System.Drawing.Point(13, 20);
this.comboBoxOcrMethod.Name = "comboBoxOcrMethod";

View File

@ -978,7 +978,7 @@ namespace Nikse.SubtitleEdit.Forms
private void SetTesseractLanguageFromLanguageString(string languageString)
{
// try to match language from vob to tesseract language
// try to match language from vob to Tesseract language
if (comboBoxTesseractLanguages.SelectedIndex >= 0 && comboBoxTesseractLanguages.Items.Count > 1 && languageString != null)
{
languageString = languageString.ToLower();
@ -5633,7 +5633,7 @@ namespace Nikse.SubtitleEdit.Forms
}
catch
{
MessageBox.Show("Unable to start 'tesseract' - make sure tesseract-ocr 3.x is installed!");
MessageBox.Show("Unable to start 'Tesseract' - make sure tesseract-ocr 3.x is installed!");
throw;
}
process.WaitForExit(5000);
@ -6247,7 +6247,7 @@ namespace Nikse.SubtitleEdit.Forms
if (_modiEnabled && checkBoxUseModiInTesseractForUnknownWords.Checked)
{
// which is best - modi or tesseract - we find out here
// which is best - modi or Tesseract - we find out here
string modiText = CallModi(index);
if (modiText.Length == 0)
@ -6300,7 +6300,7 @@ namespace Nikse.SubtitleEdit.Forms
return string.Empty;
}
//check tesseract... find some otherway to do this...
//check Tesseract... find an other way to do this...
//string tmp = Utilities.RemoveHtmlTags(line).Trim();
//if (!tmp.TrimEnd().EndsWith("..."))
//{

View File

@ -2701,7 +2701,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("VlcWaveTranscodeSettings", settings.General.VlcWaveTranscodeSettings);
textWriter.WriteElementString("VlcLocation", settings.General.VlcLocation);
textWriter.WriteElementString("VlcLocationRelative", settings.General.VlcLocationRelative);
textWriter.WriteElementString("MpcHcLocation", settings.General.MpcHcLocation);
textWriter.WriteElementString("MpcHcLocation", settings.General.MpcHcLocation);
textWriter.WriteElementString("UseFFmpegForWaveExtraction", settings.General.UseFFmpegForWaveExtraction.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("FFmpegLocation", settings.General.FFmpegLocation);
textWriter.WriteElementString("UseTimeFormatHHMMSSFF", settings.General.UseTimeFormatHHMMSSFF.ToString(CultureInfo.InvariantCulture));

View File

@ -236,7 +236,7 @@ namespace Nikse.SubtitleEdit.Logic
}
/// <summary>
/// Calculate the time codes from framenumber/framerate
/// Calculate the time codes from frame number/frame rate
/// </summary>
/// <param name="frameRate">Number of frames per second</param>
/// <returns>True if times could be calculated</returns>
@ -256,7 +256,7 @@ namespace Nikse.SubtitleEdit.Logic
}
/// <summary>
/// Calculate the frame numbers from time codes/framerate
/// Calculate the frame numbers from time codes/frame rate
/// </summary>
/// <param name="frameRate"></param>
/// <returns></returns>
@ -297,15 +297,15 @@ namespace Nikse.SubtitleEdit.Logic
}
}
public void ChangeFramerate(double oldFramerate, double newFramerate)
public void ChangeFrameRate(double oldFrameRate, double newFrameRate)
{
foreach (Paragraph p in Paragraphs)
{
double startFrame = p.StartTime.TotalMilliseconds / 1000.0 * oldFramerate;
double endFrame = p.EndTime.TotalMilliseconds / 1000.0 * oldFramerate;
p.StartTime.TotalMilliseconds = startFrame * (1000.0 / newFramerate);
p.EndTime.TotalMilliseconds = endFrame * (1000.0 / newFramerate);
p.CalculateFrameNumbersFromTimeCodes(newFramerate);
double startFrame = p.StartTime.TotalMilliseconds / 1000.0 * oldFrameRate;
double endFrame = p.EndTime.TotalMilliseconds / 1000.0 * oldFrameRate;
p.StartTime.TotalMilliseconds = startFrame * (1000.0 / newFrameRate);
p.EndTime.TotalMilliseconds = endFrame * (1000.0 / newFrameRate);
p.CalculateFrameNumbersFromTimeCodes(newFrameRate);
}
}

View File

@ -1886,7 +1886,6 @@ namespace Nikse.SubtitleEdit.Logic
}
}
}
public static VideoPlayer GetVideoPlayer()
{

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
{
public class MpcHc : VideoPlayer, IDisposable
{
@ -55,7 +55,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
public override double Duration
{
get
get
{
return _durationInSeconds;
}
@ -76,7 +76,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
public override void Play()
{
_playMode = ModePlay;
SendMpcMessage(MpcHcCommand.Play);
SendMpcMessage(MpcHcCommand.Play);
}
public override void Pause()
@ -128,12 +128,12 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
_positionTimer.Tick += PositionTimerTick;
}
void PositionTimerTick(object sender, EventArgs e)
private void PositionTimerTick(object sender, EventArgs e)
{
SendMpcMessage(MpcHcCommand.GetCurrentPosition);
}
void OnCopyData(object sender, EventArgs e)
private void OnCopyData(object sender, EventArgs e)
{
var message = (Message)sender;
var cds = (NativeMethods.CopyDataStruct)Marshal.PtrToStructure(message.LParam, typeof(NativeMethods.CopyDataStruct));
@ -219,7 +219,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
NativeMethods.SetWindowPos(handle, (IntPtr)NativeMethods.SpecialWindowHandles.HWND_TOP, -9999, -9999, 0, 0, NativeMethods.SetWindowPosFlags.SWP_NOACTIVATE);
return true;
}
}
}
return false;
}
@ -264,7 +264,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
if (File.Exists(path))
return path;
}
else
else
{
path = Path.Combine(Configuration.BaseDirectory, @"MPC-HC\mpc-hc.exe");
if (File.Exists(path))
@ -289,7 +289,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
path = Path.Combine(@"C:\Program Files (x86)\MPC-HC\mpc-hc.exe");
if (File.Exists(path))
return path;
path = Path.Combine(@"C:\Program Files\MPC-HC\mpc-hc.exe");
if (File.Exists(path))
return path;
@ -338,7 +338,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
@ -347,7 +347,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
{
if (disposing)
{
// release managed resources
// release managed resources
if (_positionTimer != null)
{
_positionTimer.Stop();

View File

@ -11,6 +11,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
internal delegate bool EnumedWindow(IntPtr handleWindow, ArrayList handles);
#region structs, constants and enums
public struct CopyDataStruct
{
public UIntPtr dwData;
@ -69,7 +70,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
Maximize = 3, // is this the right value?
/// <summary>
/// Activates the window and displays it as a maximized window.
/// </summary>
/// </summary>
ShowMaximized = 3,
/// <summary>
/// Displays a window in its most recent size and position. This value
@ -119,9 +120,11 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
}
public const Int32 WindowsMessageCopyData = 0x4A;
#endregion
#endregion structs, constants and enums
#region Win32 API
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool ShowWindow(IntPtr hWnd, ShowWindowCommands nCmdShow);
@ -146,6 +149,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
[DllImport("user32.dll")]
internal static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
#endregion Win32 API
}

View File

@ -26,7 +26,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
public abstract event EventHandler OnVideoLoaded;
public abstract event EventHandler OnVideoEnded;
public virtual void Resize(int width, int height)
{
{
}
}
}

View File

@ -66,7 +66,7 @@ namespace Test
public static void MyClassInitialize(TestContext testContext)
{
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
if (!Directory.Exists("Directories"))
Directory.CreateDirectory("Dictionaries");
var strm = asm.GetManifestResourceStream("Test.Dictionaries.en_US.aff");