summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2009-01-26 18:44:27 +0000
committerjbrjake <[email protected]>2009-01-26 18:44:27 +0000
commita886670f9477c883d3502e24b4ca31efa0db9676 (patch)
treee9b7b1447ff4c8f974a17f79ac708a62e16a3e44 /macosx
parentc3cbf601deb9a119809d1c63b0e067346ad4970a (diff)
Organizes anamorphic parameters in a struct, requiring some minor search and replace changes in the interfaces. Folds the logic for strict anamorphic mode into hb_set_anamorphic_size() and also stakes out a new, more customizable mode 3.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2097 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/Controller.mm28
-rw-r--r--macosx/HBPreviewController.mm12
-rw-r--r--macosx/PictureController.mm8
3 files changed, 24 insertions, 24 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 5c78de06d..18f21cef5 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -1901,7 +1901,7 @@ fWorkingCount = 0;
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
- [queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
+ [queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->anamorphic.mode] forKey:@"PicturePAR"];
NSString * pictureSummary;
pictureSummary = [NSString stringWithFormat:@"Source: %@ Output: %@ Anamorphic: %@",
[fPicSettingsSrc stringValue],
@@ -1996,7 +1996,7 @@ fWorkingCount = 0;
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
[queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
- [queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
+ [queueFileJob setObject:[NSNumber numberWithInt:fTitle->job->anamorphic.mode] forKey:@"PicturePAR"];
/* Set crop settings here */
[queueFileJob setObject:[NSNumber numberWithInt:[fPictureController autoCrop]] forKey:@"PictureAutoCrop"];
@@ -2410,7 +2410,7 @@ fWorkingCount = 0;
hb_fix_aspect( job, HB_KEEP_HEIGHT );
}
}
- job->pixel_ratio = [[queueToApply objectForKey:@"PicturePAR"] intValue];
+ job->anamorphic.mode = [[queueToApply objectForKey:@"PicturePAR"] intValue];
/* If Cropping is set to custom, then recall all four crop values from
@@ -3012,7 +3012,7 @@ fWorkingCount = 0;
job->height = [[queueToApply objectForKey:@"PictureHeight"] intValue];
job->keep_ratio = [[queueToApply objectForKey:@"PictureKeepRatio"] intValue];
- job->pixel_ratio = [[queueToApply objectForKey:@"PicturePAR"] intValue];
+ job->anamorphic.mode = [[queueToApply objectForKey:@"PicturePAR"] intValue];
/* Here we use the crop values saved at the time the preset was saved */
@@ -3890,9 +3890,9 @@ the user is using "Custom" settings by determining the sender*/
to use the index itself but this is easier */
if (videoEncoder == HB_VCODEC_FFMPEG)
{
- if (job->pixel_ratio == 2)
+ if (job->anamorphic.mode == 2)
{
- job->pixel_ratio = 0;
+ job->anamorphic.mode = 0;
}
[fPictureController setAllowLooseAnamorphic:NO];
/* We set the iPod atom checkbox to disabled and uncheck it as its only for x264 in the mp4
@@ -4139,18 +4139,18 @@ the user is using "Custom" settings by determining the sender*/
{
[fPicSettingsOutp setStringValue: [NSString stringWithFormat:@"%d x %d", fTitle->job->width, fTitle->job->height]];
- if (fTitle->job->pixel_ratio == 1)
+ if (fTitle->job->anamorphic.mode == 1)
{
int titlewidth = fTitle->width-fTitle->job->crop[2]-fTitle->job->crop[3];
- int arpwidth = fTitle->job->pixel_aspect_width;
- int arpheight = fTitle->job->pixel_aspect_height;
+ int arpwidth = fTitle->job->anamorphic.par_width;
+ int arpheight = fTitle->job->anamorphic.par_height;
int displayparwidth = titlewidth * arpwidth / arpheight;
int displayparheight = fTitle->height-fTitle->job->crop[0]-fTitle->job->crop[1];
[fPicSettingsOutp setStringValue: [NSString stringWithFormat:@"%d x %d", titlewidth, displayparheight]];
[fPicSettingsAnamorphic setStringValue: [NSString stringWithFormat:@"%d x %d Strict", displayparwidth, displayparheight]];
fTitle->job->keep_ratio = 0;
}
- else if (fTitle->job->pixel_ratio == 2)
+ else if (fTitle->job->anamorphic.mode == 2)
{
hb_job_t * job = fTitle->job;
int output_width, output_height, output_par_width, output_par_height;
@@ -4249,7 +4249,7 @@ the user is using "Custom" settings by determining the sender*/
[fPicSettingDeblock setStringValue: [NSString stringWithFormat:@"%d",[fPictureController deblock]]];
}
- if (fTitle->job->pixel_ratio > 0)
+ if (fTitle->job->anamorphic.mode > 0)
{
[fPicSettingPAR setStringValue: @""];
}
@@ -5782,7 +5782,7 @@ return YES;
hb_fix_aspect( job, HB_KEEP_HEIGHT );
}
}
- job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
+ job->anamorphic.mode = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
}
else // /* If not 0 or 2 we assume objectForKey:@"UsesPictureSettings is 1 which is "Use picture sizing from when the preset was set" */
{
@@ -5810,7 +5810,7 @@ return YES;
hb_fix_aspect( job, HB_KEEP_HEIGHT );
}
}
- job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
+ job->anamorphic.mode = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
}
@@ -6063,7 +6063,7 @@ return YES;
[preset setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
- [preset setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
+ [preset setObject:[NSNumber numberWithInt:fTitle->job->anamorphic.mode] forKey:@"PicturePAR"];
/* Set crop settings here */
[preset setObject:[NSNumber numberWithInt:[fPictureController autoCrop]] forKey:@"PictureAutoCrop"];
diff --git a/macosx/HBPreviewController.mm b/macosx/HBPreviewController.mm
index 6a50d461b..dfcf554ac 100644
--- a/macosx/HBPreviewController.mm
+++ b/macosx/HBPreviewController.mm
@@ -218,17 +218,17 @@ MaxOutputWidth = title->width - job->crop[2] - job->crop[3];
NSSize displaySize = NSMakeSize( ( CGFloat )fTitle->width, ( CGFloat )fTitle->height );
/* Set the picture size display fields below the Preview Picture*/
- if( fTitle->job->pixel_ratio == 1 ) // Original PAR Implementation
+ if( fTitle->job->anamorphic.mode == 1 ) // Original PAR Implementation
{
output_width = fTitle->width-fTitle->job->crop[2]-fTitle->job->crop[3];
output_height = fTitle->height-fTitle->job->crop[0]-fTitle->job->crop[1];
- display_width = output_width * fTitle->job->pixel_aspect_width / fTitle->job->pixel_aspect_height;
+ display_width = output_width * fTitle->job->anamorphic.par_width / fTitle->job->anamorphic.par_height;
[fInfoField setStringValue:[NSString stringWithFormat:
@"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d",
fTitle->width, fTitle->height, output_width, output_height, display_width, output_height]];
- displaySize.width *= ( ( CGFloat )fTitle->job->pixel_aspect_width ) / ( ( CGFloat )fTitle->job->pixel_aspect_height );
+ displaySize.width *= ( ( CGFloat )fTitle->job->anamorphic.par_width ) / ( ( CGFloat )fTitle->job->anamorphic.par_height );
}
- else if (fTitle->job->pixel_ratio == 2) // Loose Anamorphic
+ else if (fTitle->job->anamorphic.mode == 2) // Loose Anamorphic
{
hb_set_anamorphic_size(job, &output_width, &output_height, &output_par_width, &output_par_height);
display_width = output_width * output_par_width / output_par_height;
@@ -251,8 +251,8 @@ MaxOutputWidth = title->width - job->crop[2] - job->crop[3];
{
/* In the case of loose anamorphic, do not resize the window when scaling down */
// FIX ME: we need a new way to do this as we do not havefWidthField anymore
- //if (fTitle->job->pixel_ratio != 2 || [fWidthField intValue] == fTitle->width)
- if (fTitle->job->pixel_ratio != 2 || (fTitle->job->pixel_ratio == 2 && output_width == fTitle->width))
+ //if (fTitle->job->anamorphic.mode != 2 || [fWidthField intValue] == fTitle->width)
+ if (fTitle->job->anamorphic.mode != 2 || (fTitle->job->anamorphic.mode == 2 && output_width == fTitle->width))
{
[self resizeSheetForViewSize:viewSize];
[self setViewSize:viewSize];
diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm
index 9cf401098..e93840c46 100644
--- a/macosx/PictureController.mm
+++ b/macosx/PictureController.mm
@@ -149,7 +149,7 @@
{
[fAnamorphicPopUp addItemWithTitle: @"Loose"];
}
- [fAnamorphicPopUp selectItemAtIndex: job->pixel_ratio];
+ [fAnamorphicPopUp selectItemAtIndex: job->anamorphic.mode];
/* We initially set the previous state of keep ar to on */
keepAspectRatioPreviousState = 1;
@@ -253,7 +253,7 @@ are maintained across different sources */
{
if ([fAnamorphicPopUp indexOfSelectedItem] == 2) // Loose anamorphic
{
- job->pixel_ratio = 2;
+ job->anamorphic.mode = 2;
[fWidthStepper setEnabled: YES];
[fWidthField setEnabled: YES];
/* We set job->width and call hb_set_anamorphic_size in libhb to do a "dry run" to get
@@ -286,7 +286,7 @@ are maintained across different sources */
job->width = [fWidthStepper intValue];
job->height = [fHeightStepper intValue];
- job->pixel_ratio = 1;
+ job->anamorphic.mode = 1;
[fWidthStepper setEnabled: NO];
[fWidthField setEnabled: NO];
}
@@ -309,7 +309,7 @@ are maintained across different sources */
{
job->width = [fWidthStepper intValue];
job->height = [fHeightStepper intValue];
- job->pixel_ratio = 0;
+ job->anamorphic.mode = 0;
[fWidthStepper setEnabled: YES];
[fWidthField setEnabled: YES];
[fHeightStepper setEnabled: YES];