Added info about chars/sec to Statistics - thx Krystian :)

This commit is contained in:
niksedk 2014-08-03 09:06:13 +02:00
parent e0697335e6
commit fe50053da2
7 changed files with 42 additions and 10 deletions

View File

@ -18,6 +18,9 @@
* 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
* Minor syntax coloring fix regarding 2+ lines - thx Joel
* Format "CSV 3" should not load format "SPRUCE STL" - thx Adrian
* Added info about chars/sec to Statistics - thx Krystian
3.4.0 (13th July 2014)

View File

@ -28,6 +28,8 @@ namespace Nikse.SubtitleEdit.Forms
InitializeComponent();
Text = Configuration.Settings.Language.SetVideoOffset.Title;
labelDescription.Text = Configuration.Settings.Language.SetVideoOffset.Description;
checkBoxFromCurrentPosition.Text = Configuration.Settings.Language.SetVideoOffset.RelativeToCurrentVideoPosition;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
FixLargeFonts();

View File

@ -44,7 +44,7 @@
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(642, 596);
this.buttonOK.Location = new System.Drawing.Point(642, 632);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 2;
@ -59,7 +59,7 @@
this.groupBoxGeneral.Controls.Add(this.textBoxGeneral);
this.groupBoxGeneral.Location = new System.Drawing.Point(15, 12);
this.groupBoxGeneral.Name = "groupBoxGeneral";
this.groupBoxGeneral.Size = new System.Drawing.Size(705, 331);
this.groupBoxGeneral.Size = new System.Drawing.Size(705, 376);
this.groupBoxGeneral.TabIndex = 0;
this.groupBoxGeneral.TabStop = false;
this.groupBoxGeneral.Text = "General statistics";
@ -74,7 +74,7 @@
this.textBoxGeneral.Name = "textBoxGeneral";
this.textBoxGeneral.ReadOnly = true;
this.textBoxGeneral.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxGeneral.Size = new System.Drawing.Size(693, 306);
this.textBoxGeneral.Size = new System.Drawing.Size(693, 351);
this.textBoxGeneral.TabIndex = 0;
//
// groupBoxMostUsed
@ -86,9 +86,9 @@
this.groupBoxMostUsed.Controls.Add(this.labelMostUsedWords);
this.groupBoxMostUsed.Controls.Add(this.textBoxMostUsedLines);
this.groupBoxMostUsed.Controls.Add(this.textBoxMostUsedWords);
this.groupBoxMostUsed.Location = new System.Drawing.Point(12, 349);
this.groupBoxMostUsed.Location = new System.Drawing.Point(12, 394);
this.groupBoxMostUsed.Name = "groupBoxMostUsed";
this.groupBoxMostUsed.Size = new System.Drawing.Size(705, 241);
this.groupBoxMostUsed.Size = new System.Drawing.Size(705, 232);
this.groupBoxMostUsed.TabIndex = 1;
this.groupBoxMostUsed.TabStop = false;
this.groupBoxMostUsed.Text = "Most used";
@ -121,7 +121,7 @@
this.textBoxMostUsedLines.Name = "textBoxMostUsedLines";
this.textBoxMostUsedLines.ReadOnly = true;
this.textBoxMostUsedLines.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxMostUsedLines.Size = new System.Drawing.Size(367, 192);
this.textBoxMostUsedLines.Size = new System.Drawing.Size(367, 183);
this.textBoxMostUsedLines.TabIndex = 1;
//
// textBoxMostUsedWords
@ -133,14 +133,14 @@
this.textBoxMostUsedWords.Name = "textBoxMostUsedWords";
this.textBoxMostUsedWords.ReadOnly = true;
this.textBoxMostUsedWords.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxMostUsedWords.Size = new System.Drawing.Size(320, 192);
this.textBoxMostUsedWords.Size = new System.Drawing.Size(320, 183);
this.textBoxMostUsedWords.TabIndex = 0;
//
// Statistics
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(732, 629);
this.ClientSize = new System.Drawing.Size(732, 665);
this.Controls.Add(this.groupBoxMostUsed);
this.Controls.Add(this.groupBoxGeneral);
this.Controls.Add(this.buttonOK);

View File

@ -57,6 +57,9 @@ namespace Nikse.SubtitleEdit.Forms
double minimumDuration = 100000000;
double maximumDuration = 0;
double totalDuration = 0;
double minimumCharsSec = 100000000;
double maximumCharsSec = 0;
double totalCharsSec = 0;
foreach (Paragraph p in _subtitle.Paragraphs)
{
allText.Append(p.Text);
@ -75,6 +78,13 @@ namespace Nikse.SubtitleEdit.Forms
maximumDuration = duration;
totalDuration += duration;
var charsSec = Utilities.GetCharactersPerSecond(p);
if (charsSec < minimumCharsSec)
minimumCharsSec = charsSec;
if (charsSec > maximumCharsSec)
maximumCharsSec = charsSec;
totalCharsSec += charsSec;
foreach (string line in p.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries))
{
len = line.Length;
@ -112,6 +122,13 @@ namespace Nikse.SubtitleEdit.Forms
sb.AppendLine(string.Format(_l.DurationMaximum, maximumDuration / 1000.0));
sb.AppendLine(string.Format(_l.DurationAvarage, totalDuration / _subtitle.Paragraphs.Count / 1000.0));
sb.AppendLine();
if (!string.IsNullOrEmpty(_l.ChararactersPerSecondMinimum))
{
sb.AppendLine(string.Format(_l.ChararactersPerSecondMinimum, minimumCharsSec));
sb.AppendLine(string.Format(_l.ChararactersPerSecondMaximum, maximumCharsSec));
sb.AppendLine(string.Format(_l.ChararactersPerSecondAverage, totalCharsSec / _subtitle.Paragraphs.Count));
sb.AppendLine();
}
textBoxGeneral.Text = sb.ToString().Trim();
textBoxGeneral.SelectionStart = 0;
textBoxGeneral.SelectionLength = 0;

View File

@ -112,9 +112,9 @@
<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>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.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>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1942,6 +1942,8 @@ can edit in same subtitle file (collaboration)",
SetVideoOffset = new LanguageStructure.SetVideoOffset
{
Title = "Set video offset",
Description = "Set video offset (subtitles should not follow real video time, but e.g. +10 hours)",
RelativeToCurrentVideoPosition = "Relative to current video position"
};
ShowEarlierLater = new LanguageStructure.ShowEarlierLater
@ -2078,6 +2080,9 @@ can edit in same subtitle file (collaboration)",
DurationMinimum = "Duration - minimum: {0:0.000} seconds",
DurationMaximum = "Duration - maximum: {0:0.000} seconds",
DurationAvarage = "Duration - average: {0:0.000} seconds",
ChararactersPerSecondMinimum = "Chararacters/sec - minimum: {0:0.000}",
ChararactersPerSecondMaximum = "Chararacters/sec - maximum: {0:0.000}",
ChararactersPerSecondAverage = "Chararacters/sec - average: {0:0.000}",
};
SubStationAlphaProperties = new LanguageStructure.SubStationAlphaProperties

View File

@ -1826,6 +1826,8 @@
public class SetVideoOffset
{
public string Title { get; set; }
public string Description { get; set; }
public string RelativeToCurrentVideoPosition { get; set; }
}
public class ShowEarlierLater
@ -1962,6 +1964,9 @@
public string DurationMinimum { get; set; }
public string DurationMaximum { get; set; }
public string DurationAvarage { get; set; }
public string ChararactersPerSecondMinimum { get; set; }
public string ChararactersPerSecondMaximum { get; set; }
public string ChararactersPerSecondAverage { get; set; }
}
public class SubStationAlphaProperties