OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 14 Apr 2010 19:56:36 +0000 (19:56 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 14 Apr 2010 19:56:36 +0000 (19:56 +0000)
- Enabled higher bitrate audio for aac.
- Catch exceptions at application startup.

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

win/C#/Controls/AudioPanel.cs
win/C#/Program.cs
win/C#/frmUpdater.Designer.cs

index 6b96940..7023d56 100644 (file)
@@ -419,6 +419,34 @@ namespace Handbrake.Controls
             }\r
         }\r
 \r
+\r
+        private void SetBitrate2()\r
+        {\r
+            int max = 0;\r
+            switch (drp_audioEncoder.Text)\r
+            {\r
+                case "AAC (faac)":\r
+                    max = drp_audioMix.Text.Contains("6 Channel") ? 384 : 160;\r
+                    break;\r
+                case "MP3 (lame)":\r
+                    max = 320;\r
+                    break;\r
+                case "Vorbis (vorbis)":\r
+                    max = 384;\r
+                    break;\r
+                case "AC3 Passthru":\r
+                    drp_audioBitrate.Items.Add("Auto");\r
+                    drp_audioBitrate.SelectedItem = "Auto";\r
+                    drp_audioSample.SelectedItem = "Auto";\r
+                    break;\r
+                case "DTS Passthru":\r
+                    drp_audioBitrate.Items.Add("Auto");\r
+                    drp_audioBitrate.SelectedItem = "Auto";\r
+                    drp_audioSample.SelectedItem = "Auto";\r
+                    break;\r
+            }\r
+        }\r
+\r
         private void SetBitrate()\r
         {\r
             int max = 0;\r
@@ -427,11 +455,14 @@ namespace Handbrake.Controls
             drp_audioBitrate.Items.Remove("224");\r
             drp_audioBitrate.Items.Remove("256");\r
             drp_audioBitrate.Items.Remove("320");\r
+            drp_audioBitrate.Items.Remove("384");\r
+            drp_audioBitrate.Items.Remove("448");\r
+            drp_audioBitrate.Items.Remove("768");\r
 \r
             switch (drp_audioEncoder.Text)\r
             {\r
                 case "AAC (faac)":\r
-                    max = drp_audioMix.Text.Contains("6 Channel") ? 384 : 160;\r
+                    max = drp_audioMix.Text.Contains("6 Channel") ? 768 : 320;\r
                     break;\r
                 case "MP3 (lame)":\r
                     max = 320;\r
@@ -457,21 +488,20 @@ namespace Handbrake.Controls
                 drp_audioBitrate.Items.Add("224");\r
                 drp_audioBitrate.Items.Add("256");\r
                 drp_audioBitrate.Items.Add("320");\r
-                if (max == 384)\r
-                    drp_audioBitrate.Items.Add("384");\r
-                else\r
-                    drp_audioBitrate.Items.Remove("384");\r
             }\r
-            else\r
+\r
+            if (max > 320)\r
+            {\r
+                drp_audioBitrate.Items.Add("384");\r
+            }\r
+\r
+            if (max == 768)\r
             {\r
-                drp_audioBitrate.Items.Remove("192");\r
-                drp_audioBitrate.Items.Remove("224");\r
-                drp_audioBitrate.Items.Remove("256");\r
-                drp_audioBitrate.Items.Remove("320");\r
-                drp_audioBitrate.Items.Remove("384");\r
+                drp_audioBitrate.Items.Add("448");\r
+                drp_audioBitrate.Items.Add("768");\r
             }\r
 \r
-            if (drp_audioBitrate.SelectedItem == null)\r
+             if (drp_audioBitrate.SelectedItem == null)\r
                 drp_audioBitrate.SelectedIndex = drp_audioBitrate.Items.Count - 1;\r
         }\r
 \r
index 3085664..2bd66db 100644 (file)
@@ -21,6 +21,8 @@ namespace Handbrake
         [STAThread]\r
         public static void Main()\r
         {\r
+            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);\r
+\r
             const string failedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";\r
             const string nightlyCLIMissing =\r
                 "If you have downloaded the \"HandBrakeGUI\" nightly, " +\r
@@ -61,5 +63,19 @@ namespace Handbrake
                 Application.Run(new frmMain());\r
             }\r
         }\r
+\r
+        /// <summary>\r
+        /// Throw up an error message for any unhandled exceptions.\r
+        /// </summary>\r
+        /// <param name="sender">The sender</param>\r
+        /// <param name="e">Unhandled Exception EventArgs </param>\r
+        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)\r
+        {\r
+            MessageBox.Show(\r
+                "An unexpected error has occured.\n\nSender:" + sender + "\n\nException:" + e.ExceptionObject, \r
+                "Unhandled Exception",\r
+                MessageBoxButtons.OK,\r
+                MessageBoxIcon.Error);\r
+        }\r
     }\r
 }
\ No newline at end of file
index af529cc..3e2f870 100644 (file)
@@ -44,13 +44,13 @@ namespace Handbrake
             this.PictureBox1 = new System.Windows.Forms.PictureBox();\r
             this.lbl_update_text = new System.Windows.Forms.Label();\r
             this.panel1 = new System.Windows.Forms.Panel();\r
+            this.panel2 = new System.Windows.Forms.Panel();\r
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();\r
             this.panel3 = new System.Windows.Forms.Panel();\r
             this.panel5 = new System.Windows.Forms.Panel();\r
             this.wBrowser = new System.Windows.Forms.WebBrowser();\r
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();\r
             this.button_container = new System.Windows.Forms.SplitContainer();\r
-            this.panel2 = new System.Windows.Forms.Panel();\r
             ((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();\r
             this.panel1.SuspendLayout();\r
             this.splitContainer1.Panel1.SuspendLayout();\r
@@ -172,6 +172,17 @@ namespace Handbrake
             this.panel1.Size = new System.Drawing.Size(710, 97);\r
             this.panel1.TabIndex = 60;\r
             // \r
+            // panel2\r
+            // \r
+            this.panel2.BackColor = System.Drawing.SystemColors.Control;\r
+            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;\r
+            this.panel2.Location = new System.Drawing.Point(0, 87);\r
+            this.panel2.MaximumSize = new System.Drawing.Size(0, 10);\r
+            this.panel2.MinimumSize = new System.Drawing.Size(0, 10);\r
+            this.panel2.Name = "panel2";\r
+            this.panel2.Size = new System.Drawing.Size(710, 10);\r
+            this.panel2.TabIndex = 59;\r
+            // \r
             // statusStrip1\r
             // \r
             this.statusStrip1.Location = new System.Drawing.Point(0, 346);\r
@@ -244,17 +255,6 @@ namespace Handbrake
             this.button_container.SplitterDistance = 318;\r
             this.button_container.TabIndex = 0;\r
             // \r
-            // panel2\r
-            // \r
-            this.panel2.BackColor = System.Drawing.SystemColors.Control;\r
-            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;\r
-            this.panel2.Location = new System.Drawing.Point(0, 87);\r
-            this.panel2.MaximumSize = new System.Drawing.Size(0, 10);\r
-            this.panel2.MinimumSize = new System.Drawing.Size(0, 10);\r
-            this.panel2.Name = "panel2";\r
-            this.panel2.Size = new System.Drawing.Size(710, 10);\r
-            this.panel2.TabIndex = 59;\r
-            // \r
             // frmUpdater\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r