A fix for using time code HHMMSSFF

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2216 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-11-20 20:43:26 +00:00
parent b162a18a5e
commit 79b224d348
6 changed files with 11 additions and 18 deletions

View File

@ -17,21 +17,10 @@ namespace Nikse.SubtitleEdit.Controls
public EventHandler TimeCodeChanged;
private TimeMode? _mode = null;
public TimeMode Mode
{
set
{
_mode = value;
if (Mode == TimeMode.HHMMSSMS)
maskedTextBox1.Mask = "00:00:00.000";
else
maskedTextBox1.Mask = "00:00:00:00";
}
get
{
if (_mode != null)
return _mode.Value;
if (Configuration.Settings == null)
return TimeMode.HHMMSSMS;
if (Configuration.Settings.General.UseTimeFormatHHMMSSFF)

View File

@ -309,7 +309,6 @@
this.timeUpDownAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownAdjust.Location = new System.Drawing.Point(7, 37);
this.timeUpDownAdjust.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownAdjust.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
this.timeUpDownAdjust.Name = "timeUpDownAdjust";
this.timeUpDownAdjust.Size = new System.Drawing.Size(96, 24);
this.timeUpDownAdjust.TabIndex = 1;

View File

@ -547,8 +547,7 @@
this.timeUpDownStartTime.AutoSize = true;
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownStartTime.Location = new System.Drawing.Point(241, 263);
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.timeUpDownStartTime.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(123, 27);
this.timeUpDownStartTime.TabIndex = 8;

View File

@ -69,7 +69,7 @@ namespace Nikse.SubtitleEdit.Forms
textBoxEditRate.Text = ss.CurrentDCinemaEditRate;
comboBoxTimeCodeRate.Text = ss.CurrentDCinemaTimeCodeRate;
timeUpDownStartTime.Mode = SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSFF;
//timeUpDownStartTime.Mode = SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSFF;
if (string.IsNullOrEmpty(ss.CurrentDCinemaStartTime))
ss.CurrentDCinemaStartTime = "00:00:00:00";
timeUpDownStartTime.MaskedTextBox.Text = ss.CurrentDCinemaStartTime;

View File

@ -2996,7 +2996,6 @@
this.timeUpDownVideoPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownVideoPosition.Location = new System.Drawing.Point(96, 191);
this.timeUpDownVideoPosition.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownVideoPosition.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
this.timeUpDownVideoPosition.Name = "timeUpDownVideoPosition";
this.timeUpDownVideoPosition.Size = new System.Drawing.Size(96, 25);
this.timeUpDownVideoPosition.TabIndex = 12;
@ -3441,7 +3440,6 @@
this.timeUpDownVideoPositionAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownVideoPositionAdjust.Location = new System.Drawing.Point(96, 213);
this.timeUpDownVideoPositionAdjust.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownVideoPositionAdjust.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
this.timeUpDownVideoPositionAdjust.Name = "timeUpDownVideoPositionAdjust";
this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(96, 25);
this.timeUpDownVideoPositionAdjust.TabIndex = 13;
@ -4088,7 +4086,6 @@
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownStartTime.Location = new System.Drawing.Point(9, 26);
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownStartTime.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(96, 25);
this.timeUpDownStartTime.TabIndex = 0;

View File

@ -246,6 +246,9 @@ namespace Nikse.SubtitleEdit.Forms
{
InitializeComponent();
//if (Configuration.Settings.General.UseTimeFormatHHMMSSFF) nixe harboe
// timeUpDownStartTime.Mode = Configuration.Settings.
textBoxListViewTextAlternate.Visible = false;
labelAlternateText.Visible = false;
labelAlternateCharactersPerSecond.Visible = false;
@ -1235,6 +1238,12 @@ namespace Nikse.SubtitleEdit.Forms
if (_subtitleAlternate != null && SubtitleListview1.IsAlternateTextColumnVisible)
original = Utilities.GetOriginalParagraph(index, beforeParagraph, _subtitleAlternate.Paragraphs);
if (Configuration.Settings.General.UseTimeFormatHHMMSSFF)
{ // so we don't get weird rounds we'll use whole frames when moving start time
double fr = 1000.0 / Configuration.Settings.General.CurrentFrameRate;
paragraph.StartTime.TotalMilliseconds = ((int)Math.Round(paragraph.StartTime.TotalMilliseconds / fr)) * fr;
}
timeUpDownStartTime.TimeCode = paragraph.StartTime;
decimal durationInSeconds = (decimal) (paragraph.Duration.TotalSeconds);
if (durationInSeconds >= numericUpDownDuration.Minimum && durationInSeconds <= numericUpDownDuration.Maximum)