]> granicus.if.org Git - handbrake/commitdiff
WinGui: (0.9.x) Lots of fixes to the Plist Import / Export functionality.
authorsr55 <sr55.hb@outlook.com>
Thu, 12 Apr 2012 19:33:09 +0000 (19:33 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 12 Apr 2012 19:33:09 +0000 (19:33 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4594 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs

index 91d4d5357c07af92437692037618da9970d59c8e..cd535a6bb80fa036fb366aace6af5ec2510c0f36 100644 (file)
@@ -70,7 +70,7 @@ namespace HandBrake.ApplicationServices.Utilities
                             track.SampleRate = value == "Auto" ? 0 : double.Parse(value);\r
                             break;\r
                         case "AudioTrack":\r
-                           //track.SourceTrack = value;\r
+                            //track.SourceTrack = value;\r
                             break;\r
                         case "AudioTrackDRCSlider":\r
                             track.DRC = double.Parse(value);\r
@@ -97,7 +97,7 @@ namespace HandBrake.ApplicationServices.Utilities
 \r
                 switch (key)\r
                 {\r
-                        // Output Settings\r
+                    // Output Settings\r
                     case "FileFormat":\r
                         parsed.OutputFormat = Converters.GetFileFormat(value.Replace("file", string.Empty).Trim());\r
                         break;\r
@@ -105,13 +105,13 @@ namespace HandBrake.ApplicationServices.Utilities
                         parsed.OptimizeMP4 = value == "1";\r
                         break;\r
                     case "Mp4LargeFile":\r
-                        parsed.IPod5GSupport = value == "1";\r
+                        parsed.LargeFile = value == "1";\r
                         break;\r
                     case "Mp4iPodCompatible":\r
                         parsed.IPod5GSupport = value == "1";\r
                         break;\r
 \r
-                        // Picture Settings\r
+                    // Picture Settings\r
                     case "PictureAutoCrop":\r
                         parsed.HasCropping = value != "1";\r
                         break;\r
@@ -154,16 +154,23 @@ namespace HandBrake.ApplicationServices.Utilities
                         }\r
                         break;\r
 \r
-                        // Filters\r
+                    // Filters\r
                     case "PictureDeblock":\r
                         parsed.Deblock = int.Parse(value);\r
                         break;\r
                     case "PictureDecomb":\r
                         parsed.Decomb = Decomb.Off;\r
-                        // Don't place custom here as it's handled in the filter panel\r
-                        if (value == "2")\r
+                        switch (value)\r
                         {\r
-                            parsed.Decomb = Decomb.Default;\r
+                            case "1":\r
+                                parsed.Decomb = Decomb.Custom;\r
+                                break;\r
+                            case "2":\r
+                                parsed.Decomb = Decomb.Default;\r
+                                break;\r
+                            case "3":\r
+                                parsed.Decomb = Decomb.Fast;\r
+                                break;\r
                         }\r
                         break;\r
                     case "PictureDecombCustom":\r
@@ -181,7 +188,9 @@ namespace HandBrake.ApplicationServices.Utilities
                             case "0":\r
                                 parsed.Deinterlace = Deinterlace.Off;\r
                                 break;\r
-                                // Don't place custom here as it's handled in the filter panel\r
+                            case "1":\r
+                                parsed.Deinterlace = Deinterlace.Custom;\r
+                                break;\r
                             case "2":\r
                                 parsed.Deinterlace = Deinterlace.Fast;\r
                                 break;\r
@@ -205,7 +214,9 @@ namespace HandBrake.ApplicationServices.Utilities
                             case "0":\r
                                 parsed.Denoise = Denoise.Off;\r
                                 break;\r
-                                // Don't place custom here as it's handled in the filter panel\r
+                            case "1":\r
+                                parsed.Denoise = Denoise.Custom;\r
+                                break;\r
                             case "2":\r
                                 parsed.Denoise = Denoise.Weak;\r
                                 break;\r
@@ -227,6 +238,10 @@ namespace HandBrake.ApplicationServices.Utilities
                     case "PictureDetelecine":\r
                         parsed.Detelecine = Detelecine.Off;\r
                         if (value == "1")\r
+                        {\r
+                            parsed.Detelecine = Detelecine.Custom;\r
+                        }\r
+                        if (value == "2")\r
                         {\r
                             parsed.Detelecine = Detelecine.Default;\r
                         }\r
@@ -238,7 +253,7 @@ namespace HandBrake.ApplicationServices.Utilities
                         }\r
                         break;\r
 \r
-                        // Video Tab\r
+                    // Video Tab\r
                     case "VideoAvgBitrate":\r
                         if (!string.IsNullOrEmpty(value))\r
                         {\r
@@ -292,17 +307,17 @@ namespace HandBrake.ApplicationServices.Utilities
                         parsed.TwoPass = value == "1";\r
                         break;\r
 \r
-                        // Chapter Markers Tab\r
+                    // Chapter Markers Tab\r
                     case "ChapterMarkers":\r
                         parsed.IncludeChapterMarkers = value == "1";\r
                         break;\r
 \r
-                        // Advanced x264 tab\r
+                    // Advanced x264 tab\r
                     case "x264Option":\r
                         parsed.AdvancedEncoderOptions = value;\r
                         break;\r
 \r
-                        // Preset Information\r
+                    // Preset Information\r
                     case "PresetBuildNumber":\r
                         parsed.PresetBuildNumber = int.Parse(value);\r
                         break;\r
@@ -502,11 +517,15 @@ namespace HandBrake.ApplicationServices.Utilities
                     AddEncodeElement(xmlWriter, "PictureDecombCustom", "string", string.Empty);\r
                     break;\r
                 case Decomb.Default:\r
-                    AddEncodeElement(xmlWriter, "PictureDecomb", "integer", "1");\r
+                    AddEncodeElement(xmlWriter, "PictureDecomb", "integer", "2");\r
                     AddEncodeElement(xmlWriter, "PictureDecombCustom", "string", string.Empty);\r
                     break;\r
-                default:\r
-                    AddEncodeElement(xmlWriter, "PictureDecomb", "integer", "2");\r
+                case Decomb.Fast:\r
+                    AddEncodeElement(xmlWriter, "PictureDecomb", "integer", "3");\r
+                    AddEncodeElement(xmlWriter, "PictureDecombCustom", "string", string.Empty);\r
+                    break;\r
+                case Decomb.Custom:\r
+                    AddEncodeElement(xmlWriter, "PictureDecomb", "integer", "1");\r
                     AddEncodeElement(xmlWriter, "PictureDecombCustom", "string", parsed.CustomDecomb);\r
                     break;\r
             }\r
@@ -519,19 +538,19 @@ namespace HandBrake.ApplicationServices.Utilities
                     AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", string.Empty);\r
                     break;\r
                 case Deinterlace.Fast:\r
-                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "1");\r
+                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "2");\r
                     AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", string.Empty);\r
                     break;\r
                 case Deinterlace.Slow:\r
-                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "2");\r
+                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "3");\r
                     AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", string.Empty);\r
                     break;\r
                 case Deinterlace.Slower:\r
-                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "3");\r
+                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "4");\r
                     AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", string.Empty);\r
                     break;\r
-                default:\r
-                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "4");\r
+                case Deinterlace.Custom:\r
+                    AddEncodeElement(xmlWriter, "PictureDeinterlace", "integer", "1");\r
                     AddEncodeElement(xmlWriter, "PictureDeinterlaceCustom", "string", parsed.CustomDeinterlace);\r
                     break;\r
             }\r
@@ -543,24 +562,24 @@ namespace HandBrake.ApplicationServices.Utilities
                     AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", string.Empty);\r
                     break;\r
                 case Denoise.Weak:\r
-                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "1");\r
+                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "2");\r
                     AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", string.Empty);\r
                     break;\r
                 case Denoise.Medium:\r
-                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "2");\r
+                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "3");\r
                     AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", string.Empty);\r
                     break;\r
                 case Denoise.Strong:\r
-                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "3");\r
+                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "4");\r
                     AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", string.Empty);\r
                     break;\r
-                default:\r
-                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "4");\r
+                case Denoise.Custom:\r
+                    AddEncodeElement(xmlWriter, "PictureDenoise", "integer", "1");\r
                     AddEncodeElement(xmlWriter, "PictureDenoiseCustom", "string", parsed.CustomDenoise);\r
                     break;\r
             }\r
 \r
-            int detelecine;\r
+            int detelecine = 0;\r
             switch (parsed.Detelecine)\r
             {\r
                 case Detelecine.Off:\r
@@ -569,7 +588,7 @@ namespace HandBrake.ApplicationServices.Utilities
                 case Detelecine.Default:\r
                     detelecine = 2;\r
                     break;\r
-                default:\r
+                case Detelecine.Custom:\r
                     detelecine = 1;\r
                     break;\r
             }\r
@@ -727,7 +746,7 @@ namespace HandBrake.ApplicationServices.Utilities
 \r
             xmlWriter.WriteElementString("key", "AudioTrackGainSlider");\r
             xmlWriter.WriteElementString("real", audioTrack.Gain.ToString());\r
-            \r
+\r
             xmlWriter.WriteEndElement();\r
         }\r
         #endregion\r