summaryrefslogtreecommitdiffstats
path: root/win/CS/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-04-29 20:04:21 +0000
committersr55 <[email protected]>2011-04-29 20:04:21 +0000
commit1cd4e576275a12275601da3dce5a2b11a638644d (patch)
treed7eb77d103657ba5abafb8d6733df34dbaaf1da7 /win/CS/Controls
parent912b0faed188f7908718833f0ec27b343f0d2a53 (diff)
WinGui:
- 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
Diffstat (limited to 'win/CS/Controls')
-rw-r--r--win/CS/Controls/AudioPanel.cs38
1 files changed, 26 insertions, 12 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 736789f37..5d5c59a85 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -269,8 +269,7 @@ namespace Handbrake.Controls
}
break;
case "drp_audioEncoder":
- SetMixDown();
- SetBitrate();
+ SetMixDown(EnumHelper<Mixdown>.GetDescription(track.MixDown));
// Configure the widgets with values
if (drp_audioEncoder.Text.Contains(AC3Passthru) || drp_audioEncoder.Text.Contains(DTSPassthru))
@@ -287,19 +286,22 @@ namespace Handbrake.Controls
// Update an item in the Audio list if required.
track.Encoder = EnumHelper<AudioEncoder>.GetValue(drp_audioEncoder.Text);
- // Just make sure we don't have the wrong mixdown set, if we do fix it.
- if (track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough || track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough)
- {
- if (track.Encoder != AudioEncoder.Ac3Passthrough && track.Encoder != AudioEncoder.DtsPassthrough)
- {
- drp_audioMix.SelectedItem = "Dolby Pro Logic II";
- }
- }
+ //// Just make sure we don't have the wrong mixdown set, if we do fix it.
+ //if (track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough || track.MixDown == HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough)
+ //{
+ // if (track.Encoder != AudioEncoder.Ac3Passthrough && track.Encoder != AudioEncoder.DtsPassthrough)
+ // {
+ // drp_audioMix.SelectedItem = "Dolby Pro Logic II";
+ // }
+ //}
break;
case "drp_audioMix":
SetBitrate();
- track.MixDown = EnumHelper<Mixdown>.GetValue(drp_audioMix.Text);
+ if (drp_audioMix.SelectedItem != null)
+ {
+ track.MixDown = EnumHelper<Mixdown>.GetValue(drp_audioMix.Text);
+ }
break;
case "drp_audioSample":
@@ -730,7 +732,10 @@ namespace Handbrake.Controls
/// <summary>
/// Set the mixdown dropdown
/// </summary>
- private void SetMixDown()
+ /// <param name="currentMixdown">
+ /// The current Mixdown.
+ /// </param>
+ private void SetMixDown(string currentMixdown)
{
drp_audioMix.Items.Clear();
drp_audioMix.Items.Add("Mono");
@@ -746,19 +751,23 @@ namespace Handbrake.Controls
case "AAC (faac)":
drp_audioMix.Items.Remove(AC3Passthru);
drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "MP3 (lame)":
drp_audioMix.Items.Remove("6 Channel Discrete");
drp_audioMix.Items.Remove(AC3Passthru);
drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "Vorbis (vorbis)":
drp_audioMix.Items.Remove(AC3Passthru);
drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "AC3 (ffmpeg)":
drp_audioMix.Items.Remove(AC3Passthru);
drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "AC3 Passthru":
drp_audioMix.SelectedItem = AC3Passthru;
@@ -767,6 +776,11 @@ namespace Handbrake.Controls
drp_audioMix.SelectedItem = DTSPassthru;
break;
}
+
+ if (drp_audioMix.SelectedItem == null)
+ {
+ drp_audioMix.SelectedItem = "Dolby Pro Logic II";
+ }
}
#endregion