diff options
Diffstat (limited to 'win/C#')
-rw-r--r-- | win/C#/Functions/Main.cs | 25 | ||||
-rw-r--r-- | win/C#/Parsing/Title.cs | 23 | ||||
-rw-r--r-- | win/C#/frmMain.Designer.cs | 12 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 10 |
4 files changed, 35 insertions, 35 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs index 02f6c80f1..4bce2a7fa 100644 --- a/win/C#/Functions/Main.cs +++ b/win/C#/Functions/Main.cs @@ -59,31 +59,6 @@ namespace Handbrake.Functions }
/// <summary>
- /// Select the longest title in the DVD title dropdown menu on frmMain
- /// </summary>
- /// <param name="source">
- /// The Source.
- /// </param>
- /// <returns>
- /// The longest title.
- /// </returns>
- public static Title SelectLongestTitle(DVD source)
- {
- TimeSpan longestDurationFound = TimeSpan.FromSeconds(0.0);
- Title returnTitle = null;
-
- foreach (Title item in source.Titles)
- {
- if (item.Duration > longestDurationFound)
- {
- returnTitle = item;
- longestDurationFound = item.Duration;
- }
- }
- return returnTitle;
- }
-
- /// <summary>
/// Set's up the DataGridView on the Chapters tab (frmMain)
/// </summary>
/// <param name="dataChpt">
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index c4b8cc14f..e3db16a51 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -78,6 +78,11 @@ namespace Handbrake.Parsing private int titleNumber;
/// <summary>
+ /// Is A Main Title
+ /// </summary>
+ private bool mainTitle;
+
+ /// <summary>
/// The par values for this title.
/// </summary>
private Size parVal;
@@ -122,7 +127,15 @@ namespace Handbrake.Parsing /// </summary>
public int TitleNumber
{
- get { return titleNumber; }
+ get { return this.titleNumber; }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this is a MainTitle.
+ /// </summary>
+ public bool MainTitle
+ {
+ get { return this.mainTitle; }
}
/// <summary>
@@ -210,6 +223,14 @@ namespace Handbrake.Parsing // If we are scanning a groupd of files, we'll want to get the source name.
string path = output.ReadLine();
+
+ m = Regex.Match(path, @" \+ Main Feature");
+ if (m.Success)
+ {
+ thisTitle.mainTitle = true;
+ path = output.ReadLine();
+ }
+
m = Regex.Match(path, @"^ \+ stream:");
if (m.Success)
thisTitle.source = path.Replace("+ stream:", string.Empty).Trim();
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs index 74d68e624..f9e2d11a3 100644 --- a/win/C#/frmMain.Designer.cs +++ b/win/C#/frmMain.Designer.cs @@ -274,7 +274,7 @@ namespace Handbrake this.check_turbo.Enabled = false;
this.check_turbo.Location = new System.Drawing.Point(146, 123);
this.check_turbo.Name = "check_turbo";
- this.check_turbo.Size = new System.Drawing.Size(101, 17);
+ this.check_turbo.Size = new System.Drawing.Size(99, 17);
this.check_turbo.TabIndex = 7;
this.check_turbo.Text = "Turbo first Pass";
this.ToolTip.SetToolTip(this.check_turbo, "Makes the first pass of a 2 pass encode faster.");
@@ -840,7 +840,7 @@ namespace Handbrake this.radio_cq.BackColor = System.Drawing.Color.Transparent;
this.radio_cq.Location = new System.Drawing.Point(336, 97);
this.radio_cq.Name = "radio_cq";
- this.radio_cq.Size = new System.Drawing.Size(110, 17);
+ this.radio_cq.Size = new System.Drawing.Size(105, 17);
this.radio_cq.TabIndex = 18;
this.radio_cq.Text = "Constant Quality:";
this.radio_cq.UseVisualStyleBackColor = false;
@@ -853,7 +853,7 @@ namespace Handbrake this.radio_avgBitrate.Checked = true;
this.radio_avgBitrate.Location = new System.Drawing.Point(336, 64);
this.radio_avgBitrate.Name = "radio_avgBitrate";
- this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);
+ this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);
this.radio_avgBitrate.TabIndex = 17;
this.radio_avgBitrate.TabStop = true;
this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";
@@ -866,7 +866,7 @@ namespace Handbrake this.radio_targetFilesize.BackColor = System.Drawing.Color.Transparent;
this.radio_targetFilesize.Location = new System.Drawing.Point(336, 37);
this.radio_targetFilesize.Name = "radio_targetFilesize";
- this.radio_targetFilesize.Size = new System.Drawing.Size(108, 17);
+ this.radio_targetFilesize.Size = new System.Drawing.Size(107, 17);
this.radio_targetFilesize.TabIndex = 16;
this.radio_targetFilesize.Text = "Target Size (MB):";
this.radio_targetFilesize.UseVisualStyleBackColor = false;
@@ -889,7 +889,7 @@ namespace Handbrake this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;
this.check_2PassEncode.Location = new System.Drawing.Point(125, 100);
this.check_2PassEncode.Name = "check_2PassEncode";
- this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);
+ this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);
this.check_2PassEncode.TabIndex = 6;
this.check_2PassEncode.Text = "2-Pass Encoding";
this.check_2PassEncode.UseVisualStyleBackColor = false;
@@ -957,7 +957,7 @@ namespace Handbrake this.Check_ChapterMarkers.BackColor = System.Drawing.Color.Transparent;
this.Check_ChapterMarkers.Location = new System.Drawing.Point(16, 32);
this.Check_ChapterMarkers.Name = "Check_ChapterMarkers";
- this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);
+ this.Check_ChapterMarkers.Size = new System.Drawing.Size(136, 17);
this.Check_ChapterMarkers.TabIndex = 1;
this.Check_ChapterMarkers.Text = "Create chapter markers";
this.Check_ChapterMarkers.UseVisualStyleBackColor = false;
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 0894d6a81..763f2d360 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -1686,9 +1686,13 @@ namespace Handbrake if (currentSource.Titles.Count != 0)
drp_dvdtitle.Items.AddRange(currentSource.Titles.ToArray());
- // Now select the longest title
- if (currentSource.Titles.Count != 0)
- drp_dvdtitle.SelectedItem = Main.SelectLongestTitle(currentSource);
+ foreach (Title title in currentSource.Titles)
+ {
+ if (title.MainTitle)
+ {
+ drp_dvdtitle.SelectedItem = title;
+ }
+ }
// Enable the creation of chapter markers if the file is an image of a dvd.
int start, end;
|