From 3d7392c9e4f114408b2fd16bd848a2e10c36fa32 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 30 Apr 2011 21:25:53 +0000 Subject: WinGui: - Fix to the Audio Panel Track Display which was intermittently not showing a track. - Fixed a number of bugs in the plist parser which was prevent imports. - Fixed a number of Issues with the Preset Import/Export. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3972 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Utilities/PlistUtility.cs | 61 +++++++++++++++------- 1 file changed, 42 insertions(+), 19 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices/Utilities') diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs index 86cae01b5..7e17614f2 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs @@ -1,4 +1,4 @@ -/* PlistPresetHandler.cs $ +/* PlistUtility.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ @@ -65,7 +65,7 @@ namespace HandBrake.ApplicationServices.Utilities track.MixDown = Converters.GetAudioMixDown(value.Trim()); break; case "AudioSamplerate": - track.SampleRate = double.Parse(value); + track.SampleRate = value == "Auto" ? 0 : double.Parse(value); break; case "AudioTrack": //track.SourceTrack = value; @@ -92,7 +92,7 @@ namespace HandBrake.ApplicationServices.Utilities switch (key) { - // Output Settings + // Output Settings case "FileFormat": parsed.OutputFormat = Converters.GetFileFormat(value); break; @@ -106,7 +106,7 @@ namespace HandBrake.ApplicationServices.Utilities parsed.IPod5GSupport = value == "1"; break; - // Picture Settings + // Picture Settings case "PictureAutoCrop": // Not used break; @@ -134,35 +134,38 @@ namespace HandBrake.ApplicationServices.Utilities case "PicturePAR": switch (value) { - case "0": parsed.Anamorphic = Anamorphic.None; break; default: parsed.Anamorphic = Anamorphic.Strict; break; - case "2": + case "2": parsed.Anamorphic = Anamorphic.Loose; break; - case "3": + case "3": parsed.Anamorphic = Anamorphic.Custom; break; - } break; - // Filters + // Filters case "PictureDeblock": parsed.Deblock = int.Parse(value); break; case "PictureDecomb": parsed.Decomb = Decomb.Off; // Don't place custom here as it's handled in the filter panel - if (value == "2") parsed.Decomb = Decomb.Default; + if (value == "2") + { + parsed.Decomb = Decomb.Default; + } break; case "PictureDecombCustom": if (value != string.Empty) + { parsed.CustomDecomb = value; + } break; case "PictureDecombDeinterlace": // Not Used @@ -173,7 +176,7 @@ namespace HandBrake.ApplicationServices.Utilities case "0": parsed.Deinterlace = Deinterlace.Off; break; - // Don't place custom here as it's handled in the filter panel + // Don't place custom here as it's handled in the filter panel case "2": parsed.Deinterlace = Deinterlace.Fast; break; @@ -187,7 +190,9 @@ namespace HandBrake.ApplicationServices.Utilities break; case "PictureDeinterlaceCustom": if (value != string.Empty) + { parsed.CustomDeinterlace = value; + } break; case "PictureDenoise": switch (value) @@ -195,7 +200,7 @@ namespace HandBrake.ApplicationServices.Utilities case "0": parsed.Denoise = Denoise.Off; break; - // Don't place custom here as it's handled in the filter panel + // Don't place custom here as it's handled in the filter panel case "2": parsed.Denoise = Denoise.Weak; break; @@ -210,26 +215,44 @@ namespace HandBrake.ApplicationServices.Utilities break; case "PictureDenoiseCustom": if (value != string.Empty) + { parsed.CustomDenoise = value; + } break; case "PictureDetelecine": parsed.Detelecine = Detelecine.Off; - if (value == "1") parsed.Detelecine = Detelecine.Default; + if (value == "1") + { + parsed.Detelecine = Detelecine.Default; + } break; case "PictureDetelecineCustom": if (value != string.Empty) + { parsed.CustomDetelecine = value; + } break; - // Video Tab + // Video Tab case "VideoAvgBitrate": - parsed.VideoBitrate = int.Parse(value); + if (!string.IsNullOrEmpty(value)) + { + parsed.VideoBitrate = int.Parse(value); + } break; case "VideoEncoder": parsed.VideoEncoder = Converters.GetVideoEncoder(value); break; case "VideoFramerate": - parsed.Framerate = int.Parse(value); + + if (value == "Same as source") + { + parsed.Framerate = null; + } + else if (!string.IsNullOrEmpty(value)) + { + parsed.Framerate = int.Parse(value); + } break; case "VideoGrayScale": parsed.Grayscale = value == "1"; @@ -247,17 +270,17 @@ namespace HandBrake.ApplicationServices.Utilities parsed.TwoPass = value == "1"; break; - // Chapter Markers Tab + // Chapter Markers Tab case "ChapterMarkers": parsed.IncludeChapterMarkers = value == "1"; break; - // Advanced x264 tab + // Advanced x264 tab case "x264Option": parsed.AdvancedEncoderOptions = value; break; - // Preset Information + // Preset Information case "PresetBuildNumber": parsed.PresetBuildNumber = int.Parse(value); break; -- cgit v1.2.3