summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordynaflash <[email protected]>2007-07-06 15:32:34 +0000
committerdynaflash <[email protected]>2007-07-06 15:32:34 +0000
commitc844ec634f42c7a2092fe0829cf4663ea836a276 (patch)
tree6f292af378ded60bf28e94601635099bfe860740
parent57ccb9bd7ccd5431c2865de38862ac2ec8503059 (diff)
MacGui: Add auto crop value to main window
- shows if you are using Auto or Custom cropping in the Video tab of the main window. - Prepares controller.mm to better use custom/auto cropping values particularly with presets. - Required since auto crop is not currently stored in a title or job variable, and proper use of cropping for presets requires the preset to know what cropping to actually use. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@651 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/Controller.h4
-rw-r--r--macosx/Controller.mm64
-rw-r--r--macosx/English.lproj/MainMenu.nib/classes.nib3
-rw-r--r--macosx/English.lproj/MainMenu.nib/info.nib4
-rw-r--r--macosx/English.lproj/MainMenu.nib/keyedobjects.nibbin123018 -> 124049 bytes
-rw-r--r--macosx/PictureController.h5
-rw-r--r--macosx/PictureController.mm10
7 files changed, 70 insertions, 20 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h
index 695fa98f6..bd0985774 100644
--- a/macosx/Controller.h
+++ b/macosx/Controller.h
@@ -76,7 +76,7 @@
IBOutlet NSButton * fVidTwoPassCheck;
IBOutlet NSButton * fVidTurboPassCheck;
- /* Picture Settings box */
+ /* Picture Settings box fPicSettingAutoCropDsply*/
IBOutlet NSTextField * fPicLabelSettings;
IBOutlet NSTextField * fPicLabelSrc;
IBOutlet NSTextField * fPicLabelOutp;
@@ -94,6 +94,8 @@
IBOutlet NSTextField * fPicSettingDeinterlace;
IBOutlet NSTextField * fPicSettingARkeepDsply;
IBOutlet NSTextField * fPicSettingPARDsply;
+ IBOutlet NSTextField * fPicSettingAutoCrop;
+ IBOutlet NSTextField * fPicSettingAutoCropDsply;
IBOutlet NSTextField * fPicSettingDeinterlaceDsply;
IBOutlet NSTextField * fPicLabelAnamorphic;
IBOutlet NSTextField * fPicLabelPAROutp;
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 8a64f4a0a..12035d7e6 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -480,8 +480,12 @@ return registrationDictionary;
// Select the longuest title
[fSrcTitlePopUp selectItemAtIndex: indxpri];
/* We set the Settings Display to "Default" here
- until we get default presets implemented */
+ until we get default presets implemented */
[fPresetSelectedDisplay setStringValue: @"Default"];
+ /* We set the auto crop in the main window to value "1" just as in PictureController,
+ as it does not seem to be taken from any job-> variable */
+ [fPicSettingAutoCrop setStringValue: [NSString stringWithFormat:
+ @"%d", 1]];
[self TitlePopUpChanged: NULL];
[self EnableUI: YES];
@@ -1919,29 +1923,39 @@ return registrationDictionary;
/* Set ON/Off values for the deinterlace/keep aspect ratio according to boolean */
if (fTitle->job->keep_ratio > 0)
- {
+ {
[fPicSettingARkeepDsply setStringValue: @"On"];
- }
- else
- {
+ }
+ else
+ {
[fPicSettingARkeepDsply setStringValue: @"Off"];
- }
+ }
if (fTitle->job->deinterlace > 0)
- {
+ {
[fPicSettingDeinterlaceDsply setStringValue: @"On"];
- }
- else
- {
+ }
+ else
+ {
[fPicSettingDeinterlaceDsply setStringValue: @"Off"];
- }
+ }
if (fTitle->job->pixel_ratio > 0)
- {
+ {
[fPicSettingPARDsply setStringValue: @"On"];
- }
- else
- {
+ }
+ else
+ {
[fPicSettingPARDsply setStringValue: @"Off"];
- }
+ }
+ /* Set the display field for crop as per boolean */
+ if ([[fPicSettingAutoCrop stringValue] isEqualToString: @"0"])
+ {
+ [fPicSettingAutoCropDsply setStringValue: @"Custom"];
+ }
+ else
+ {
+ [fPicSettingAutoCropDsply setStringValue: @"Auto"];
+ }
+
/* below will trigger the preset, if selected, to be
changed to "Custom". Lets comment out for now until
we figure out a way to determine if the picture values
@@ -2980,6 +2994,8 @@ the user is using "Custom" settings by determining the sender*/
[preset setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
/* Set crop settings here */
/* The Auto Crop Matrix in the Picture Window autodetects differences in crop settings */
+ //[preset setObject:[NSNumber numberWithInt:[[fPictureController fCropMatrix] selectedRow]] forKey:@"PictureAutoCrop"];
+
[preset setObject:[NSNumber numberWithInt:job->crop[0]] forKey:@"PictureTopCrop"];
[preset setObject:[NSNumber numberWithInt:job->crop[1]] forKey:@"PictureBottomCrop"];
[preset setObject:[NSNumber numberWithInt:job->crop[2]] forKey:@"PictureLeftCrop"];
@@ -3040,6 +3056,7 @@ the user is using "Custom" settings by determining the sender*/
/* Basic Picture Settings */
/* Use Max Picture settings for whatever the dvd is.*/
[preset setObject:[NSNumber numberWithInt:0] forKey:@"UsesMaxPictureSettings"];
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"PictureAutoCrop"];
[preset setObject:[NSNumber numberWithInt:320] forKey:@"PictureWidth"];
[preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureHeight"];
[preset setObject:[NSNumber numberWithInt:1] forKey:@"PictureKeepRatio"];
@@ -3469,10 +3486,25 @@ the user is using "Custom" settings by determining the sender*/
hb_fix_aspect( job, HB_KEEP_WIDTH );
}
job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
+ /* AutoCrop is in preset, then use the autocrop settings for each dvd */
+ if ([[chosenPreset objectForKey:@"PictureAutoCrop"] intValue] == 1)
+ {
+ [fPicSettingAutoCrop setStringValue: [NSString stringWithFormat:
+ @"%d", 1]];
+ job->crop[0] = [[chosenPreset objectForKey:@"PictureTopCrop"] intValue];
+ job->crop[1] = [[chosenPreset objectForKey:@"PictureBottomCrop"] intValue];
+ job->crop[2] = [[chosenPreset objectForKey:@"PictureLeftCrop"] intValue];
+ job->crop[3] = [[chosenPreset objectForKey:@"PictureRightCrop"] intValue];
+ }
+ else /* if custom crop has been saved in preset, use the saved custom cropping regardless of the source */
+ {
+ [fPicSettingAutoCrop setStringValue: [NSString stringWithFormat:
+ @"%d", 0]];
job->crop[0] = [[chosenPreset objectForKey:@"PictureTopCrop"] intValue];
job->crop[1] = [[chosenPreset objectForKey:@"PictureBottomCrop"] intValue];
job->crop[2] = [[chosenPreset objectForKey:@"PictureLeftCrop"] intValue];
job->crop[3] = [[chosenPreset objectForKey:@"PictureRightCrop"] intValue];
+ }
}
[self CalculatePictureSizing: NULL];
}
diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib
index e0a6c8585..15620d1ec 100644
--- a/macosx/English.lproj/MainMenu.nib/classes.nib
+++ b/macosx/English.lproj/MainMenu.nib/classes.nib
@@ -88,6 +88,8 @@
fPicLabelSrcX = NSTextField;
fPicSettingARkeep = NSTextField;
fPicSettingARkeepDsply = NSTextField;
+ fPicSettingAutoCrop = NSTextField;
+ fPicSettingAutoCropDsply = NSTextField;
fPicSettingDeinterlace = NSTextField;
fPicSettingDeinterlaceDsply = NSTextField;
fPicSettingHeight = NSTextField;
@@ -206,6 +208,7 @@
CLASS = PictureController;
LANGUAGE = ObjC;
OUTLETS = {
+ fAutoCropMainWindow = NSTextField;
fCropBottomField = NSTextField;
fCropBottomStepper = NSStepper;
fCropLeftField = NSTextField;
diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib
index d207af74b..79e22dcbb 100644
--- a/macosx/English.lproj/MainMenu.nib/info.nib
+++ b/macosx/English.lproj/MainMenu.nib/info.nib
@@ -19,9 +19,9 @@
</array>
<key>IBOpenObjects</key>
<array>
- <integer>1162</integer>
- <integer>1867</integer>
<integer>29</integer>
+ <integer>21</integer>
+ <integer>1162</integer>
</array>
<key>IBSystem Version</key>
<string>8R2218</string>
diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
index 708eaf536..30456fee3 100644
--- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
+++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/macosx/PictureController.h b/macosx/PictureController.h
index 46b8b3d98..973a0e2ff 100644
--- a/macosx/PictureController.h
+++ b/macosx/PictureController.h
@@ -43,8 +43,13 @@
IBOutlet NSButton * fNextButton;
IBOutlet NSTextField * fInfoField;
+
+
int MaxOutputWidth;
int MaxOutputHeight;
+
+ /* widgets in main window */
+ IBOutlet NSTextField * fAutoCropMainWindow;
}
diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm
index 96d0a2e81..902c71c13 100644
--- a/macosx/PictureController.mm
+++ b/macosx/PictureController.mm
@@ -87,7 +87,14 @@ static int GetAlignedSize( int size )
[fCropRightStepper setMaxValue: title->width/2-2];
[fDeinterlaceCheck setState: job->deinterlace ? NSOnState : NSOffState];
[fPARCheck setState: job->pixel_ratio ? NSOnState : NSOffState];
-
+ if ([fAutoCropMainWindow intValue] == 0)
+ {
+ [fCropMatrix selectCellAtRow: 1 column:0];
+ }
+ else
+ {
+ [fCropMatrix selectCellAtRow: 0 column:0];
+ }
MaxOutputWidth = job->width;
MaxOutputHeight = job->height;
fPicture = 0;
@@ -214,6 +221,7 @@ static int GetAlignedSize( int size )
[fCropBottomStepper setEnabled: !autocrop];
[fCropLeftStepper setEnabled: !autocrop];
[fCropRightStepper setEnabled: !autocrop];
+ [fAutoCropMainWindow setStringValue: [NSString stringWithFormat:@"%d",autocrop]];
if( autocrop )
{
memcpy( job->crop, fTitle->crop, 4 * sizeof( int ) );