diff options
author | sr55 <[email protected]> | 2010-04-14 19:56:36 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-04-14 19:56:36 +0000 |
commit | 75dabf6f175daeddcb517b57fb23ec54396d4e00 (patch) | |
tree | 34e78b7f3fb7c0d5485ad0227c5dc5499d3b9d1b /win | |
parent | 11da8e43bff624ee1dea51c99969ca5f97e44723 (diff) |
WinGui:
- Enabled higher bitrate audio for aac.
- Catch exceptions at application startup.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3224 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/Controls/AudioPanel.cs | 54 | ||||
-rw-r--r-- | win/C#/Program.cs | 16 | ||||
-rw-r--r-- | win/C#/frmUpdater.Designer.cs | 24 |
3 files changed, 70 insertions, 24 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs index 6b96940eb..7023d5642 100644 --- a/win/C#/Controls/AudioPanel.cs +++ b/win/C#/Controls/AudioPanel.cs @@ -419,6 +419,34 @@ namespace Handbrake.Controls }
}
+
+ private void SetBitrate2()
+ {
+ int max = 0;
+ switch (drp_audioEncoder.Text)
+ {
+ case "AAC (faac)":
+ max = drp_audioMix.Text.Contains("6 Channel") ? 384 : 160;
+ break;
+ case "MP3 (lame)":
+ max = 320;
+ break;
+ case "Vorbis (vorbis)":
+ max = 384;
+ break;
+ case "AC3 Passthru":
+ drp_audioBitrate.Items.Add("Auto");
+ drp_audioBitrate.SelectedItem = "Auto";
+ drp_audioSample.SelectedItem = "Auto";
+ break;
+ case "DTS Passthru":
+ drp_audioBitrate.Items.Add("Auto");
+ drp_audioBitrate.SelectedItem = "Auto";
+ drp_audioSample.SelectedItem = "Auto";
+ break;
+ }
+ }
+
private void SetBitrate()
{
int max = 0;
@@ -427,11 +455,14 @@ namespace Handbrake.Controls drp_audioBitrate.Items.Remove("224");
drp_audioBitrate.Items.Remove("256");
drp_audioBitrate.Items.Remove("320");
+ drp_audioBitrate.Items.Remove("384");
+ drp_audioBitrate.Items.Remove("448");
+ drp_audioBitrate.Items.Remove("768");
switch (drp_audioEncoder.Text)
{
case "AAC (faac)":
- max = drp_audioMix.Text.Contains("6 Channel") ? 384 : 160;
+ max = drp_audioMix.Text.Contains("6 Channel") ? 768 : 320;
break;
case "MP3 (lame)":
max = 320;
@@ -457,21 +488,20 @@ namespace Handbrake.Controls drp_audioBitrate.Items.Add("224");
drp_audioBitrate.Items.Add("256");
drp_audioBitrate.Items.Add("320");
- if (max == 384)
- drp_audioBitrate.Items.Add("384");
- else
- drp_audioBitrate.Items.Remove("384");
}
- else
+
+ if (max > 320)
+ {
+ drp_audioBitrate.Items.Add("384");
+ }
+
+ if (max == 768)
{
- drp_audioBitrate.Items.Remove("192");
- drp_audioBitrate.Items.Remove("224");
- drp_audioBitrate.Items.Remove("256");
- drp_audioBitrate.Items.Remove("320");
- drp_audioBitrate.Items.Remove("384");
+ drp_audioBitrate.Items.Add("448");
+ drp_audioBitrate.Items.Add("768");
}
- if (drp_audioBitrate.SelectedItem == null)
+ if (drp_audioBitrate.SelectedItem == null)
drp_audioBitrate.SelectedIndex = drp_audioBitrate.Items.Count - 1;
}
diff --git a/win/C#/Program.cs b/win/C#/Program.cs index 3085664fc..2bd66db5b 100644 --- a/win/C#/Program.cs +++ b/win/C#/Program.cs @@ -21,6 +21,8 @@ namespace Handbrake [STAThread]
public static void Main()
{
+ AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+
const string failedInstall = "HandBrake is not installed properly. Please reinstall HandBrake. \n\n";
const string nightlyCLIMissing =
"If you have downloaded the \"HandBrakeGUI\" nightly, " +
@@ -61,5 +63,19 @@ namespace Handbrake Application.Run(new frmMain());
}
}
+
+ /// <summary>
+ /// Throw up an error message for any unhandled exceptions.
+ /// </summary>
+ /// <param name="sender">The sender</param>
+ /// <param name="e">Unhandled Exception EventArgs </param>
+ private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ MessageBox.Show(
+ "An unexpected error has occured.\n\nSender:" + sender + "\n\nException:" + e.ExceptionObject,
+ "Unhandled Exception",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
}
}
\ No newline at end of file diff --git a/win/C#/frmUpdater.Designer.cs b/win/C#/frmUpdater.Designer.cs index af529ccf4..3e2f8708c 100644 --- a/win/C#/frmUpdater.Designer.cs +++ b/win/C#/frmUpdater.Designer.cs @@ -44,13 +44,13 @@ namespace Handbrake this.PictureBox1 = new System.Windows.Forms.PictureBox();
this.lbl_update_text = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
+ this.panel2 = new System.Windows.Forms.Panel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.panel3 = new System.Windows.Forms.Panel();
this.panel5 = new System.Windows.Forms.Panel();
this.wBrowser = new System.Windows.Forms.WebBrowser();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.button_container = new System.Windows.Forms.SplitContainer();
- this.panel2 = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.PictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
@@ -172,6 +172,17 @@ namespace Handbrake this.panel1.Size = new System.Drawing.Size(710, 97);
this.panel1.TabIndex = 60;
//
+ // panel2
+ //
+ this.panel2.BackColor = System.Drawing.SystemColors.Control;
+ this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panel2.Location = new System.Drawing.Point(0, 87);
+ this.panel2.MaximumSize = new System.Drawing.Size(0, 10);
+ this.panel2.MinimumSize = new System.Drawing.Size(0, 10);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(710, 10);
+ this.panel2.TabIndex = 59;
+ //
// statusStrip1
//
this.statusStrip1.Location = new System.Drawing.Point(0, 346);
@@ -244,17 +255,6 @@ namespace Handbrake this.button_container.SplitterDistance = 318;
this.button_container.TabIndex = 0;
//
- // panel2
- //
- this.panel2.BackColor = System.Drawing.SystemColors.Control;
- this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panel2.Location = new System.Drawing.Point(0, 87);
- this.panel2.MaximumSize = new System.Drawing.Size(0, 10);
- this.panel2.MinimumSize = new System.Drawing.Size(0, 10);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(710, 10);
- this.panel2.TabIndex = 59;
- //
// frmUpdater
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|