X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FPictureController.m;h=4cc39331ff95cccf8a70b1b9c2677e5c84f7975b;hb=55b0015a8c50106e553bc2f48336cc2a1c495459;hp=307962aeb4dc5ce1f119b62b0fd3b53f1537c3ef;hpb=be640fdf6c2ccd5534c4e17ff2d170ad504b1794;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/PictureController.m b/macosx/PictureController.m index 307962ae..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 @@ -520,10 +494,7 @@ [fAnamorphicPopUp removeAllItems]; [fAnamorphicPopUp addItemWithTitle: @"None"]; [fAnamorphicPopUp addItemWithTitle: @"Strict"]; - if (allowLooseAnamorphic) - { [fAnamorphicPopUp addItemWithTitle: @"Loose"]; - } [fAnamorphicPopUp addItemWithTitle: @"Custom"]; [fAnamorphicPopUp selectItemAtIndex: job->anamorphic.mode]; @@ -535,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) @@ -584,7 +556,7 @@ titleParWidth = job->anamorphic.par_width; titleParHeight = job->anamorphic.par_height; - [self SettingsChanged: nil]; + [self SettingsChanged:nil]; } - (IBAction) storageLinkChanged: (id) sender @@ -651,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 @@ -690,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 ) @@ -755,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]; @@ -976,15 +973,14 @@ } - //job->keep_ratio = ( [fRatioCheck state] == NSOnState ); - if ([fAnamorphicPopUp indexOfSelectedItem] != 3) { - job->keep_ratio = ( [fRatioCheck state] == NSOnState ); - if( job->keep_ratio ) + job->keep_ratio = ( [fRatioCheck state] == NSOnState ); + if( job->keep_ratio ) { if( sender == fWidthStepper || sender == fRatioCheck || - sender == fCropTopStepper || sender == fCropBottomStepper ) + sender == fCropTopStepper || sender == fCropBottomStepper|| + sender == fCropMatrix || sender == nil ) { hb_fix_aspect( job, HB_KEEP_WIDTH ); if( job->height > fTitle->height ) @@ -1105,16 +1101,6 @@ autoCrop = setting; } -- (BOOL) allowLooseAnamorphic -{ - return allowLooseAnamorphic; -} - -- (void) setAllowLooseAnamorphic: (BOOL) setting -{ - allowLooseAnamorphic = setting; -} - - (IBAction)showPreviewPanel: (id)sender forTitle: (hb_title_t *)title { //[self SetTitle:title];