summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-07-23 16:57:39 +0000
committersr55 <[email protected]>2012-07-23 16:57:39 +0000
commit6c8108e0760796e153f62de9b08325f433105bff (patch)
treef584e99a9ace46b1bce9af6f9136f67375cb1226 /win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
parentdaafb500d527e3e5d1a1790bba6dd287c28eedbb (diff)
WinGui: Fix up the Audio Passthru selection options.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4872 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs29
1 files changed, 24 insertions, 5 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
index dcedefad9..871bc5adc 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
@@ -544,6 +544,25 @@ namespace HandBrake.ApplicationServices.Utilities
}
/// <summary>
+ /// The get null bool value.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <returns>
+ /// The System.String.
+ /// </returns>
+ private static string getNullBoolValue(bool? value)
+ {
+ if (!value.HasValue)
+ {
+ return "1";
+ }
+
+ return value.Value ? "1" : "0";
+ }
+
+ /// <summary>
/// Add the encode settings to the preset
/// </summary>
/// <param name="xmlWriter">
@@ -557,11 +576,11 @@ namespace HandBrake.ApplicationServices.Utilities
/// </param>
private static void AddEncodeSettings(XmlTextWriter xmlWriter, EncodeTask parsed, Preset preset)
{
- AddEncodeElement(xmlWriter, "AudioAllowAACPass", "integer", parsed.AllowedPassthruOptions.AudioAllowAACPass ? "1" : "0");
- AddEncodeElement(xmlWriter, "AudioAllowAC3Pass", "integer", parsed.AllowedPassthruOptions.AudioAllowAC3Pass ? "1" : "0");
- AddEncodeElement(xmlWriter, "AudioAllowDTSHDPass", "integer", parsed.AllowedPassthruOptions.AudioAllowDTSHDPass ? "1" : "0");
- AddEncodeElement(xmlWriter, "AudioAllowDTSPass", "integer", parsed.AllowedPassthruOptions.AudioAllowDTSPass ? "1" : "0");
- AddEncodeElement(xmlWriter, "AudioAllowMP3Pass", "integer", parsed.AllowedPassthruOptions.AudioAllowMP3Pass ? "1" : "0");
+ AddEncodeElement(xmlWriter, "AudioAllowAACPass", "integer", getNullBoolValue(parsed.AllowedPassthruOptions.AudioAllowAACPass));
+ AddEncodeElement(xmlWriter, "AudioAllowAC3Pass", "integer", getNullBoolValue(parsed.AllowedPassthruOptions.AudioAllowAC3Pass));
+ AddEncodeElement(xmlWriter, "AudioAllowDTSHDPass", "integer", getNullBoolValue(parsed.AllowedPassthruOptions.AudioAllowDTSHDPass));
+ AddEncodeElement(xmlWriter, "AudioAllowDTSPass", "integer", getNullBoolValue(parsed.AllowedPassthruOptions.AudioAllowDTSPass));
+ AddEncodeElement(xmlWriter, "AudioAllowMP3Pass", "integer", getNullBoolValue(parsed.AllowedPassthruOptions.AudioAllowMP3Pass));
AddEncodeElement(xmlWriter, "AudioEncoderFallback", "string", EnumHelper<AudioEncoder>.GetDisplay(parsed.AllowedPassthruOptions.AudioEncoderFallback));
AddEncodeElement(xmlWriter, "ChapterMarkers", "integer", parsed.IncludeChapterMarkers ? "1" : "0");