OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 9 Dec 2007 22:16:16 +0000 (22:16 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 9 Dec 2007 22:16:16 +0000 (22:16 +0000)
- Removed extra folder.png file from the Resources
- Added support for Dynamic Range compression on a scale of 1 to 4.

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

win/C#/Functions/QueryParser.cs
win/C#/Properties/Resources.Designer.cs
win/C#/Properties/Resources.resx
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index 1102948..c39a6a4 100644 (file)
@@ -12,6 +12,7 @@ namespace Handbrake.Functions
         // All the Main Window GUI options\r
         #region Varibles\r
 \r
+        #region Source\r
         private string q_source;\r
         /// <summary>\r
         /// Returns a String \r
@@ -24,69 +25,71 @@ namespace Handbrake.Functions
                 return this.q_source;\r
             }\r
         }\r
-\r
-        private string q_destination;\r
+        private int q_dvdTitle;\r
         /// <summary>\r
-        /// Returns a String \r
-        /// Full path of the destination.\r
+        /// Returns an Integer\r
+        /// DVD Title number.\r
         /// </summary>\r
-        public string Destination\r
+        public int DVDTitle\r
         {\r
             get\r
             {\r
-                return this.q_destination;\r
+                return this.q_dvdTitle;\r
             }\r
         }\r
 \r
-        private string q_format;\r
+        private int q_chaptersStart;\r
         /// <summary>\r
-        /// Returns a String \r
-        /// Full path of the destination.\r
+        /// Returns an Int\r
+        /// DVD Chapter number or chapter range.\r
         /// </summary>\r
-        public string Format\r
+        public int DVDChapterStart\r
         {\r
             get\r
             {\r
-                return this.q_format;\r
+                return this.q_chaptersStart;\r
             }\r
         }\r
 \r
-        private int q_dvdTitle;\r
+        private int q_chaptersFinish;\r
         /// <summary>\r
-        /// Returns an Integer\r
-        /// DVD Title number.\r
+        /// Returns an Int\r
+        /// DVD Chapter number or chapter range.\r
         /// </summary>\r
-        public int DVDTitle\r
+        public int DVDChapterFinish\r
         {\r
             get\r
             {\r
-                return this.q_dvdTitle;\r
+                return this.q_chaptersFinish;\r
             }\r
         }\r
+#endregion\r
 \r
-        private int q_chaptersStart;\r
+        #region Destination\r
+\r
+        private string q_destination;\r
         /// <summary>\r
-        /// Returns an Int\r
-        /// DVD Chapter number or chapter range.\r
+        /// Returns a String \r
+        /// Full path of the destination.\r
         /// </summary>\r
-        public int DVDChapterStart\r
+        public string Destination\r
         {\r
             get\r
             {\r
-                return this.q_chaptersStart;\r
+                return this.q_destination;\r
             }\r
         }\r
 \r
-        private int q_chaptersFinish;\r
+        private string q_format;\r
         /// <summary>\r
-        /// Returns an Int\r
-        /// DVD Chapter number or chapter range.\r
+        /// Returns a String \r
+        /// Full path of the destination.\r
         /// </summary>\r
-        public int DVDChapterFinish\r
+        public string Format\r
         {\r
             get\r
             {\r
-                return this.q_chaptersFinish;\r
+                return this.q_format;\r
             }\r
         }\r
 \r
@@ -115,7 +118,9 @@ namespace Handbrake.Functions
                 return this.q_audioEncoder;\r
             }\r
         }\r
+#endregion\r
 \r
+        #region Picture Settings\r
         private int q_videoWidth;\r
         /// <summary>\r
         /// Returns an Int\r
@@ -302,7 +307,9 @@ namespace Handbrake.Functions
                 return this.q_chapterMarkers;\r
             }\r
         }\r
+        #endregion\r
 \r
+        #region Video Settings\r
         private Boolean q_grayscale;\r
         /// <summary>\r
         /// Returns a boolean to indicate wither Grayscale is on or off.\r
@@ -434,7 +441,9 @@ namespace Handbrake.Functions
                 return this.q_crf;\r
             }\r
         }\r
+        #endregion\r
 \r
+        #region Audio Settings\r
         private string q_audioBitrate;\r
         /// <summary>\r
         /// Returns a string with the audio bitrate\r
@@ -495,6 +504,19 @@ namespace Handbrake.Functions
             }\r
         }\r
 \r
+        private double q_drc;\r
+        /// <summary>\r
+        /// Returns a string with the selected subtitle track\r
+        /// </summary>\r
+        public double DRC\r
+        {\r
+            get\r
+            {\r
+                return this.q_drc;\r
+            }\r
+        }\r
+\r
+\r
         private string q_subtitles;\r
         /// <summary>\r
         /// Returns a string with the selected subtitle track\r
@@ -519,6 +541,9 @@ namespace Handbrake.Functions
             }\r
         }\r
 \r
+        #endregion\r
+\r
+        #region Other\r
         private string q_h264;\r
         /// <summary>\r
         /// Returns a string with the Advanced H264 query string\r
@@ -543,6 +568,8 @@ namespace Handbrake.Functions
         }\r
         #endregion\r
 \r
+        #endregion\r
+\r
         // Takes in a query which can be in any order and parses it. All varibles are then set so they can be used elsewhere.\r
         public static QueryParser Parse(String input)\r
         {\r
@@ -597,6 +624,7 @@ namespace Handbrake.Functions
             Match audioTrack1 = Regex.Match(input, @"-a ([0-9]*)");\r
             Match audioTrack2 = Regex.Match(input, @"-a ([0-9]*),([0-9]*)");\r
             Match forcedSubtitles = Regex.Match(input, @"-F");\r
+            Match drc = Regex.Match(input, @"-D ([0-9.]*)");\r
 \r
             //H264 Tab\r
             Match x264 = Regex.Match(input, @"-x ([,a-zA-Z0-9=:-]*)");\r
@@ -857,6 +885,16 @@ namespace Handbrake.Functions
                         thisQuery.q_subtitles = "None";\r
                 }\r
 \r
+                if (drc.Success != false)\r
+                {\r
+                    string value = drc.ToString().Replace("-D ", "");\r
+                    thisQuery.q_drc = double.Parse(value);\r
+                }\r
+                else\r
+                {\r
+                    thisQuery.q_drc = 0;\r
+                }\r
+\r
                 thisQuery.q_forcedSubs = forcedSubtitles.Success;\r
 \r
                 #endregion\r
index 40e640b..94b7cc4 100644 (file)
@@ -88,13 +88,6 @@ namespace Handbrake.Properties {
             }\r
         }\r
         \r
-        internal static System.Drawing.Bitmap folder {\r
-            get {\r
-                object obj = ResourceManager.GetObject("folder", resourceCulture);\r
-                return ((System.Drawing.Bitmap)(obj));\r
-            }\r
-        }\r
-        \r
         internal static System.Drawing.Bitmap General_Preferences {\r
             get {\r
                 object obj = ResourceManager.GetObject("General_Preferences", resourceCulture);\r
index f756599..37de7b2 100644 (file)
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />\r
-  <data name="folder" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
-    <value>..\Resources\folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
-  </data>\r
   <data name="General_Preferences" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
     <value>..\Resources\General Preferences.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
   </data>\r
index 5e7d93a..1aec8c4 100644 (file)
@@ -188,6 +188,9 @@ namespace Handbrake
             this.groupBox_dest = new System.Windows.Forms.GroupBox();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
             this.treeView_presets = new System.Windows.Forms.TreeView();\r
+            this.slider_drc = new System.Windows.Forms.TrackBar();\r
+            this.check_drc = new System.Windows.Forms.CheckBox();\r
+            this.lbl_drc = new System.Windows.Forms.Label();\r
             Label38 = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
             this.frmMainMenu.SuspendLayout();\r
@@ -205,6 +208,7 @@ namespace Handbrake
             this.advancedOptions.SuspendLayout();\r
             this.groupBox_dest.SuspendLayout();\r
             this.groupBox2.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_drc)).BeginInit();\r
             this.SuspendLayout();\r
             // \r
             // Label38\r
@@ -424,7 +428,7 @@ namespace Handbrake
             "112",\r
             "128",\r
             "160"});\r
-            this.drp_audioBitrate.Location = new System.Drawing.Point(113, 131);\r
+            this.drp_audioBitrate.Location = new System.Drawing.Point(113, 120);\r
             this.drp_audioBitrate.Name = "drp_audioBitrate";\r
             this.drp_audioBitrate.Size = new System.Drawing.Size(101, 21);\r
             this.drp_audioBitrate.TabIndex = 5;\r
@@ -442,7 +446,7 @@ namespace Handbrake
             "32",\r
             "24",\r
             "22.05"});\r
-            this.drp_audioSampleRate.Location = new System.Drawing.Point(366, 131);\r
+            this.drp_audioSampleRate.Location = new System.Drawing.Point(366, 120);\r
             this.drp_audioSampleRate.Name = "drp_audioSampleRate";\r
             this.drp_audioSampleRate.Size = new System.Drawing.Size(101, 21);\r
             this.drp_audioSampleRate.TabIndex = 6;\r
@@ -540,7 +544,7 @@ namespace Handbrake
             this.drp_subtitle.Items.AddRange(new object[] {\r
             "None",\r
             "Autoselect"});\r
-            this.drp_subtitle.Location = new System.Drawing.Point(113, 200);\r
+            this.drp_subtitle.Location = new System.Drawing.Point(111, 231);\r
             this.drp_subtitle.Name = "drp_subtitle";\r
             this.drp_subtitle.Size = new System.Drawing.Size(213, 21);\r
             this.drp_subtitle.TabIndex = 12;\r
@@ -1266,6 +1270,9 @@ namespace Handbrake
             // TabPage2\r
             // \r
             this.TabPage2.BackColor = System.Drawing.SystemColors.ControlLight;\r
+            this.TabPage2.Controls.Add(this.lbl_drc);\r
+            this.TabPage2.Controls.Add(this.check_drc);\r
+            this.TabPage2.Controls.Add(this.slider_drc);\r
             this.TabPage2.Controls.Add(this.check_forced);\r
             this.TabPage2.Controls.Add(this.drp_track2Audio);\r
             this.TabPage2.Controls.Add(this.label28);\r
@@ -1293,7 +1300,7 @@ namespace Handbrake
             // \r
             this.check_forced.AutoSize = true;\r
             this.check_forced.Enabled = false;\r
-            this.check_forced.Location = new System.Drawing.Point(332, 202);\r
+            this.check_forced.Location = new System.Drawing.Point(330, 233);\r
             this.check_forced.Name = "check_forced";\r
             this.check_forced.Size = new System.Drawing.Size(147, 17);\r
             this.check_forced.TabIndex = 17;\r
@@ -1340,7 +1347,7 @@ namespace Handbrake
             this.Label19.AutoSize = true;\r
             this.Label19.BackColor = System.Drawing.Color.Transparent;\r
             this.Label19.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label19.Location = new System.Drawing.Point(13, 170);\r
+            this.Label19.Location = new System.Drawing.Point(11, 210);\r
             this.Label19.Name = "Label19";\r
             this.Label19.Size = new System.Drawing.Size(64, 13);\r
             this.Label19.TabIndex = 10;\r
@@ -1351,7 +1358,7 @@ namespace Handbrake
             this.Label20.AutoSize = true;\r
             this.Label20.BackColor = System.Drawing.Color.Transparent;\r
             this.Label20.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label20.Location = new System.Drawing.Point(13, 203);\r
+            this.Label20.Location = new System.Drawing.Point(11, 234);\r
             this.Label20.Name = "Label20";\r
             this.Label20.Size = new System.Drawing.Size(61, 13);\r
             this.Label20.TabIndex = 11;\r
@@ -1387,7 +1394,7 @@ namespace Handbrake
             this.Label5.AutoSize = true;\r
             this.Label5.BackColor = System.Drawing.Color.Transparent;\r
             this.Label5.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label5.Location = new System.Drawing.Point(13, 105);\r
+            this.Label5.Location = new System.Drawing.Point(13, 94);\r
             this.Label5.Name = "Label5";\r
             this.Label5.Size = new System.Drawing.Size(94, 13);\r
             this.Label5.TabIndex = 0;\r
@@ -1398,7 +1405,7 @@ namespace Handbrake
             this.Label16.AutoSize = true;\r
             this.Label16.BackColor = System.Drawing.Color.Transparent;\r
             this.Label16.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label16.Location = new System.Drawing.Point(13, 134);\r
+            this.Label16.Location = new System.Drawing.Point(13, 123);\r
             this.Label16.Name = "Label16";\r
             this.Label16.Size = new System.Drawing.Size(91, 13);\r
             this.Label16.TabIndex = 1;\r
@@ -1420,7 +1427,7 @@ namespace Handbrake
             this.Label18.AutoSize = true;\r
             this.Label18.BackColor = System.Drawing.Color.Transparent;\r
             this.Label18.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.Label18.Location = new System.Drawing.Point(240, 134);\r
+            this.Label18.Location = new System.Drawing.Point(240, 123);\r
             this.Label18.Name = "Label18";\r
             this.Label18.Size = new System.Drawing.Size(120, 13);\r
             this.Label18.TabIndex = 2;\r
@@ -2094,6 +2101,42 @@ namespace Handbrake
             this.treeView_presets.TabIndex = 2;\r
             this.treeView_presets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_presets_AfterSelect);\r
             // \r
+            // slider_drc\r
+            // \r
+            this.slider_drc.Enabled = false;\r
+            this.slider_drc.LargeChange = 1;\r
+            this.slider_drc.Location = new System.Drawing.Point(259, 159);\r
+            this.slider_drc.Maximum = 30;\r
+            this.slider_drc.Name = "slider_drc";\r
+            this.slider_drc.Size = new System.Drawing.Size(167, 42);\r
+            this.slider_drc.TabIndex = 18;\r
+            this.slider_drc.TickFrequency = 2;\r
+            this.ToolTip.SetToolTip(this.slider_drc, "Dynamic Range Compression");\r
+            this.slider_drc.Scroll += new System.EventHandler(this.slider_drc_Scroll);\r
+            // \r
+            // check_drc\r
+            // \r
+            this.check_drc.AutoSize = true;\r
+            this.check_drc.Location = new System.Drawing.Point(16, 163);\r
+            this.check_drc.Name = "check_drc";\r
+            this.check_drc.Size = new System.Drawing.Size(237, 17);\r
+            this.check_drc.TabIndex = 19;\r
+            this.check_drc.Text = "Enable Dynamic Range Compression";\r
+            this.check_drc.UseVisualStyleBackColor = true;\r
+            this.check_drc.CheckedChanged += new System.EventHandler(this.check_drc_CheckedChanged);\r
+            // \r
+            // lbl_drc\r
+            // \r
+            this.lbl_drc.AutoSize = true;\r
+            this.lbl_drc.BackColor = System.Drawing.Color.Transparent;\r
+            this.lbl_drc.Enabled = false;\r
+            this.lbl_drc.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.lbl_drc.Location = new System.Drawing.Point(432, 164);\r
+            this.lbl_drc.Name = "lbl_drc";\r
+            this.lbl_drc.Size = new System.Drawing.Size(56, 13);\r
+            this.lbl_drc.TabIndex = 20;\r
+            this.lbl_drc.Text = "Disabled";\r
+            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
@@ -2144,6 +2187,7 @@ namespace Handbrake
             this.groupBox_dest.ResumeLayout(false);\r
             this.groupBox_dest.PerformLayout();\r
             this.groupBox2.ResumeLayout(false);\r
+            ((System.ComponentModel.ISupportInitialize)(this.slider_drc)).EndInit();\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
@@ -2308,6 +2352,9 @@ namespace Handbrake
         private System.Windows.Forms.CheckBox check_forced;\r
         internal System.Windows.Forms.ComboBox drp_track2Audio;\r
         internal System.Windows.Forms.Label label28;\r
+        internal System.Windows.Forms.TrackBar slider_drc;\r
+        private System.Windows.Forms.CheckBox check_drc;\r
+        internal System.Windows.Forms.Label lbl_drc;\r
 \r
     }\r
 }
\ No newline at end of file
index 23bffdb..786b7ac 100644 (file)
@@ -934,6 +934,31 @@ namespace Handbrake
             }\r
         }\r
 \r
+        private void slider_drc_Scroll(object sender, EventArgs e)\r
+        {\r
+            double value = slider_drc.Value / 10.0;\r
+            value++;\r
+\r
+            lbl_drc.Text = value.ToString();\r
+        }\r
+\r
+        private void check_drc_CheckedChanged(object sender, EventArgs e)\r
+        {\r
+            if (check_drc.CheckState == CheckState.Checked)\r
+            {\r
+                slider_drc.Enabled = true;\r
+                lbl_drc.Enabled = true;\r
+                lbl_drc.Text = "1";\r
+            }\r
+            else\r
+            {\r
+                slider_drc.Enabled = false;\r
+                slider_drc.Value = 0;\r
+                lbl_drc.Enabled = false;\r
+                lbl_drc.Text = "Disabled";\r
+            }\r
+        }\r
+\r
         private void drp_subtitle_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             if (drp_subtitle.Text.Contains("None"))\r
@@ -1073,8 +1098,6 @@ namespace Handbrake
         // Preset Selection\r
         private void treeView_presets_AfterSelect(object sender, TreeViewEventArgs e)\r
         {\r
-\r
-\r
             string selectedPreset = null;\r
             selectedPreset = treeView_presets.SelectedNode.Text;\r
 \r
@@ -1090,6 +1113,7 @@ namespace Handbrake
                         string preset = presetInput.ReadLine().Replace("+ ", "");\r
                         Regex r = new Regex("(:  )"); // Split on hyphens. \r
                         string[] presetName = r.Split(preset);\r
+                        \r
 \r
                         if (selectedPreset == presetName[0])\r
                         {\r
@@ -1576,6 +1600,7 @@ namespace Handbrake
             string subtitles = drp_subtitle.Text;\r
             string subScan = "";\r
             string forced = "";\r
+            string drc = "";\r
 \r
             if (audioBitrate != "")\r
                 audioBitrate = " -B " + audioBitrate;\r
@@ -1666,9 +1691,17 @@ namespace Handbrake
             }\r
 \r
             if (check_forced.Checked)\r
-                forced = "-F";\r
+                forced = " -F ";\r
 \r
-            string queryAudioSettings = audioBitrate + audioSampleRate + audioChannels + SixChannelAudio + subScan + subtitles + forced;\r
+            if (check_drc.Checked)\r
+            {\r
+                double value = slider_drc.Value / 10.0;\r
+                value++;\r
+\r
+                drc = " -D " + value;\r
+            }\r
+\r
+            string queryAudioSettings = audioBitrate + audioSampleRate + drc + audioChannels + SixChannelAudio + subScan + subtitles + forced;\r
             #endregion\r
 \r
             // H264 Tab\r
@@ -1875,6 +1908,18 @@ namespace Handbrake
             }\r
             else\r
                 check_forced.CheckState = CheckState.Unchecked;\r
+\r
+            if (presetQuery.DRC != 0)\r
+            {\r
+                check_drc.Checked = true;\r
+                double value = presetQuery.DRC * 10;\r
+                slider_drc.Value = int.Parse(value.ToString());\r
+                lbl_drc.Text = presetQuery.DRC.ToString();\r
+\r
+            }\r
+            else\r
+                check_drc.Checked = false;\r
+\r
             #endregion\r
 \r
             // H264 Tab & Preset Name\r
@@ -1980,11 +2025,6 @@ namespace Handbrake
 \r
         #endregion\r
 \r
-\r
-\r
-\r
-\r
-\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }
\ No newline at end of file