diff options
author | sr55 <[email protected]> | 2010-01-09 22:22:13 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-01-09 22:22:13 +0000 |
commit | 33b1c3f11e430dc483a8d3f2af5efb2b3f93d989 (patch) | |
tree | fbb71df1f866fe9ecdba5de532cf386388e2484e /win/C# | |
parent | d59750cc3884e5b9f22643c00f70a564604d9894 (diff) |
WinGui:
- Enabled the Frame to Frame encode mode.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3061 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/Parsing/Title.cs | 10 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 34 |
2 files changed, 38 insertions, 6 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index f81819d43..b588e6433 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -24,6 +24,7 @@ namespace Handbrake.Parsing private readonly List<Subtitle> m_subtitles;
private List<String> m_angles = new List<string>();
private float m_aspectRatio;
+ private float m_fps;
private int[] m_autoCrop;
private string source;
private TimeSpan m_duration;
@@ -130,6 +131,14 @@ namespace Handbrake.Parsing {
get { return m_angles; }
}
+
+ /// <summary>
+ /// Collection of Angles in this Title
+ /// </summary>
+ public float Fps
+ {
+ get { return m_fps; }
+ }
/// <summary>
/// Override of the ToString method to provide an easy way to use this object in the UI
@@ -186,6 +195,7 @@ namespace Handbrake.Parsing thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
thisTitle.m_parVal = new Size(int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value));
thisTitle.m_aspectRatio = float.Parse(m.Groups[5].Value, Culture);
+ thisTitle.m_fps = float.Parse(m.Groups[6].Value, Culture);
}
// Get autocrop region for this title
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 127aa046d..b6fda2d32 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -881,7 +881,7 @@ namespace Handbrake }
sourcePath = Path.GetFileName(file);
- StartScan(file,0);
+ StartScan(file, 0);
}
private void drp_dvdtitle_Click(object sender, EventArgs e)
{
@@ -891,6 +891,7 @@ namespace Handbrake private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)
{
UnRegisterPresetEventHandler();
+ drop_mode.SelectedIndex = 0;
PictureSettings.lbl_Aspect.Text = "Select a Title"; // Reset some values on the form
drop_chapterStart.Items.Clear();
@@ -1048,10 +1049,24 @@ namespace Handbrake int start, end;
int.TryParse(drop_chapterStart.Text, out start);
int.TryParse(drop_chapterFinish.Text, out end);
+ double duration = end - start;
+
+ switch (drop_mode.SelectedIndex)
+ {
+ case 1:
+ lbl_duration.Text = TimeSpan.FromSeconds(duration).ToString();
+ return;
+ case 2:
+ if (selectedTitle != null)
+ {
+ duration = duration / selectedTitle.Fps;
+ lbl_duration.Text = TimeSpan.FromSeconds(duration).ToString();
+ }
+ else
+ lbl_duration.Text = "--:--:--";
- int duration = end - start;
- TimeSpan dur = TimeSpan.FromSeconds(duration);
- lbl_duration.Text = dur.ToString();
+ return;
+ }
}
private void drop_mode_SelectedIndexChanged(object sender, EventArgs e)
{
@@ -1085,8 +1100,15 @@ namespace Handbrake }
return;
case 2:
- MessageBox.Show("This feature is not implemented yet! Switching Back to Chapters Mode.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
- drop_mode.SelectedIndex = 0;
+ this.drop_chapterStart.TextChanged += new System.EventHandler(this.SecondsOrFramesChanged);
+ this.drop_chapterFinish.TextChanged += new System.EventHandler(this.SecondsOrFramesChanged);
+ drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;
+ drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;
+ if (selectedTitle != null)
+ {
+ drop_chapterStart.Text = "0";
+ drop_chapterFinish.Text = (selectedTitle.Fps * selectedTitle.Duration.TotalSeconds).ToString();
+ }
return;
}
}
|