mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
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:
parent
b162a18a5e
commit
79b224d348
@ -17,21 +17,10 @@ namespace Nikse.SubtitleEdit.Controls
|
|||||||
|
|
||||||
public EventHandler TimeCodeChanged;
|
public EventHandler TimeCodeChanged;
|
||||||
|
|
||||||
private TimeMode? _mode = null;
|
|
||||||
public TimeMode Mode
|
public TimeMode Mode
|
||||||
{
|
{
|
||||||
set
|
|
||||||
{
|
|
||||||
_mode = value;
|
|
||||||
if (Mode == TimeMode.HHMMSSMS)
|
|
||||||
maskedTextBox1.Mask = "00:00:00.000";
|
|
||||||
else
|
|
||||||
maskedTextBox1.Mask = "00:00:00:00";
|
|
||||||
}
|
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_mode != null)
|
|
||||||
return _mode.Value;
|
|
||||||
if (Configuration.Settings == null)
|
if (Configuration.Settings == null)
|
||||||
return TimeMode.HHMMSSMS;
|
return TimeMode.HHMMSSMS;
|
||||||
if (Configuration.Settings.General.UseTimeFormatHHMMSSFF)
|
if (Configuration.Settings.General.UseTimeFormatHHMMSSFF)
|
||||||
|
1
src/Forms/BatchConvert.Designer.cs
generated
1
src/Forms/BatchConvert.Designer.cs
generated
@ -309,7 +309,6 @@
|
|||||||
this.timeUpDownAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
this.timeUpDownAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||||
this.timeUpDownAdjust.Location = new System.Drawing.Point(7, 37);
|
this.timeUpDownAdjust.Location = new System.Drawing.Point(7, 37);
|
||||||
this.timeUpDownAdjust.Margin = new System.Windows.Forms.Padding(4);
|
this.timeUpDownAdjust.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.timeUpDownAdjust.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
|
|
||||||
this.timeUpDownAdjust.Name = "timeUpDownAdjust";
|
this.timeUpDownAdjust.Name = "timeUpDownAdjust";
|
||||||
this.timeUpDownAdjust.Size = new System.Drawing.Size(96, 24);
|
this.timeUpDownAdjust.Size = new System.Drawing.Size(96, 24);
|
||||||
this.timeUpDownAdjust.TabIndex = 1;
|
this.timeUpDownAdjust.TabIndex = 1;
|
||||||
|
1
src/Forms/DCinemaPropertiesSmpte.Designer.cs
generated
1
src/Forms/DCinemaPropertiesSmpte.Designer.cs
generated
@ -548,7 +548,6 @@
|
|||||||
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||||
this.timeUpDownStartTime.Location = new System.Drawing.Point(241, 263);
|
this.timeUpDownStartTime.Location = new System.Drawing.Point(241, 263);
|
||||||
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
this.timeUpDownStartTime.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
|
|
||||||
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
||||||
this.timeUpDownStartTime.Size = new System.Drawing.Size(123, 27);
|
this.timeUpDownStartTime.Size = new System.Drawing.Size(123, 27);
|
||||||
this.timeUpDownStartTime.TabIndex = 8;
|
this.timeUpDownStartTime.TabIndex = 8;
|
||||||
|
@ -69,7 +69,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
textBoxEditRate.Text = ss.CurrentDCinemaEditRate;
|
textBoxEditRate.Text = ss.CurrentDCinemaEditRate;
|
||||||
comboBoxTimeCodeRate.Text = ss.CurrentDCinemaTimeCodeRate;
|
comboBoxTimeCodeRate.Text = ss.CurrentDCinemaTimeCodeRate;
|
||||||
|
|
||||||
timeUpDownStartTime.Mode = SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSFF;
|
//timeUpDownStartTime.Mode = SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSFF;
|
||||||
if (string.IsNullOrEmpty(ss.CurrentDCinemaStartTime))
|
if (string.IsNullOrEmpty(ss.CurrentDCinemaStartTime))
|
||||||
ss.CurrentDCinemaStartTime = "00:00:00:00";
|
ss.CurrentDCinemaStartTime = "00:00:00:00";
|
||||||
timeUpDownStartTime.MaskedTextBox.Text = ss.CurrentDCinemaStartTime;
|
timeUpDownStartTime.MaskedTextBox.Text = ss.CurrentDCinemaStartTime;
|
||||||
|
3
src/Forms/Main.Designer.cs
generated
3
src/Forms/Main.Designer.cs
generated
@ -2996,7 +2996,6 @@
|
|||||||
this.timeUpDownVideoPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
this.timeUpDownVideoPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||||
this.timeUpDownVideoPosition.Location = new System.Drawing.Point(96, 191);
|
this.timeUpDownVideoPosition.Location = new System.Drawing.Point(96, 191);
|
||||||
this.timeUpDownVideoPosition.Margin = new System.Windows.Forms.Padding(4);
|
this.timeUpDownVideoPosition.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.timeUpDownVideoPosition.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
|
|
||||||
this.timeUpDownVideoPosition.Name = "timeUpDownVideoPosition";
|
this.timeUpDownVideoPosition.Name = "timeUpDownVideoPosition";
|
||||||
this.timeUpDownVideoPosition.Size = new System.Drawing.Size(96, 25);
|
this.timeUpDownVideoPosition.Size = new System.Drawing.Size(96, 25);
|
||||||
this.timeUpDownVideoPosition.TabIndex = 12;
|
this.timeUpDownVideoPosition.TabIndex = 12;
|
||||||
@ -3441,7 +3440,6 @@
|
|||||||
this.timeUpDownVideoPositionAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
this.timeUpDownVideoPositionAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||||
this.timeUpDownVideoPositionAdjust.Location = new System.Drawing.Point(96, 213);
|
this.timeUpDownVideoPositionAdjust.Location = new System.Drawing.Point(96, 213);
|
||||||
this.timeUpDownVideoPositionAdjust.Margin = new System.Windows.Forms.Padding(4);
|
this.timeUpDownVideoPositionAdjust.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.timeUpDownVideoPositionAdjust.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
|
|
||||||
this.timeUpDownVideoPositionAdjust.Name = "timeUpDownVideoPositionAdjust";
|
this.timeUpDownVideoPositionAdjust.Name = "timeUpDownVideoPositionAdjust";
|
||||||
this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(96, 25);
|
this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(96, 25);
|
||||||
this.timeUpDownVideoPositionAdjust.TabIndex = 13;
|
this.timeUpDownVideoPositionAdjust.TabIndex = 13;
|
||||||
@ -4088,7 +4086,6 @@
|
|||||||
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||||
this.timeUpDownStartTime.Location = new System.Drawing.Point(9, 26);
|
this.timeUpDownStartTime.Location = new System.Drawing.Point(9, 26);
|
||||||
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
|
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.timeUpDownStartTime.Mode = Nikse.SubtitleEdit.Controls.TimeUpDown.TimeMode.HHMMSSMS;
|
|
||||||
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
||||||
this.timeUpDownStartTime.Size = new System.Drawing.Size(96, 25);
|
this.timeUpDownStartTime.Size = new System.Drawing.Size(96, 25);
|
||||||
this.timeUpDownStartTime.TabIndex = 0;
|
this.timeUpDownStartTime.TabIndex = 0;
|
||||||
|
@ -246,6 +246,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
//if (Configuration.Settings.General.UseTimeFormatHHMMSSFF) nixe harboe
|
||||||
|
// timeUpDownStartTime.Mode = Configuration.Settings.
|
||||||
|
|
||||||
textBoxListViewTextAlternate.Visible = false;
|
textBoxListViewTextAlternate.Visible = false;
|
||||||
labelAlternateText.Visible = false;
|
labelAlternateText.Visible = false;
|
||||||
labelAlternateCharactersPerSecond.Visible = false;
|
labelAlternateCharactersPerSecond.Visible = false;
|
||||||
@ -1235,6 +1238,12 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
if (_subtitleAlternate != null && SubtitleListview1.IsAlternateTextColumnVisible)
|
if (_subtitleAlternate != null && SubtitleListview1.IsAlternateTextColumnVisible)
|
||||||
original = Utilities.GetOriginalParagraph(index, beforeParagraph, _subtitleAlternate.Paragraphs);
|
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;
|
timeUpDownStartTime.TimeCode = paragraph.StartTime;
|
||||||
decimal durationInSeconds = (decimal) (paragraph.Duration.TotalSeconds);
|
decimal durationInSeconds = (decimal) (paragraph.Duration.TotalSeconds);
|
||||||
if (durationInSeconds >= numericUpDownDuration.Minimum && durationInSeconds <= numericUpDownDuration.Maximum)
|
if (durationInSeconds >= numericUpDownDuration.Minimum && durationInSeconds <= numericUpDownDuration.Maximum)
|
||||||
|
Loading…
Reference in New Issue
Block a user