summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordynaflash <[email protected]>2007-09-19 15:27:05 +0000
committerdynaflash <[email protected]>2007-09-19 15:27:05 +0000
commit902f387e66ff0ee960616765a4fcc8ac936d0558 (patch)
treeb96136a1637a07ff325d8ef2f871e8b52146a4ee /macosx
parent7081f9c6d5a2d56f7d4f17a5fdb9c22245b24caf (diff)
MacGui: Keep track of the state of the keep aspect ratio checkbox when turning on anamorphic so it can be changed back to its previous state when anamorphic is turned off.
- Allows for easier comparison of anamorphic vs. non anamorphic. - Good idea jbrjake git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@975 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/PictureController.h6
-rw-r--r--macosx/PictureController.mm31
2 files changed, 27 insertions, 10 deletions
diff --git a/macosx/PictureController.h b/macosx/PictureController.h
index 98cf3ddcd..4c13a06fc 100644
--- a/macosx/PictureController.h
+++ b/macosx/PictureController.h
@@ -52,6 +52,12 @@
int MaxOutputHeight;
BOOL autoCrop;
+ /* used to track the previous state of the keep aspect
+ ratio checkbox when turning anamorphic on, so it can be
+ returned to the previous state when anamorphic is turned
+ off */
+ BOOL keepAspectRatioPreviousState;
+
struct {
int detelecine;
int deinterlace;
diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm
index a2a456e75..a1441acf7 100644
--- a/macosx/PictureController.mm
+++ b/macosx/PictureController.mm
@@ -118,7 +118,8 @@ static int GetAlignedSize( int size )
[fDeinterlacePopUp selectItemAtIndex: fPictureFilterSettings.deinterlace];
[fPARCheck setState:(job->pixel_ratio ? NSOnState : NSOffState)];
-
+ /* We initially set the previous state of keep ar to on */
+ keepAspectRatioPreviousState = 1;
if (!autoCrop)
{
[fCropMatrix selectCellAtRow: 1 column:0];
@@ -163,6 +164,7 @@ static int GetAlignedSize( int size )
MaxOutputWidth = job->width;
MaxOutputHeight = job->height;
fPicture = 0;
+
[self SettingsChanged: nil];
}
@@ -266,27 +268,36 @@ static int GetAlignedSize( int size )
show distorted preview picture ratio */
[fHeightStepper setIntValue: fTitle->height-fTitle->job->crop[0]-fTitle->job->crop[1]];
[fHeightField setIntValue: fTitle->height-fTitle->job->crop[0]-fTitle->job->crop[1]];
-
- /* This will show wrong anamorphic height values, but
- show proper preview picture ratio */
- //[fHeightStepper setIntValue: MaxOutputHeight];
- //[fHeightField setIntValue: MaxOutputHeight];
+
+ /* if the sender is the Anamorphic checkbox, record the state
+ of KeepAspect Ratio so it can be reset if Anamorphic is unchecked again */
+ if (sender == fPARCheck)
+ {
+ keepAspectRatioPreviousState = [fRatioCheck state];
+ }
[fRatioCheck setState:NSOffState];
+ [fRatioCheck setEnabled: NO];
[fWidthStepper setEnabled: NO];
[fWidthField setEnabled: NO];
[fHeightStepper setEnabled: NO];
[fHeightField setEnabled: NO];
- [fRatioCheck setEnabled: NO];
+
}
-
- else
+ else
{
[fWidthStepper setEnabled: YES];
[fWidthField setEnabled: YES];
[fHeightStepper setEnabled: YES];
[fHeightField setEnabled: YES];
[fRatioCheck setEnabled: YES];
+ /* if the sender is the Anamorphic checkbox, we return the
+ keep AR checkbox to its previous state */
+ if (sender == fPARCheck)
+ {
+ [fRatioCheck setState:keepAspectRatioPreviousState];
+ }
+
}
job->width = [fWidthStepper intValue];
@@ -314,7 +325,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 ) );