From 33b1c3f11e430dc483a8d3f2af5efb2b3f93d989 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 9 Jan 2010 22:22:13 +0000 Subject: [PATCH] WinGui: - Enabled the Frame to Frame encode mode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3061 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Parsing/Title.cs | 10 ++++++++++ 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 m_subtitles; private List m_angles = new List(); 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; } } + + /// + /// Collection of Angles in this Title + /// + public float Fps + { + get { return m_fps; } + } /// /// 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; } } -- 2.40.0