diff options
author | sr55 <[email protected]> | 2011-04-30 12:49:44 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-30 12:49:44 +0000 |
commit | 89e5b03264f0b272da9861a3f4a74adf235a10a6 (patch) | |
tree | 77dbd9528d8d8d15d5a8354c38bea049fda40528 /win/CS/Controls/AudioPanel.cs | |
parent | 1cd4e576275a12275601da3dce5a2b11a638644d (diff) |
WinGui:
- Fix an issue where the user could overwrite a built-in preset.
- Fix some more audio issues in relation to incorrect bitrate and sample rate being selected.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3970 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/Controls/AudioPanel.cs')
-rw-r--r-- | win/CS/Controls/AudioPanel.cs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs index 5d5c59a85..ff56a1330 100644 --- a/win/CS/Controls/AudioPanel.cs +++ b/win/CS/Controls/AudioPanel.cs @@ -92,7 +92,7 @@ namespace Handbrake.Controls if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough)
{
passthruTracks += track.ScannedTrack.Bitrate;
- }
+ }
else
{
encodedTracks += track.Bitrate;
@@ -286,17 +286,9 @@ 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";
- // }
- //}
break;
case "drp_audioMix":
- SetBitrate();
+ SetBitrate(track.Bitrate);
if (drp_audioMix.SelectedItem != null)
{
@@ -342,8 +334,8 @@ namespace Handbrake.Controls drp_audioTrack.SelectedItem = track.ScannedTrack;
drp_audioEncoder.SelectedItem = EnumHelper<AudioEncoder>.GetDescription(track.Encoder);
drp_audioMix.SelectedItem = EnumHelper<Mixdown>.GetDescription(track.MixDown);
- drp_audioSample.SelectedItem = track.SampleRate;
- drp_audioBitrate.SelectedItem = track.Bitrate;
+ drp_audioSample.SelectedItem = track.SampleRateDisplayValue;
+ drp_audioBitrate.SelectedItem = track.BitRateDisplayValue;
// Set the Advanced Control.
if (!advancedAudio.IsDisposed)
@@ -653,7 +645,10 @@ namespace Handbrake.Controls /// <summary>
/// Set the bitrate dropdown
/// </summary>
- private void SetBitrate()
+ /// <param name="currentValue">
+ /// The current Value.
+ /// </param>
+ private void SetBitrate(int currentValue)
{
int max = 0;
string defaultRate = "160";
@@ -725,8 +720,16 @@ namespace Handbrake.Controls drp_audioBitrate.Items.Add("768");
}
- // Set the default bit-rate
- drp_audioBitrate.SelectedItem = defaultRate;
+ // Set the Current Value, or default value if the value is out of bounds
+
+ if (currentValue <= max && currentValue != 0)
+ {
+ drp_audioBitrate.SelectedItem = currentValue.ToString();
+ }
+ else
+ {
+ drp_audioBitrate.SelectedItem = defaultRate;
+ }
}
/// <summary>
|