2 using System.Globalization;
\r
3 using System.Windows.Forms;
\r
4 using Handbrake.Parsing;
\r
6 namespace Handbrake.Controls
\r
9 // - Tie in the cropping controls.
\r
10 // - Cleanup this code. It's a bit messy.
\r
12 public partial class PictureSettings : UserControl
\r
14 private static readonly CultureInfo Culture = new CultureInfo("en-US", false);
\r
17 public int maxWidth, maxHeight;
\r
18 int widthVal, heightVal;
\r
19 private double darValue;
\r
20 private double storageAspect; // Storage Aspect Cache for current source and title
\r
21 public Title selectedTitle { private get; set; }
\r
22 private Boolean heightChangeGuard;
\r
23 private Boolean looseAnamorphicHeightGuard;
\r
24 private Boolean heightModJumpGaurd;
\r
26 public event EventHandler PictureSettingsChanged;
\r
29 public PictureSettings()
\r
31 InitializeComponent();
\r
33 drop_modulus.SelectedIndex = 0;
\r
36 public void setComponentsAfterScan(Title st)
\r
40 // Set the Aspect Ratio
\r
41 lbl_Aspect.Text = selectedTitle.AspectRatio.ToString(Culture);
\r
42 lbl_src_res.Text = selectedTitle.Resolution.Width + " x " + selectedTitle.Resolution.Height;
\r
44 // Set the Recommended Cropping values
\r
45 crop_top.Value = selectedTitle.AutoCropDimensions[0];
\r
46 crop_bottom.Value = selectedTitle.AutoCropDimensions[1];
\r
47 crop_left.Value = selectedTitle.AutoCropDimensions[2];
\r
48 crop_right.Value = selectedTitle.AutoCropDimensions[3];
\r
51 // Set the Resolution Boxes
\r
52 text_width.Value = selectedTitle.Resolution.Width;
\r
54 if (drp_anamorphic.SelectedIndex == 0)
\r
55 text_height.Value = cacluateHeight(selectedTitle.Resolution.Width);
\r
56 else if (drp_anamorphic.SelectedIndex == 1 || drp_anamorphic.SelectedIndex == 3)
\r
58 heightModJumpGaurd = true;
\r
59 text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;
\r
61 else if (drp_anamorphic.SelectedIndex == 2)
\r
63 heightModJumpGaurd = false;
\r
64 text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
\r
67 if (drp_anamorphic.SelectedIndex == 3)
\r
69 txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();
\r
70 txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();
\r
71 txt_displayWidth.Text = displayWidth().ToString(Culture);
\r
76 public void setMax()
\r
78 if (maxWidth != 0 && maxHeight != 0)
\r
79 lbl_max.Text = "Max Width / Height";
\r
80 else if (maxWidth != 0)
\r
81 lbl_max.Text = "Max Width";
\r
86 // Basic Picture Setting Controls
\r
87 private void text_width_ValueChanged(object sender, EventArgs e)
\r
94 int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
\r
96 // Increase or decrease value by the correct mod.
\r
97 text_width.Value = widthChangeMod(mod);
\r
100 switch (drp_anamorphic.SelectedIndex)
\r
103 if (calculateUnchangeValue(true) != -1 && check_KeepAR.Checked)
\r
104 text_height.Value = calculateUnchangeValue(true);
\r
107 lbl_anamorphic.Text = strictAnamorphic();
\r
110 lbl_anamorphic.Text = looseAnamorphic();
\r
113 customAnamorphic(text_width);
\r
116 // A Picture Setting has changed so raise a PictureSettingsChanged event.
\r
117 if (this.PictureSettingsChanged != null)
\r
118 this.PictureSettingsChanged(this, new EventArgs());
\r
120 private void text_height_ValueChanged(object sender, EventArgs e)
\r
127 int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
\r
129 // Increase or decrease value by the correct mod.
\r
130 if (drp_anamorphic.SelectedIndex != 2 && !heightModJumpGaurd)
\r
132 decimal val = heightChangeMod(mod);
\r
133 heightChangeGuard = true;
\r
134 if (text_height.Value != val)
\r
136 heightChangeGuard = false;
\r
137 text_height.Value = val;
\r
142 switch (drp_anamorphic.SelectedIndex)
\r
145 if (drp_anamorphic.SelectedIndex != 3)
\r
147 if (calculateUnchangeValue(false) != -1)
\r
148 text_width.Value = calculateUnchangeValue(false);
\r
152 lbl_anamorphic.Text = strictAnamorphic();
\r
155 if (!looseAnamorphicHeightGuard)
\r
156 lbl_anamorphic.Text = looseAnamorphic();
\r
159 if (!heightChangeGuard)
\r
160 customAnamorphic(text_height);
\r
163 heightChangeGuard = false;
\r
164 looseAnamorphicHeightGuard = false;
\r
165 heightModJumpGaurd = false;
\r
167 // A Picture Setting has changed so raise a PictureSettingsChanged event.
\r
168 if (this.PictureSettingsChanged != null)
\r
169 this.PictureSettingsChanged(this, new EventArgs());
\r
171 private void check_KeepAR_CheckedChanged(object sender, EventArgs e)
\r
173 // Recalculate Height based on width when enabled
\r
174 if (drp_anamorphic.SelectedIndex != 3 && check_KeepAR.Checked && selectedTitle != null)
\r
175 text_height.Value = cacluateHeight(widthVal);
\r
177 // Enable Par Width/Height Check boxes if Keep AR is enabled, otherwise disable them
\r
178 if (check_KeepAR.Checked)
\r
180 txt_parWidth.Enabled = false;
\r
181 txt_parHeight.Enabled = false;
\r
185 txt_parWidth.Enabled = true;
\r
186 txt_parHeight.Enabled = true;
\r
189 private void drp_anamorphic_SelectedIndexChanged(object sender, EventArgs e)
\r
191 switch (drp_anamorphic.SelectedIndex)
\r
194 text_height.Enabled = true;
\r
195 text_width.Enabled = true;
\r
196 check_KeepAR.CheckState = CheckState.Checked;
\r
197 check_KeepAR.Enabled = true;
\r
198 disableCustomAnaControls();
\r
199 if (selectedTitle != null)
\r
201 text_width.Value = selectedTitle.Resolution.Width;
\r
202 text_height.Value = selectedTitle.Resolution.Height;
\r
204 check_KeepAR.Enabled = true;
\r
205 lbl_anamorphic.Text = "";
\r
206 lbl_anamprohicLbl.Visible = false;
\r
209 if (selectedTitle != null)
\r
211 heightModJumpGaurd = true;
\r
212 text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
\r
213 text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
\r
215 text_height.Enabled = false;
\r
216 text_width.Enabled = false;
\r
217 check_KeepAR.CheckState = CheckState.Unchecked;
\r
218 check_KeepAR.Enabled = false;
\r
219 disableCustomAnaControls();
\r
220 lbl_anamorphic.Text = strictAnamorphic();
\r
221 lbl_anamprohicLbl.Visible = true;
\r
224 disableCustomAnaControls();
\r
226 text_height.Enabled = false;
\r
227 text_width.Enabled = true;
\r
228 if (selectedTitle != null)
\r
230 heightModJumpGaurd = true;
\r
231 text_width.Value = selectedTitle.Resolution.Width;
\r
232 text_height.Value = selectedTitle.Resolution.Height - (int) crop_top.Value - (int) crop_bottom.Value;
\r
234 lbl_anamorphic.Text = looseAnamorphic();
\r
235 lbl_anamprohicLbl.Visible = true;
\r
239 // Display Elements
\r
240 enableCustomAnaControls();
\r
241 text_height.Enabled = true;
\r
242 text_width.Enabled = true;
\r
245 if (selectedTitle != null)
\r
247 heightModJumpGaurd = true;
\r
248 widthVal = selectedTitle.Resolution.Width;
\r
249 text_width.Value = selectedTitle.Resolution.Width - (int)crop_left.Value - (int)crop_right.Value;
\r
250 text_height.Value = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
\r
251 txt_parWidth.Text = selectedTitle.ParVal.Width.ToString();
\r
252 txt_parHeight.Text = selectedTitle.ParVal.Height.ToString();
\r
253 txt_displayWidth.Text = displayWidth().ToString(Culture);
\r
256 darValue = calculateDar();
\r
258 check_KeepAR.CheckState = CheckState.Checked;
\r
259 check_KeepAR.Enabled = true;
\r
260 lbl_anamprohicLbl.Visible = true;
\r
265 // A Picture Setting has changed so raise a PictureSettingsChanged event.
\r
266 if (this.PictureSettingsChanged != null)
\r
267 this.PictureSettingsChanged(this, new EventArgs());
\r
270 // Custom Anamorphic Controls
\r
271 private void txt_displayWidth_Keyup(object sender, KeyEventArgs e)
\r
273 if (e.KeyCode == Keys.Enter)
\r
274 customAnamorphic(txt_displayWidth);
\r
276 private void txt_parHeight_Keyup(object sender, KeyEventArgs e)
\r
278 if (e.KeyCode == Keys.Enter)
\r
279 customAnamorphic(txt_parHeight);
\r
281 private void txt_parWidth_Keyup(object sender, KeyEventArgs e)
\r
283 if (e.KeyCode == Keys.Enter)
\r
284 customAnamorphic(txt_parWidth);
\r
287 // Cropping Controls
\r
288 private void check_autoCrop_CheckedChanged(object sender, EventArgs e)
\r
290 crop_left.Enabled = false;
\r
291 crop_right.Enabled = false;
\r
292 crop_top.Enabled = false;
\r
293 crop_bottom.Enabled = false;
\r
295 private void check_customCrop_CheckedChanged(object sender, EventArgs e)
\r
297 crop_left.Enabled = true;
\r
298 crop_right.Enabled = true;
\r
299 crop_top.Enabled = true;
\r
300 crop_bottom.Enabled = true;
\r
301 if (selectedTitle != null)
\r
303 crop_top.Value = selectedTitle.AutoCropDimensions[0];
\r
304 crop_bottom.Value = selectedTitle.AutoCropDimensions[1];
\r
305 crop_left.Value = selectedTitle.AutoCropDimensions[2];
\r
306 crop_right.Value = selectedTitle.AutoCropDimensions[3];
\r
310 crop_left.Value = 0;
\r
311 crop_right.Value = 0;
\r
312 crop_top.Value = 0;
\r
313 crop_bottom.Value = 0;
\r
316 private void crop_left_ValueChanged(object sender, EventArgs e)
\r
318 if (crop_left.Value % 2 != 0)
\r
321 private void crop_right_ValueChanged(object sender, EventArgs e)
\r
323 if (crop_right.Value % 2 != 0)
\r
324 crop_right.Value++;
\r
326 private void crop_top_ValueChanged(object sender, EventArgs e)
\r
328 if (crop_top.Value % 2 != 0)
\r
331 private void crop_bottom_ValueChanged(object sender, EventArgs e)
\r
333 if (crop_bottom.Value % 2 != 0)
\r
334 crop_bottom.Value++;
\r
337 // Custom Anamorphic Code
\r
338 private void customAnamorphic(Control control)
\r
340 // Get and parse all the required values
\r
341 int cropLeft = (int)crop_left.Value;
\r
342 int cropRight = (int)crop_right.Value;
\r
344 int width = (int)text_width.Value;
\r
345 int cropped_width = width - cropLeft - cropRight;
\r
348 int.TryParse(drop_modulus.SelectedItem.ToString(), out mod);
\r
351 double displayWidth;
\r
352 int.TryParse(txt_parWidth.Text, out parW);
\r
353 int.TryParse(txt_parHeight.Text, out parH);
\r
354 double.TryParse(txt_displayWidth.Text, out displayWidth);
\r
356 /* NOT KEEPING DISPLAY ASPECT
\r
357 * Changing STORAGE WIDTH changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
\r
358 * Changing PIXEL dimensions changes DISPLAY WIDTH to STORAGE WIDTH * PIXEL WIDTH / PIXEL HEIGHT
\r
359 * Changing DISPLAY WIDTH changes PIXEL WIDTH to DISPLAY WIDTH and PIXEL HEIGHT to STORAGE WIDTH
\r
360 * Changing HEIGHT just....changes the height.
\r
362 if (!check_KeepAR.Checked)
\r
364 switch (control.Name)
\r
367 double dw = (double)cropped_width * parW / parH;
\r
368 dw = Math.Round(dw, 2);
\r
369 txt_displayWidth.Text = dw.ToString(Culture);
\r
371 case "txt_parWidth":
\r
372 double dwpw = (double)cropped_width * parW / parH;
\r
373 dwpw = Math.Round(dwpw, 2);
\r
374 txt_displayWidth.Text = dwpw.ToString(Culture);
\r
376 case "txt_parHeight":
\r
377 double dwph = (double)cropped_width * parW / parH;
\r
378 dwph = Math.Round(dwph, 2);
\r
379 txt_displayWidth.Text = dwph.ToString(Culture);
\r
381 case "txt_displayWidth":
\r
382 txt_parWidth.Text = Math.Round(displayWidth, 0).ToString();
\r
383 txt_parHeight.Text = text_width.Text;
\r
389 * KEEPING DISPLAY ASPECT RATIO
\r
390 * DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
\r
391 * Disable editing: PIXEL WIDTH, PIXEL HEIGHT
\r
392 * Changing DISPLAY WIDTH:
\r
393 * Changes HEIGHT to keep DAR
\r
394 * Changes PIXEL WIDTH to new DISPLAY WIDTH
\r
395 * Changes PIXEL HEIGHT to STORAGE WIDTH
\r
397 * Changes DISPLAY WIDTH to keep DAR
\r
398 * Changes PIXEL WIDTH to new DISPLAY WIDTH
\r
399 * Changes PIXEL HEIGHT to STORAGE WIDTH
\r
400 * Changing STORAGE_WIDTH:
\r
401 * Changes PIXEL WIDTH to DISPLAY WIDTH
\r
402 * Changes PIXEL HEIGHT to new STORAGE WIDTH
\r
405 if (check_KeepAR.Checked)
\r
407 switch (control.Name)
\r
409 case "txt_displayWidth":
\r
410 heightChangeGuard = true;
\r
411 text_height.Value = (decimal)getHeightKeepDar(); //Changes HEIGHT to keep DAR
\r
412 //darValue = calculateDar(); // Cache the dar value
\r
413 txt_parWidth.Text = txt_displayWidth.Text;
\r
414 txt_parHeight.Text = cropped_width.ToString();
\r
416 case "text_height":
\r
417 heightChangeGuard = true;
\r
418 txt_displayWidth.Text = getDisplayWidthKeepDar().ToString(Culture); //Changes DISPLAY WIDTH to keep DAR
\r
419 txt_parWidth.Text = txt_displayWidth.Text;
\r
420 txt_parHeight.Text = cropped_width.ToString();
\r
423 txt_parWidth.Text = txt_displayWidth.Text;
\r
424 txt_parHeight.Text = cropped_width.ToString();
\r
429 private double getDisplayWidthKeepDar()
\r
431 double displayWidth;
\r
432 double.TryParse(txt_displayWidth.Text, out displayWidth);
\r
433 double currentDar = calculateDar();
\r
434 double newDwValue = displayWidth;
\r
436 // Correct display width up or down to correct for dar.
\r
437 if (currentDar > darValue)
\r
439 while (currentDar > darValue)
\r
442 newDwValue = displayWidth;
\r
443 currentDar = calculateDarByVal(text_height.Value, displayWidth);
\r
448 while (currentDar < darValue)
\r
451 newDwValue = displayWidth;
\r
452 currentDar = calculateDarByVal(text_height.Value, displayWidth);
\r
456 return Math.Round(newDwValue, 2);
\r
458 private double getHeightKeepDar()
\r
460 double displayWidth;
\r
461 double.TryParse(txt_displayWidth.Text, out displayWidth);
\r
462 double currentDar = calculateDar();
\r
463 double newHeightVal = heightVal;
\r
465 // Correct display width up or down.
\r
466 if (currentDar > darValue)
\r
468 while (currentDar > darValue)
\r
471 newHeightVal = heightVal;
\r
472 currentDar = calculateDarByVal(heightVal, displayWidth);
\r
477 while (currentDar < darValue)
\r
480 newHeightVal = heightVal;
\r
481 currentDar = calculateDarByVal(heightVal, displayWidth);
\r
485 return newHeightVal;
\r
487 private double calculateDar()
\r
489 // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
\r
490 double displayWidth;
\r
491 double.TryParse(txt_displayWidth.Text, out displayWidth);
\r
493 double calculatedDar = displayWidth / (int)text_height.Value;
\r
495 return calculatedDar;
\r
497 private double calculateDarByVal(decimal croppedHeight, double displayWidth)
\r
499 // DAR = DISPLAY WIDTH / DISPLAY HEIGHT (cache after every modification)
\r
500 double calculatedDar = darValue;
\r
501 if (croppedHeight > 0)
\r
502 calculatedDar = displayWidth / (double)croppedHeight;
\r
504 return calculatedDar;
\r
506 private int displayWidth()
\r
508 if (selectedTitle != null)
\r
510 int actualWidth = (int)text_width.Value;
\r
511 int displayWidth = 0;
\r
514 int.TryParse(txt_parWidth.Text, out parW);
\r
515 int.TryParse(txt_parHeight.Text, out parH);
\r
517 if (drp_anamorphic.SelectedIndex != 3)
\r
518 displayWidth = (actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);
\r
519 else if (parW > 0 && parH > 0)
\r
520 displayWidth = (actualWidth * parW / parH);
\r
522 return displayWidth;
\r
527 // Resolution calculation and controls
\r
528 private decimal widthChangeMod(int mod)
\r
530 // Increase or decrease the height based on the users input.
\r
531 decimal returnVal = text_width.Value > widthVal ? getResolutionJump(mod, text_width.Value, true) : getResolutionJump(mod, text_width.Value, false);
\r
533 // Make sure we don't go above source value
\r
534 if (selectedTitle != null)
\r
535 if (selectedTitle.Resolution.Width < returnVal)
\r
536 returnVal = selectedTitle.Resolution.Width;
\r
538 /*if (returnVal < 64)
\r
541 // Set the global tracker
\r
542 widthVal = (int)returnVal;
\r
546 private decimal heightChangeMod(int mod)
\r
548 // Increase or decrease the height based on the users input.
\r
549 decimal returnVal = text_height.Value > heightVal ? getResolutionJump(mod, text_height.Value, true) : getResolutionJump(mod, text_height.Value, false);
\r
551 // Make sure we don't go above source value
\r
552 if (selectedTitle != null)
\r
553 if (selectedTitle.Resolution.Height < returnVal)
\r
554 returnVal = selectedTitle.Resolution.Height;
\r
556 /*if (returnVal < 64)
\r
559 // Set the global tracker
\r
560 heightVal = (int)returnVal;
\r
564 private decimal calculateUnchangeValue(Boolean widthChangeFromControl)
\r
566 decimal newValue = -1;
\r
567 if (selectedTitle != null && drp_anamorphic.SelectedIndex != 3 && drp_anamorphic.SelectedIndex != 2)
\r
568 if (widthChangeFromControl)
\r
569 newValue = cacluateHeight(widthVal);
\r
572 if (check_KeepAR.Checked)
\r
573 newValue = cacluateWidth(heightVal);
\r
578 private int getResolutionJump(int mod, decimal value, Boolean up)
\r
581 while ((value % mod) != 0)
\r
584 while ((value % mod) != 0)
\r
589 private double getModulusAuto(int mod, double value)
\r
591 int modDiv2 = mod / 2;
\r
593 if ((value % mod) != 0)
\r
595 double modVal = (int)value % mod;
\r
596 if (modVal >= modDiv2)
\r
598 modVal = 16 - modVal;
\r
599 value = (int)value + (int)modVal;
\r
603 value = (int)value - (int)modVal;
\r
608 private int cacluateHeight(int width)
\r
610 if (selectedTitle != null)
\r
614 if (selectedTitle.AspectRatio == 1.78F)
\r
619 if (selectedTitle.AspectRatio == 1.33F)
\r
627 // Crop_Width = Title->Width - crop_Left - crop_right
\r
628 // Crop_Height = Title->Height - crop_top - crop_bottom
\r
629 double crop_width = selectedTitle.Resolution.Width - (double) crop_left.Value -
\r
630 (double) crop_right.Value;
\r
631 double crop_height = selectedTitle.Resolution.Height - (double) crop_top.Value -
\r
632 (double) crop_bottom.Value;
\r
634 double new_height = (width*selectedTitle.Resolution.Width*ah*crop_height)/
\r
635 (selectedTitle.Resolution.Height*aw*crop_width);
\r
637 new_height = drp_anamorphic.SelectedIndex == 3 ? getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_height) : getModulusAuto(16, new_height);
\r
639 int x = int.Parse(new_height.ToString());
\r
647 private int cacluateWidth(int height)
\r
651 if (selectedTitle.AspectRatio == 1.78F)
\r
656 if (selectedTitle.AspectRatio == 1.33F)
\r
665 double crop_width = selectedTitle.Resolution.Width - (double)crop_left.Value - (double)crop_right.Value;
\r
666 double crop_height = selectedTitle.Resolution.Height - (double)crop_top.Value - (double)crop_bottom.Value;
\r
668 double new_width = (height * selectedTitle.Resolution.Height * aw * crop_width) /
\r
669 (selectedTitle.Resolution.Width * ah * crop_height);
\r
671 if (drp_anamorphic.SelectedIndex == 3)
\r
672 new_width = getModulusAuto(int.Parse(drop_modulus.SelectedItem.ToString()), new_width);
\r
674 new_width = getModulusAuto(16, new_width);
\r
677 int x = int.Parse(new_width.ToString());
\r
687 // Calculate Resolution for Anamorphic functions
\r
688 private string strictAnamorphic()
\r
690 // TODO Make sure cropping is Mod2
\r
691 if (selectedTitle != null)
\r
693 // Calculate the Actual Height
\r
694 int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value; ;
\r
695 int actualHeight = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
\r
697 // Calculate Actual Width
\r
698 double displayWidth = ((double)actualWidth * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height);
\r
699 return Math.Round(displayWidth, 0) + "x" + actualHeight;
\r
701 return "Select a Title";
\r
703 private string looseAnamorphic()
\r
705 if (selectedTitle != null)
\r
708 int actualWidth = (int)text_width.Value - (int)crop_left.Value - (int)crop_right.Value;
\r
710 int source_display_width = selectedTitle.Resolution.Width * selectedTitle.ParVal.Width / selectedTitle.ParVal.Height;
\r
711 int source_cropped_height = selectedTitle.Resolution.Height - (int)crop_top.Value - (int)crop_bottom.Value;
\r
713 // Calculate storage Aspect and cache it for reuse
\r
714 if (storageAspect == 0)
\r
715 storageAspect = (double)actualWidth / source_cropped_height;
\r
717 // Calculate the new height based on the input cropped width
\r
718 double hcalc = (actualWidth / storageAspect) + 0.5;
\r
719 double newHeight = getModulusAuto(16, hcalc);
\r
720 looseAnamorphicHeightGuard = true;
\r
722 if (newHeight < 64)
\r
724 text_height.Value = (decimal)newHeight; // BUG Out of Range Exception with Width too low here.
\r
726 // Calculate the anamorphic width
\r
727 double parW = newHeight * source_display_width / source_cropped_height;
\r
728 double parH = actualWidth;
\r
729 double displayWidth = (actualWidth * parW / parH);
\r
731 // Now correct DisplayWidth to maintain Aspect ratio. ActualHeight was mod16'd and thus AR is slightly different than the worked out displayWidths
\r
732 return Math.Truncate(displayWidth) + "x" + newHeight;
\r
734 return "Select a Title";
\r
739 private void disableCustomAnaControls()
\r
741 // Disable Custom Anamorphic Stuff
\r
742 lbl_modulus.Visible = false;
\r
743 lbl_displayWidth.Visible = false;
\r
744 lbl_parWidth.Visible = false;
\r
745 lbl_parHeight.Visible = false;
\r
746 drop_modulus.Visible = false;
\r
747 txt_displayWidth.Visible = false;
\r
748 txt_parWidth.Visible = false;
\r
749 txt_parHeight.Visible = false;
\r
750 check_KeepAR.Enabled = false;
\r
752 private void enableCustomAnaControls()
\r
754 // Disable Custom Anamorphic Stuff
\r
755 lbl_modulus.Visible = true;
\r
756 lbl_displayWidth.Visible = true;
\r
757 lbl_parWidth.Visible = true;
\r
758 lbl_parHeight.Visible = true;
\r
759 drop_modulus.Visible = true;
\r
760 txt_displayWidth.Visible = true;
\r
761 txt_parWidth.Visible = true;
\r
762 txt_parHeight.Visible = true;
\r
763 check_KeepAR.Enabled = true;
\r