diff options
author | sr55 <[email protected]> | 2015-05-07 17:52:36 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-05-07 17:52:36 +0000 |
commit | 86cbd6ce4d2c0f2b89d2933b9061e523e059d4dd (patch) | |
tree | f9cdee8106959d8c7a3fd36d98b3a3c4ac6768f6 /win/CS/HandBrake.ApplicationServices | |
parent | 17f4930018d7e23e95edd8a53a4e0f3e7d98a4ff (diff) |
WinGui: Restore Preview functionality. The calc logic still needs fixed as there are a few edge cases that still todate don't work.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7164 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs | 13 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs | 11 |
2 files changed, 16 insertions, 8 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index 8aafbc02d..e46f5b30b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -274,8 +274,8 @@ namespace HandBrake.ApplicationServices.Interop hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{
crop = new[] { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right },
- itu_par = 0,
- keep = settings.KeepDisplayAspect ? 0x04 : 0,
+ itu_par = 0,
+ keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (settings.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
maxWidth = settings.MaxWidth,
maxHeight = settings.MaxHeight,
mode = (int)(hb_anamorphic_mode_t)settings.Anamorphic,
@@ -291,13 +291,10 @@ namespace HandBrake.ApplicationServices.Interop };
// Sanitize the input.
- Geometry resultGeometry = AnamorphicFactory.CreateGeometry(
- settings,
- new SourceVideoInfo(
- new Size(title.Geometry.Width, title.Geometry.Height),
- new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)));
- int width = resultGeometry.Width;
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(settings, new SourceVideoInfo(new Size(title.Geometry.Width, title.Geometry.Height), new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)));
+ int width = resultGeometry.Width * resultGeometry.PAR.Num / resultGeometry.PAR.Den;
int height = resultGeometry.Height;
+
uiGeometry.geometry.width = width;
uiGeometry.geometry.height = height;
uiGeometry.geometry.par.num = settings.PixelAspectX;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs index bcc7f2714..8cf266d7e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs @@ -30,6 +30,17 @@ namespace HandBrake.ApplicationServices.Interop.Model.Preview /// <param name="task">The task.</param>
public PreviewSettings(EncodeTask task)
{
+ this.Cropping = new Cropping(task.Cropping);
+ this.MaxWidth = task.MaxWidth ?? 0;
+ this.MaxHeight = task.MaxHeight ?? 0;
+ this.KeepDisplayAspect = task.KeepDisplayAspect;
+ this.TitleNumber = task.Title;
+ this.Anamorphic = task.Anamorphic;
+ this.Modulus = task.Modulus;
+ this.Width = task.Width ?? 0;
+ this.Height = task.Height ?? 0;
+ this.PixelAspectX = task.PixelAspectX;
+ this.PixelAspectY = task.PixelAspectY;
}
/// <summary>
|