OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 23 Apr 2010 22:10:44 +0000 (22:10 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 23 Apr 2010 22:10:44 +0000 (22:10 +0000)
- Updated to make sure of the MainFeature feature.

git-svn-id: svn://localhost/HandBrake/trunk@3256 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Functions/Main.cs
win/C#/Parsing/Title.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

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