OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / PresetLoader.cs
index 030eca6..1366414 100644 (file)
@@ -5,6 +5,7 @@
           It may be used under the terms of the GNU General Public License. */\r
 \r
 using System;\r
+using System.Drawing;\r
 using System.Windows.Forms;\r
 \r
 namespace Handbrake.Functions\r
@@ -82,16 +83,12 @@ namespace Handbrake.Functions
                     mainWindow.PictureSettings.crop_right.Value = right;\r
                 }\r
             }\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 as Required.\r
             if (presetQuery.Width != 0)\r
@@ -102,16 +99,12 @@ namespace Handbrake.Functions
 \r
             // Max Width/Height override Width/Height\r
             if (presetQuery.MaxWidth != 0)\r
-            {\r
                 mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth;\r
-                mainWindow.PictureSettings.maxWidth = presetQuery.MaxWidth;\r
-            }\r
 \r
             if (presetQuery.MaxHeight != 0)\r
-            {\r
                 mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight;\r
-                mainWindow.PictureSettings.maxHeight = presetQuery.MaxHeight;\r
-            }\r
+\r
+            mainWindow.PictureSettings.PresetMaximumResolution = new Size(presetQuery.MaxWidth, presetQuery.MaxHeight);\r
 \r
             // Case where both height and max height are 0 - For built-in presets\r
             if (presetQuery.MaxHeight == 0 && presetQuery.Height == 0)\r
@@ -121,13 +114,11 @@ namespace Handbrake.Functions
                 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
             // Custom Anamorphic Controls\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
-            mainWindow.PictureSettings.drop_modulus.SelectedItem = presetQuery.AnamorphicModulus;\r
+            mainWindow.PictureSettings.updownDisplayWidth.Text = presetQuery.displayWidthValue.ToString();\r
+            mainWindow.PictureSettings.updownParHeight.Text = presetQuery.pixelAspectWidth.ToString();\r
+            mainWindow.PictureSettings.updownParWidth.Text = presetQuery.pixelAspectHeight.ToString();\r
+            mainWindow.PictureSettings.drp_modulus.SelectedItem = presetQuery.AnamorphicModulus;\r
 \r
             #endregion\r
 \r