summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-06-22 17:31:53 +0000
committersr55 <[email protected]>2011-06-22 17:31:53 +0000
commit18a1a18f43a9f90eaae4eb288885e5b19048454d (patch)
tree085a06997335af23a56516fb68743c6f4b9b9716 /win
parentf9a3d3cd8dbb41d95e4d37c4e54f7a3c3bee9edd (diff)
WinGui: Add DTS-HD Passthru support and a bit of code tidy-up.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4076 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/CS/Controls/AudioPanel.cs55
-rw-r--r--win/CS/Functions/QueryGenerator.cs66
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/Converters.cs11
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs7
6 files changed, 42 insertions, 103 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index d68650ad7..fefd694ac 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -28,8 +28,7 @@ namespace Handbrake.Controls
{
#region Private Variables
private readonly BindingList<AudioTrack> audioTracks = new BindingList<AudioTrack>();
- private const string AC3Passthru = "AC3 Passthru";
- private const string DTSPassthru = "DTS Passthru";
+ private const string Passthru = "Passthru";
private AdvancedAudio advancedAudio = new AdvancedAudio();
#endregion
@@ -130,6 +129,7 @@ namespace Handbrake.Controls
if (path.Contains("MKV"))
{
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.DtsPassthrough));
+ drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.DtsHDPassthrough));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Vorbis));
}
@@ -145,7 +145,7 @@ namespace Handbrake.Controls
/// <returns>True if m4v is required</returns>
public bool RequiresM4V()
{
- return this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Ac3);
+ return this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.Ac3);
}
/// <summary>
@@ -161,15 +161,9 @@ namespace Handbrake.Controls
foreach (AudioTrack track in tracks)
{
- if (track.Encoder == AudioEncoder.Ac3Passthrough)
+ if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough || track.Encoder == AudioEncoder.DtsHDPassthrough)
{
- track.MixDown = HandBrake.ApplicationServices.Model.Encoding.Mixdown.Ac3Passthrough;
- track.Bitrate = 0;
- }
-
- if (track.Encoder == AudioEncoder.DtsPassthrough)
- {
- track.MixDown = HandBrake.ApplicationServices.Model.Encoding.Mixdown.DtsPassthrough;
+ track.MixDown = HandBrake.ApplicationServices.Model.Encoding.Mixdown.Passthrough;
track.Bitrate = 0;
}
@@ -279,7 +273,7 @@ namespace Handbrake.Controls
SetMixDown(EnumHelper<Mixdown>.GetDescription(track.MixDown));
// Configure the widgets with values
- if (drp_audioEncoder.Text.Contains(AC3Passthru) || drp_audioEncoder.Text.Contains(DTSPassthru))
+ if (drp_audioEncoder.Text.Contains(Passthru))
{
drp_audioMix.Enabled = drp_audioBitrate.Enabled = drp_audioSample.Enabled = btn_AdvancedAudio.Enabled = false;
track.Gain = 0;
@@ -754,16 +748,13 @@ namespace Handbrake.Controls
defaultRate = "640";
max = 640;
break;
- case AC3Passthru:
- drp_audioBitrate.Items.Add("Auto");
- defaultRate = "Auto";
- drp_audioSample.SelectedItem = "Auto";
- break;
- case DTSPassthru:
- drp_audioBitrate.Items.Add("Auto");
- defaultRate = "Auto";
- drp_audioSample.SelectedItem = "Auto";
- break;
+ }
+
+ if (drp_audioEncoder.Text.Contains(Passthru))
+ {
+ drp_audioBitrate.Items.Add("Auto");
+ defaultRate = "Auto";
+ drp_audioSample.SelectedItem = "Auto";
}
// Re-add appropiate options
@@ -817,38 +808,32 @@ namespace Handbrake.Controls
drp_audioMix.Items.Add("Dolby Surround");
drp_audioMix.Items.Add("Dolby Pro Logic II");
drp_audioMix.Items.Add("6 Channel Discrete");
- drp_audioMix.Items.Add(AC3Passthru);
- drp_audioMix.Items.Add(DTSPassthru);
+ drp_audioMix.Items.Add(Passthru);
switch (drp_audioEncoder.Text)
{
case "AAC (faac)":
case "AAC (ffmpeg)":
- drp_audioMix.Items.Remove(AC3Passthru);
- drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.Items.Remove(Passthru);
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.Items.Remove(Passthru);
drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "Vorbis (vorbis)":
- drp_audioMix.Items.Remove(AC3Passthru);
- drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.Items.Remove(Passthru);
drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "AC3 (ffmpeg)":
- drp_audioMix.Items.Remove(AC3Passthru);
- drp_audioMix.Items.Remove(DTSPassthru);
+ drp_audioMix.Items.Remove(Passthru);
drp_audioMix.SelectedItem = currentMixdown ?? "Dolby Pro Logic II";
break;
case "AC3 Passthru":
- drp_audioMix.SelectedItem = AC3Passthru;
- break;
case "DTS Passthru":
- drp_audioMix.SelectedItem = DTSPassthru;
+ case "DTS-HD Passthru":
+ drp_audioMix.SelectedItem = Passthru;
break;
}
diff --git a/win/CS/Functions/QueryGenerator.cs b/win/CS/Functions/QueryGenerator.cs
index 1c84fa37c..7215be30e 100644
--- a/win/CS/Functions/QueryGenerator.cs
+++ b/win/CS/Functions/QueryGenerator.cs
@@ -409,13 +409,13 @@ namespace Handbrake.Functions
// Audio Encoder (-E)
encoders += string.IsNullOrEmpty(encoders)
- ? GetAudioEncoder(EnumHelper<AudioEncoder>.GetDescription(audioTrack.Encoder))
- : string.Format(",{0}", GetAudioEncoder(EnumHelper<AudioEncoder>.GetDescription(audioTrack.Encoder)));
+ ? Converters.GetCliAudioEncoder(audioTrack.Encoder)
+ : string.Format(",{0}", Converters.GetCliAudioEncoder(audioTrack.Encoder));
// Audio Mixdowns (-6)
mixdowns += string.IsNullOrEmpty(mixdowns)
- ? GetMixDown(EnumHelper<Mixdown>.GetDescription(audioTrack.MixDown))
- : string.Format(",{0}", GetMixDown(EnumHelper<Mixdown>.GetDescription(audioTrack.MixDown)));
+ ? Converters.GetCliMixDown(audioTrack.MixDown)
+ : string.Format(",{0}", Converters.GetCliMixDown(audioTrack.MixDown));
// Audio Samplerates (-R)
string rate = audioTrack.SampleRate == 0 ? "Auto" : audioTrack.SampleRate.ToString(); // Default to "Auto"
@@ -528,64 +528,6 @@ namespace Handbrake.Functions
#region Helpers
/// <summary>
- /// Return the CLI Mixdown name
- /// </summary>
- /// <param name="selectedAudio">GUI mixdown name</param>
- /// <returns>CLI mixdown name</returns>
- private static string GetMixDown(string selectedAudio)
- {
- switch (selectedAudio)
- {
- case "Automatic":
- return "auto";
- case "Mono":
- return "mono";
- case "Stereo":
- return "stereo";
- case "Dolby Surround":
- return "dpl1";
- case "Dolby Pro Logic II":
- return "dpl2";
- case "6 Channel Discrete":
- return "6ch";
- default:
- return "auto";
- }
- }
-
- /// <summary>
- /// Get the CLI Audio Encoder name
- /// </summary>
- /// <param name="selectedEncoder">
- /// String The GUI Encode name
- /// </param>
- /// <returns>
- /// String CLI encoder name
- /// </returns>
- private static string GetAudioEncoder(string selectedEncoder)
- {
- switch (selectedEncoder)
- {
- case "AAC (faac)":
- return "faac";
- case "AAC (ffmpeg)":
- return "ffaac";
- case "MP3 (lame)":
- return "lame";
- case "Vorbis (vorbis)":
- return "vorbis";
- case "AC3 Passthru":
- return "copy:ac3";
- case "DTS Passthru":
- return "copy:dts";
- case "AC3 (ffmpeg)":
- return "ac3";
- default:
- return string.Empty;
- }
- }
-
- /// <summary>
/// Create a CSV file with the data from the Main Window Chapters tab
/// </summary>
/// <param name="mainWindow">Main Window</param>
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
index c973128d6..b1d92f5d1 100644
--- a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
+++ b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
@@ -88,6 +88,8 @@ namespace HandBrake.ApplicationServices.Functions
return Mixdown.DolbyProLogicII;
case "6 Channel Discrete":
return Mixdown.SixChannelDiscrete;
+ case "Passthru":
+ return Mixdown.Passthrough;
default:
return Mixdown.Auto;
}
@@ -103,6 +105,7 @@ namespace HandBrake.ApplicationServices.Functions
switch (selectedAudio)
{
case Mixdown.Auto:
+ case Mixdown.Passthrough:
return "auto";
case Mixdown.Mono:
return "mono";
@@ -140,6 +143,8 @@ namespace HandBrake.ApplicationServices.Functions
return "AC3 Passthru";
case "copy:dts":
return "DTS Passthru";
+ case "copy:dtshd":
+ return "DTS-HD Passthru";
case "ffaac":
return "AAC (ffmpeg)";
default:
@@ -170,6 +175,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.Ac3Passthrough;
case "copy:dts":
return AudioEncoder.DtsPassthrough;
+ case "copy:dtshd":
+ return AudioEncoder.DtsHDPassthrough;
default:
return AudioEncoder.Faac;
}
@@ -200,6 +207,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.Ac3Passthrough;
case "DTS Passthru":
return AudioEncoder.DtsPassthrough;
+ case "DTS-HD Passthru":
+ return AudioEncoder.DtsHDPassthrough;
default:
return AudioEncoder.Faac;
}
@@ -230,6 +239,8 @@ namespace HandBrake.ApplicationServices.Functions
return "copy:ac3";
case AudioEncoder.DtsPassthrough:
return "copy:dts";
+ case AudioEncoder.DtsHDPassthrough:
+ return "copy:dtshd";
case AudioEncoder.Ac3:
return "ac3";
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs
index 9925c4298..8b030070f 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioEncoder.cs
@@ -33,6 +33,9 @@ namespace HandBrake.ApplicationServices.Model.Encoding
[Description("DTS Passthru")]
DtsPassthrough,
+ [Description("DTS-HD Passthru")]
+ DtsHDPassthrough,
+
[Description("Vorbis (vorbis)")]
Vorbis
}
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 738670aea..a6e83735b 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -112,7 +112,8 @@ namespace HandBrake.ApplicationServices.Model.Encoding
{
get
{
- if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough)
+ if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough ||
+ this.Encoder == AudioEncoder.DtsHDPassthrough)
{
return "Auto";
}
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs
index 8b0cc9005..d2e13e52e 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/Mixdown.cs
@@ -33,10 +33,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
[Description("6 Channel Discrete")]
SixChannelDiscrete,
- [Description("AC3 Passthru")]
- Ac3Passthrough,
-
- [Description("DTS Passthru")]
- DtsPassthrough,
+ [Description("Passthru")]
+ Passthrough,
}
}