summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-01-14 19:10:17 +0000
committersr55 <[email protected]>2012-01-14 19:10:17 +0000
commit1c231b4e398f973487822f0aa607f9c8e5ff82fa (patch)
tree581a3536561a19d0143145917a9463ccc549d334 /win
parent01c8ab3532c0c30748fd3e7a0376e3f32928c72f (diff)
WinGui: Add support for --audio-copy-mask and --audio-fallback
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4408 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/CS/Controls/AudioPanel.cs2
-rw-r--r--win/CS/Functions/QueryGenerator.cs45
-rw-r--r--win/CS/HandBrake.ApplicationServices/Functions/Converters.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs2
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs4
5 files changed, 55 insertions, 6 deletions
diff --git a/win/CS/Controls/AudioPanel.cs b/win/CS/Controls/AudioPanel.cs
index 2d7b3df7c..8a976ab1a 100644
--- a/win/CS/Controls/AudioPanel.cs
+++ b/win/CS/Controls/AudioPanel.cs
@@ -156,6 +156,8 @@ namespace Handbrake.Controls
drp_passthruFallback.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.ffflac));
}
+ drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDisplay(AudioEncoder.Passthrough));
+
if (!drp_audioEncoder.Items.Contains(oldval))
drp_audioEncoder.SelectedIndex = 0;
else
diff --git a/win/CS/Functions/QueryGenerator.cs b/win/CS/Functions/QueryGenerator.cs
index 8ffdb888e..de4257a32 100644
--- a/win/CS/Functions/QueryGenerator.cs
+++ b/win/CS/Functions/QueryGenerator.cs
@@ -507,6 +507,7 @@ namespace Handbrake.Functions
// Audio Gain Control
gainValues += string.IsNullOrEmpty(gainValues) ? audioTrack.Gain.ToString(Culture) : string.Format(",{0}", audioTrack.Gain.ToString(Culture));
+
trackNames += string.IsNullOrEmpty(trackNames)
? string.IsNullOrEmpty(audioTrack.TrackName) ? "\"\"" : string.Format("\"{0}\"", audioTrack.TrackName.Trim())
: string.IsNullOrEmpty(audioTrack.TrackName) ? ",\"\"" : string.Format(",\"{0}\"", audioTrack.TrackName.Trim());
@@ -527,6 +528,44 @@ namespace Handbrake.Functions
audioQuery += string.Format(" --aname={0}", trackNames);
}
+ // Passthru Settings
+ if (mainWindow.AudioSettings.PassthruSettings != null)
+ {
+ string fallbackEncoders = string.Empty;
+
+ if (mainWindow.AudioSettings.PassthruSettings.AudioAllowAACPass)
+ {
+ fallbackEncoders += "aac";
+ }
+
+ if (mainWindow.AudioSettings.PassthruSettings.AudioAllowAC3Pass)
+ {
+ fallbackEncoders += string.IsNullOrEmpty(fallbackEncoders) ? "ac3" : ",ac3";
+ }
+
+ if (mainWindow.AudioSettings.PassthruSettings.AudioAllowDTSHDPass)
+ {
+ fallbackEncoders += string.IsNullOrEmpty(fallbackEncoders) ? "dtshd" : ",dtshd";
+ }
+
+ if (mainWindow.AudioSettings.PassthruSettings.AudioAllowDTSPass)
+ {
+ fallbackEncoders += string.IsNullOrEmpty(fallbackEncoders) ? "dts" : ",dts";
+ }
+
+ if (mainWindow.AudioSettings.PassthruSettings.AudioAllowMP3Pass)
+ {
+ fallbackEncoders += string.IsNullOrEmpty(fallbackEncoders) ? "mp3" : ",mp3";
+ }
+
+ if (!string.IsNullOrEmpty(fallbackEncoders))
+ {
+ audioQuery += string.Format(" --audio-copy-mask {0}", fallbackEncoders);
+ }
+
+ audioQuery += string.Format(" --audio-fallback {0}", Converters.GetCliAudioEncoder(mainWindow.AudioSettings.PassthruSettings.AudioEncoderFallback));
+ }
+
return audioQuery;
}
@@ -614,7 +653,7 @@ namespace Handbrake.Functions
private static EncodeTask CreateEncodeTaskObject(frmMain frmMain)
{
EncodeTask task = new EncodeTask();
-
+
// Source, Destination and Output Settings
task.Destination = frmMain.text_destination.Text;
string sourcePath = frmMain.selectedTitle != null && File.Exists(frmMain.selectedTitle.SourceName)
@@ -655,7 +694,7 @@ namespace Handbrake.Functions
break;
default:
break;
- }
+ }
task.OutputFormat = EnumHelper<OutputFormat>.GetValue(frmMain.drop_format.Text.Replace(" File", string.Empty).Trim());
task.LargeFile = frmMain.check_largeFile.Checked;
@@ -682,7 +721,7 @@ namespace Handbrake.Functions
int.TryParse(frmMain.PictureSettings.updownParHeight.Text, out parY);
switch (frmMain.PictureSettings.drp_anamorphic.SelectedIndex)
{
- case 0:
+ case 0:
task.Anamorphic = Anamorphic.None;
task.Modulus = modulus;
break;
diff --git a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
index 830c074e9..1ad7a819f 100644
--- a/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
+++ b/win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
@@ -157,6 +157,8 @@ namespace HandBrake.ApplicationServices.Functions
return "AAC (ffmpeg)";
case "ffflac":
return "Flac (ffmpeg)";
+ case "copy:*":
+ return "Auto Passthru";
default:
return "AAC (faac)";
}
@@ -193,6 +195,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.Mp3Passthru;
case "copy:aac":
return AudioEncoder.AacPassthru;
+ case "copy:*":
+ return AudioEncoder.Passthrough;
default:
return AudioEncoder.Faac;
}
@@ -231,6 +235,8 @@ namespace HandBrake.ApplicationServices.Functions
return AudioEncoder.Mp3Passthru;
case "Flac (ffmpeg)":
return AudioEncoder.ffflac;
+ case "Auto Passthru":
+ return AudioEncoder.Passthrough;
default:
return AudioEncoder.Faac;
}
@@ -269,6 +275,8 @@ namespace HandBrake.ApplicationServices.Functions
return "copy:aac";
case AudioEncoder.Mp3Passthru:
return "copy:mp3";
+ case AudioEncoder.Passthrough:
+ return "copy:*";
case AudioEncoder.ffflac:
return "ffflac";
default:
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index e709add79..527ba35f4 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -95,7 +95,7 @@ namespace HandBrake.ApplicationServices.Utilities
Match noAudio = Regex.Match(input, @"-a none");
Match audioTracks = Regex.Match(input, @"-a ([0-9,]*)");
Match audioTrackMixes = Regex.Match(input, @"-6 ([0-9a-zA-Z,]*)");
- Match audioEncoders = Regex.Match(input, @"-E ([a-zA-Z0-9+,:]*)");
+ Match audioEncoders = Regex.Match(input, @"-E ([a-zA-Z0-9+,:\*]*)");
Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]*)"); // Auto = a-z
Match audioSampleRates = Regex.Match(input, @"-R ([0-9a-zA-Z.,]*)"); // Auto = a-z
Match drcValues = Regex.Match(input, @"-D ([0-9.,]*)");
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
index 492d51d9a..570597176 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
@@ -25,7 +25,7 @@ namespace HandBrake.Interop.Model.Encoding
[Display(Name = "AC3 (ffmpeg)")]
Ac3,
- [Display(Name = "Passthrough")]
+ [Display(Name = "Auto Passthru")]
Passthrough,
[Display(Name = "AC3 Passthru")]
@@ -47,6 +47,6 @@ namespace HandBrake.Interop.Model.Encoding
Vorbis,
[Display(Name = "Flac (ffmpeg)")]
- ffflac
+ ffflac,
}
}