WinGui:
authorsr55 <sr55.hb@outlook.com>
Fri, 29 Apr 2011 20:04:21 +0000 (20:04 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 29 Apr 2011 20:04:21 +0000 (20:04 +0000)
- Fixes to the Audio Panel. Should fix some possible enum helper exceptions and properly select the mixdown.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3969 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/Controls/AudioPanel.cs
win/CS/frmMain.Designer.cs
win/CS/frmMain.resx

index 736789f376ccdb85f64f721be1488de95c5b021b..5d5c59a85ead46b3cb5414126873bda922179c98 100644 (file)
@@ -269,8 +269,7 @@ namespace Handbrake.Controls
                     }\r
                     break;\r
                 case "drp_audioEncoder":\r
-                    SetMixDown();\r
-                    SetBitrate();\r
+                    SetMixDown(EnumHelper<Mixdown>.GetDescription(track.MixDown));\r
 \r
                     // Configure the widgets with values\r
                     if (drp_audioEncoder.Text.Contains(AC3Passthru) || drp_audioEncoder.Text.Contains(DTSPassthru))\r
@@ -287,19 +286,22 @@ namespace Handbrake.Controls
                     // Update an item in the Audio list if required.\r
                     track.Encoder = EnumHelper<AudioEncoder>.GetValue(drp_audioEncoder.Text);\r
 \r
-                    // Just make sure we don't have the wrong mixdown set, if we do fix it.\r
-                    if (track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough || track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough)\r
-                    {\r
-                        if (track.Encoder != AudioEncoder.Ac3Passthrough && track.Encoder != AudioEncoder.DtsPassthrough)\r
-                        {\r
-                            drp_audioMix.SelectedItem = "Dolby Pro Logic II";\r
-                        }\r
-                    }\r
+                    //// Just make sure we don't have the wrong mixdown set, if we do fix it.\r
+                    //if (track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough || track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough)\r
+                    //{\r
+                    //    if (track.Encoder != AudioEncoder.Ac3Passthrough && track.Encoder != AudioEncoder.DtsPassthrough)\r
+                    //    {\r
+                    //        drp_audioMix.SelectedItem = "Dolby Pro Logic II";\r
+                    //    }\r
+                    //}\r
                     break;\r
                 case "drp_audioMix":\r
                     SetBitrate();\r
 \r
-                    track.MixDown = EnumHelper<Mixdown>.GetValue(drp_audioMix.Text);\r
+                    if (drp_audioMix.SelectedItem != null)\r
+                    {\r
+                        track.MixDown = EnumHelper<Mixdown>.GetValue(drp_audioMix.Text);\r
+                    }\r
 \r
                     break;\r
                 case "drp_audioSample":\r
@@ -730,7 +732,10 @@ namespace Handbrake.Controls
         /// <summary>\r
         /// Set the mixdown dropdown\r
         /// </summary>\r
-        private void SetMixDown()\r
+        /// <param name="currentMixdown">\r
+        /// The current Mixdown.\r
+        /// </param>\r
+        private void SetMixDown(string currentMixdown)\r
         {\r
             drp_audioMix.Items.Clear();\r
             drp_audioMix.Items.Add("Mono");\r
@@ -746,19 +751,23 @@ namespace Handbrake.Controls
                 case "AAC (faac)":\r
                     drp_audioMix.Items.Remove(AC3Passthru);\r
                     drp_audioMix.Items.Remove(DTSPassthru);\r
+                    drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";\r
                     break;\r
                 case "MP3 (lame)":\r
                     drp_audioMix.Items.Remove("6 Channel Discrete");\r
                     drp_audioMix.Items.Remove(AC3Passthru);\r
                     drp_audioMix.Items.Remove(DTSPassthru);\r
+                    drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";\r
                     break;\r
                 case "Vorbis (vorbis)":\r
                     drp_audioMix.Items.Remove(AC3Passthru);\r
                     drp_audioMix.Items.Remove(DTSPassthru);\r
+                    drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";\r
                     break;\r
                 case "AC3 (ffmpeg)":\r
                     drp_audioMix.Items.Remove(AC3Passthru);\r
                     drp_audioMix.Items.Remove(DTSPassthru);\r
+                    drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";\r
                     break;\r
                 case "AC3 Passthru":\r
                     drp_audioMix.SelectedItem = AC3Passthru;\r
@@ -767,6 +776,11 @@ namespace Handbrake.Controls
                     drp_audioMix.SelectedItem = DTSPassthru;\r
                     break;\r
             }\r
+\r
+            if (drp_audioMix.SelectedItem == null)\r
+            {\r
+                drp_audioMix.SelectedItem = "Dolby Pro Logic II";\r
+            }\r
         }\r
 \r
         #endregion\r
index 3ef2755df9efeea93b049f3dbbbe292f6693cf19..129271dcdb63eb7de959fff050b51dcf5bbe6233 100644 (file)
@@ -287,7 +287,7 @@ namespace Handbrake
             this.check_turbo.Enabled = false;\r
             this.check_turbo.Location = new System.Drawing.Point(495, 134);\r
             this.check_turbo.Name = "check_turbo";\r
-            this.check_turbo.Size = new System.Drawing.Size(99, 17);\r
+            this.check_turbo.Size = new System.Drawing.Size(101, 17);\r
             this.check_turbo.TabIndex = 9;\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
@@ -557,7 +557,7 @@ namespace Handbrake
             this.radio_cq.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_cq.Location = new System.Drawing.Point(366, 37);\r
             this.radio_cq.Name = "radio_cq";\r
-            this.radio_cq.Size = new System.Drawing.Size(105, 17);\r
+            this.radio_cq.Size = new System.Drawing.Size(110, 17);\r
             this.radio_cq.TabIndex = 3;\r
             this.radio_cq.Text = "Constant Quality:";\r
             this.ToolTip.SetToolTip(this.radio_cq, resources.GetString("radio_cq.ToolTip"));\r
@@ -571,7 +571,7 @@ namespace Handbrake
             this.radio_avgBitrate.Checked = true;\r
             this.radio_avgBitrate.Location = new System.Drawing.Point(367, 108);\r
             this.radio_avgBitrate.Name = "radio_avgBitrate";\r
-            this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);\r
+            this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);\r
             this.radio_avgBitrate.TabIndex = 4;\r
             this.radio_avgBitrate.TabStop = true;\r
             this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";\r
@@ -585,7 +585,7 @@ namespace Handbrake
             this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;\r
             this.check_2PassEncode.Location = new System.Drawing.Point(385, 134);\r
             this.check_2PassEncode.Name = "check_2PassEncode";\r
-            this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);\r
+            this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);\r
             this.check_2PassEncode.TabIndex = 10;\r
             this.check_2PassEncode.Text = "2-Pass Encoding";\r
             this.ToolTip.SetToolTip(this.check_2PassEncode, resources.GetString("check_2PassEncode.ToolTip"));\r
@@ -873,7 +873,7 @@ namespace Handbrake
             this.radio_constantFramerate.Checked = true;\r
             this.radio_constantFramerate.Location = new System.Drawing.Point(0, 0);\r
             this.radio_constantFramerate.Name = "radio_constantFramerate";\r
-            this.radio_constantFramerate.Size = new System.Drawing.Size(117, 17);\r
+            this.radio_constantFramerate.Size = new System.Drawing.Size(122, 17);\r
             this.radio_constantFramerate.TabIndex = 17;\r
             this.radio_constantFramerate.TabStop = true;\r
             this.radio_constantFramerate.Text = "Constant Framerate";\r
@@ -885,7 +885,7 @@ namespace Handbrake
             this.radio_peakAndVariable.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_peakAndVariable.Location = new System.Drawing.Point(0, 23);\r
             this.radio_peakAndVariable.Name = "radio_peakAndVariable";\r
-            this.radio_peakAndVariable.Size = new System.Drawing.Size(113, 17);\r
+            this.radio_peakAndVariable.Size = new System.Drawing.Size(116, 17);\r
             this.radio_peakAndVariable.TabIndex = 19;\r
             this.radio_peakAndVariable.Text = "Variable Framerate";\r
             this.radio_peakAndVariable.UseVisualStyleBackColor = false;\r
@@ -963,7 +963,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(136, 17);\r
+            this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);\r
             this.Check_ChapterMarkers.TabIndex = 4;\r
             this.Check_ChapterMarkers.Text = "Create chapter markers";\r
             this.Check_ChapterMarkers.UseVisualStyleBackColor = false;\r
index 9ec3659189618263094a485e196663d17318b7bc..a737bb095ca8bf7eac77b277d888f8dc3cc4a077 100644 (file)
@@ -640,18 +640,6 @@ Clear the text box below to return to the internal query generation.</value>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
     <value>98</value>\r
   </metadata>\r
-  <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>664, 15</value>\r
-  </metadata>\r
-  <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>310, 54</value>\r
-  </metadata>\r
-  <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
-    <value>423, 54</value>\r
-  </metadata>\r
-  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>98</value>\r
-  </metadata>\r
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
     <value>\r
         AAABAAYAMDAAAAEACACoDgAAZgAAACAgAAABAAgAqAgAAA4PAAAQEAAAAQAIAGgFAAC2FwAAMDAAAAEA\r
@@ -1031,4 +1019,13 @@ Clear the text box below to return to the internal query generation.</value>
         AAD6AQAA4AEAAMABAACAAQAAgAEAAMBBAADAYQAAjGEAAIRhAADc+wAA3/8AAA==\r
 </value>\r
   </data>\r
+  <metadata name="File_Save.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>664, 15</value>\r
+  </metadata>\r
+  <metadata name="openPreset.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>310, 54</value>\r
+  </metadata>\r
+  <metadata name="File_ChapterImport.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>423, 54</value>\r
+  </metadata>\r
 </root>
\ No newline at end of file