OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / PresetLoader.cs
index 28cec68..0b72d29 100644 (file)
@@ -62,11 +62,11 @@ namespace Handbrake.Functions
             #endregion\r
 \r
             #region Picture\r
-            \r
+\r
             if (pictureSettings) // only Load picture settings if the perset requires it\r
             {\r
                 mainWindow.PictureSettings.check_autoCrop.Checked = true;\r
-        \r
+\r
                 if (presetQuery.CropValues != null)\r
                 {\r
                     int top, bottom, left, right;\r
@@ -83,25 +83,19 @@ namespace Handbrake.Functions
                 }\r
             }\r
 \r
+            // Set the anamorphic mode 0,1,2,3\r
+            mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;\r
+\r
+            // Aspect Ratio\r
+            mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;\r
+\r
             // Reset maxWidth and MaxHeight to 0\r
             mainWindow.PictureSettings.maxWidth = 0;\r
             mainWindow.PictureSettings.maxHeight = 0;\r
-\r
-            // Set the width and height\r
+                \r
+            // Set the Width and height as Required.\r
             if (presetQuery.Width != 0)\r
                 mainWindow.PictureSettings.text_width.Value = presetQuery.Width;\r
-            else if (presetQuery.MaxWidth == 0)\r
-            {\r
-                if (mainWindow.selectedTitle != null)\r
-                    if (mainWindow.selectedTitle.Resolution.Width != 0)\r
-                    {\r
-                        mainWindow.PictureSettings.text_width.Value = mainWindow.selectedTitle.Resolution.Width;\r
-                        if (presetQuery.Height == 0 && presetQuery.MaxHeight == 0)\r
-                            mainWindow.PictureSettings.check_KeepAR.Checked = true;\r
-                    }\r
-                    else\r
-                        mainWindow.PictureSettings.text_width.Value = 0;\r
-            }\r
 \r
             if (presetQuery.Height != 0)\r
                 mainWindow.PictureSettings.text_height.Value = presetQuery.Height;\r
@@ -118,13 +112,20 @@ namespace Handbrake.Functions
                 mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight;\r
                 mainWindow.PictureSettings.maxHeight = presetQuery.MaxHeight;\r
             }\r
+\r
+            // Case where both height and max height are 0 - For built-in presets\r
+            if (presetQuery.MaxHeight == 0 && presetQuery.Height == 0)\r
+                mainWindow.PictureSettings.text_height.Value = 0;\r
+\r
+            if (presetQuery.MaxWidth == 0 && presetQuery.Width == 0)\r
+                if (mainWindow.selectedTitle != null && mainWindow.selectedTitle.Resolution.Width != 0)\r
+                    mainWindow.PictureSettings.text_width.Value = mainWindow.selectedTitle.Resolution.Width;\r
+\r
             mainWindow.PictureSettings.setMax();\r
 \r
-            // Set the anamorphic mode 0,1,2,3\r
-            mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;\r
+            \r
 \r
             // Custom Anamorphic Controls\r
-            mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.keepDisplayAsect ? CheckState.Checked : CheckState.Unchecked;\r
             mainWindow.PictureSettings.txt_displayWidth.Text = presetQuery.displayWidthValue.ToString();\r
             mainWindow.PictureSettings.txt_parWidth.Text = presetQuery.pixelAspectWidth.ToString();\r
             mainWindow.PictureSettings.txt_parHeight.Text = presetQuery.pixelAspectHeight.ToString();\r