private bool preventChangingDisplayWidth;\r
private double cachedDar;\r
private Title sourceTitle;\r
+ private Size presetMaximumResolution;\r
\r
/// <summary>\r
/// Initializes a new instance of the <see cref="PictureSettings"/> class. \r
/// </summary>\r
public Preset CurrentlySelectedPreset { get; set; }\r
\r
+ public bool SizeSet { get; set; }\r
+\r
/// <summary>\r
/// Gets or sets the maximum allowable size for the encoded resolution. Set a value to\r
/// "0" if the maximum does not matter.\r
/// </summary>\r
- public Size PresetMaximumResolution { get; set; }\r
+ public Size PresetMaximumResolution\r
+ {\r
+ get\r
+ {\r
+ return this.presetMaximumResolution;\r
+ }\r
+ set\r
+ {\r
+ this.presetMaximumResolution = value;\r
+ if (presetMaximumResolution == new Size(0, 0) && !SizeSet && this.sourceTitle != null)\r
+ {\r
+ text_width.Value = this.sourceTitle.Resolution.Width;\r
+ }\r
+ }\r
+ }\r
\r
/// <summary>\r
/// Set the Preset Crop Warning Label\r
? CheckState.Checked\r
: CheckState.Unchecked;\r
\r
+ bool sizeSet = false;\r
// Set the Width and height as Required.\r
if (presetQuery.Width.HasValue)\r
{\r
mainWindow.PictureSettings.text_width.Value = presetQuery.Width.Value;\r
+ sizeSet = true;\r
}\r
\r
if (presetQuery.Height.HasValue)\r
{\r
mainWindow.PictureSettings.text_height.Value = presetQuery.Height.Value;\r
+ sizeSet = true;\r
}\r
\r
// Max Width/Height override Width/Height\r
if (presetQuery.MaxWidth.HasValue)\r
{\r
mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth.Value;\r
+ sizeSet = true;\r
}\r
\r
if (presetQuery.MaxHeight.HasValue)\r
{\r
mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight.Value;\r
+ sizeSet = true;\r
}\r
\r
+ mainWindow.PictureSettings.SizeSet = sizeSet;\r
mainWindow.PictureSettings.PresetMaximumResolution = new Size(\r
presetQuery.MaxWidth.HasValue ? presetQuery.MaxWidth.Value : 0,\r
presetQuery.MaxHeight.HasValue ? presetQuery.MaxHeight.Value : 0);\r