X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FPictureController.m;h=4cc39331ff95cccf8a70b1b9c2677e5c84f7975b;hb=55b0015a8c50106e553bc2f48336cc2a1c495459;hp=e70ec80eb587690aa0b74fce2fb44cbca8cd34ad;hpb=8aa64c566fb41085d012b82621d906209731042d;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/PictureController.m b/macosx/PictureController.m index e70ec80e..4cc39331 100644 --- a/macosx/PictureController.m +++ b/macosx/PictureController.m @@ -36,14 +36,8 @@ //------------------------------------------------------------------------------------ - (IBAction) showPictureWindow: (id)sender { - if ([fPreviewController fullScreen] == YES) - { - [self showWindow:sender]; - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureSizeWindowIsOpen"]; - [self setToFullScreenMode]; - } - else - { + + if ([[self window] isVisible]) { [[self window] close]; @@ -54,15 +48,12 @@ [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"PictureSizeWindowIsOpen"]; [self setToWindowedMode]; } - } + [self adjustFilterDisplay:nil]; [self adjustSizingDisplay:nil]; } -- (BOOL) previewFullScreenMode -{ - return [fPreviewController fullScreen]; -} + /* this method is used to detect clicking on a tab in fSizeFilterView */ - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem @@ -150,8 +141,6 @@ [fParHeightLabel setHidden: NO]; [fDisplayWidthField setHidden: NO]; [fDisplayWidthLabel setHidden: NO]; - [fModulusLabel setHidden: NO]; - [fModulusPopUp setHidden: NO]; /* adjust/move keep ar checkbox */ [fRatioLabel setHidden: YES]; [fRatioLabel2 setHidden: NO]; @@ -192,8 +181,6 @@ [fParHeightLabel setHidden: YES]; [fDisplayWidthField setHidden: YES]; [fDisplayWidthLabel setHidden: YES]; - [fModulusLabel setHidden: YES]; - [fModulusPopUp setHidden: YES]; /* adjust/move keep ar checkbox */ [fRatioLabel setHidden: NO]; [fRatioLabel2 setHidden: YES]; @@ -400,10 +387,7 @@ #pragma mark - -- (IBAction) previewGoWindowed: (id)sender -{ - [fPreviewController goWindowedScreen:self]; -} + - (IBAction) showPreviewWindow: (id)sender { @@ -413,16 +397,6 @@ - -- (void) setToFullScreenMode -{ - int32_t shieldLevel = CGShieldingWindowLevel(); - - [fPictureWindow setLevel:shieldLevel + 1]; - // Show the window. - [fPictureWindow makeKeyAndOrderFront:self]; -} - - (void) setToWindowedMode { /* Set the window back to Floating Window mode @@ -532,15 +506,16 @@ [fModulusPopUp addItemWithTitle: @"8"]; [fModulusPopUp addItemWithTitle: @"4"]; [fModulusPopUp addItemWithTitle: @"2"]; - if (job->anamorphic.mode == 3) + if (job->modulus) { - [fModulusPopUp selectItemWithTitle: [NSString stringWithFormat:@"%d",job->anamorphic.modulus]]; + [fModulusPopUp selectItemWithTitle: [NSString stringWithFormat:@"%d",job->modulus]]; } else { - [fModulusPopUp selectItemWithTitle: @"16"]; + [fModulusPopUp selectItemAtIndex: 0]; } + /* We initially set the previous state of keep ar to on */ keepAspectRatioPreviousState = 1; if (!autoCrop) @@ -648,8 +623,43 @@ - (IBAction) SettingsChanged: (id) sender { hb_job_t * job = fTitle->job; - [fModulusPopUp setEnabled:NO]; - job->anamorphic.modulus = 16; + + /* if we are anything but strict anamorphic */ + if ([fAnamorphicPopUp indexOfSelectedItem] != 1) + { + [fModulusLabel setHidden:NO]; + [fModulusPopUp setHidden:NO]; + if (sender == fModulusPopUp) + { + /* do a dry run with hb_fix aspect to get new modulus */ + job->modulus = [[fModulusPopUp titleOfSelectedItem] intValue]; + job->keep_ratio = 1; + hb_fix_aspect( job, HB_KEEP_WIDTH ); + if( job->height > fTitle->height ) + { + job->height = fTitle->height; + hb_fix_aspect( job, HB_KEEP_HEIGHT ); + } + [fWidthStepper setIntValue: job->width]; + [fWidthField setIntValue: job->width]; + if( [fAnamorphicPopUp indexOfSelectedItem] != 2) // if we are not loose or custom + { + [fHeightStepper setIntValue: job->height]; + [fHeightField setIntValue: job->height]; + } + } + } + else + { + /* we are strict so hide the mod popup since libhb uses mod 2 for strict anamorphic*/ + [fModulusLabel setHidden:YES]; + [fModulusPopUp setHidden:YES]; + } + + job->modulus = [[fModulusPopUp titleOfSelectedItem] intValue]; + + [fWidthStepper setIncrement: job->modulus]; + [fHeightStepper setIncrement: job->modulus]; /* Since custom anamorphic allows for a height setting > fTitle->height * check to make sure it is returned to fTitle->height for all other modes @@ -687,14 +697,6 @@ job->anamorphic.par_width = titleParWidth; job->anamorphic.par_height = titleParHeight; [fRatioLabel setHidden: NO]; - - [fWidthStepper setIncrement: 16]; - [fHeightStepper setIncrement: 16]; - } - else - { - [fWidthStepper setIncrement: [[fModulusPopUp titleOfSelectedItem] intValue]]; - [fHeightStepper setIncrement: [[fModulusPopUp titleOfSelectedItem] intValue]]; } if( [fAnamorphicPopUp indexOfSelectedItem] > 0 ) @@ -752,9 +754,7 @@ job->anamorphic.mode = 3; /* Set the status of our custom ana only widgets accordingly */ - /* for mod 3 we can use modulus other than 16 */ [fModulusPopUp setEnabled:YES]; - job->anamorphic.modulus = [[fModulusPopUp titleOfSelectedItem] intValue]; [fWidthStepper setEnabled: YES]; [fWidthField setEnabled: YES];