diff options
author | dynaflash <[email protected]> | 2009-02-05 15:55:29 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2009-02-05 15:55:29 +0000 |
commit | 772a0d5bffb5340da396258d52af0e30b8b24a05 (patch) | |
tree | c58d25812235ca07c7ae4dbf0bc2ac4316628937 /macosx | |
parent | b73c90bb0678a98ce90b2d73d7df63f6740e3e18 (diff) |
MacGui: Add preset code for custom filter fields
- If an old preset uses both decomb and deinterlace, decomb will be used and deinterlace will be ignored.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2117 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.mm | 80 | ||||
-rw-r--r-- | macosx/HBFilterController.h | 16 | ||||
-rw-r--r-- | macosx/HBFilterController.mm | 32 |
3 files changed, 94 insertions, 34 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 33f25aa2d..188dc309a 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -5933,53 +5933,76 @@ return YES; { /* Filters */ - /* lets determine what to set the use decomb / deinterlace filter at */ - if ([chosenPreset objectForKey:@"PictureDecombDeinterlace"]) - { - [fPictureFilterController setUseDecomb:[[chosenPreset objectForKey:@"PictureDecombDeinterlace"] intValue]]; - } - else if ([[chosenPreset objectForKey:@"PictureDecomb"] intValue] == 1) - { + /* We only allow *either* Decomb or Deinterlace. So check for the PictureDecombDeinterlace key. + * also, older presets may not have this key, in which case we also check to see if that preset had PictureDecomb + * specified, in which case we use decomb and ignore any possible Deinterlace settings as using both was less than + * sane. + */ + [fPictureFilterController setDecomb:0]; + [fPictureFilterController setDeinterlace:0]; [fPictureFilterController setUseDecomb:1]; - } - - /* Deinterlace */ - if ([chosenPreset objectForKey:@"PictureDeinterlace"]) + if ([[chosenPreset objectForKey:@"PictureDecombDeinterlace"] intValue] == 1 || [[chosenPreset objectForKey:@"PictureDecomb"] intValue] > 0) { - /* We check to see if the preset used the past fourth "Slowest" deinterlaceing and set that to "Slower - * since we no longer have a fourth "Slowest" deinterlacing due to the mcdeint bug */ - if ([[chosenPreset objectForKey:@"PictureDeinterlace"] intValue] == 4) + /* we are using decomb */ + /* Decomb */ + if ([[chosenPreset objectForKey:@"PictureDecomb"] intValue] > 0) { - [fPictureFilterController setDeinterlace:3]; + [fPictureFilterController setDecomb:[[chosenPreset objectForKey:@"PictureDecomb"] intValue]]; + + /* if we are using "Custom" in the decomb setting, also set the custom string*/ + if ([[chosenPreset objectForKey:@"PictureDecomb"] intValue] == 2) + { + [fPictureFilterController setDecombCustomString:[chosenPreset objectForKey:@"PictureDecombCustom"]]; + } } - else + } + else + { + /* We are using Deinterlace */ + /* Deinterlace */ + if ([[chosenPreset objectForKey:@"PictureDeinterlace"] intValue] > 0) { + [fPictureFilterController setUseDecomb:0]; [fPictureFilterController setDeinterlace:[[chosenPreset objectForKey:@"PictureDeinterlace"] intValue]]; + /* if we are using "Custom" in the deinterlace setting, also set the custom string*/ + if ([[chosenPreset objectForKey:@"PictureDeinterlace"] intValue] == 4) + { + [fPictureFilterController setDeinterlaceCustomString:[chosenPreset objectForKey:@"PictureDeinterlaceCustom"]]; + } } } - else - { - [fPictureFilterController setDeinterlace:0]; - } + /* Detelecine */ - if ([[chosenPreset objectForKey:@"PictureDetelecine"] intValue] == 1) + if ([[chosenPreset objectForKey:@"PictureDetelecine"] intValue] > 0) { [fPictureFilterController setDetelecine:[[chosenPreset objectForKey:@"PictureDetelecine"] intValue]]; + /* if we are using "Custom" in the detelecine setting, also set the custom string*/ + if ([[chosenPreset objectForKey:@"PictureDetelecine"] intValue] == 2) + { + [fPictureFilterController setDetelecineCustomString:[chosenPreset objectForKey:@"PictureDetelecineCustom"]]; + } } else { [fPictureFilterController setDetelecine:0]; } + /* Denoise */ - if ([chosenPreset objectForKey:@"PictureDenoise"]) + if ([[chosenPreset objectForKey:@"PictureDenoise"] intValue] > 0) { [fPictureFilterController setDenoise:[[chosenPreset objectForKey:@"PictureDenoise"] intValue]]; + /* if we are using "Custom" in the denoise setting, also set the custom string*/ + if ([[chosenPreset objectForKey:@"PictureDenoise"] intValue] == 4) + { + [fPictureFilterController setDenoiseCustomString:[chosenPreset objectForKey:@"PictureDenoiseCustom"]]; + } } else { [fPictureFilterController setDenoise:0]; } + /* Deblock */ if ([[chosenPreset objectForKey:@"PictureDeblock"] intValue] == 1) { @@ -5991,15 +6014,6 @@ return YES; /* use the settings intValue */ [fPictureFilterController setDeblock:[[chosenPreset objectForKey:@"PictureDeblock"] intValue]]; } - /* Decomb */ - if ([[chosenPreset objectForKey:@"PictureDecomb"] intValue] == 1) - { - [fPictureFilterController setDecomb:1]; - } - else - { - [fPictureFilterController setDecomb:0]; - } if ([[chosenPreset objectForKey:@"VideoGrayScale"] intValue] == 1) { @@ -6207,10 +6221,14 @@ return YES; /* Picture Filters */ [preset setObject:[NSNumber numberWithInt:[fPictureFilterController useDecomb]] forKey:@"PictureDecombDeinterlace"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController deinterlace]] forKey:@"PictureDeinterlace"]; + [preset setObject:[fPictureFilterController deinterlaceCustomString] forKey:@"PictureDeinterlaceCustom"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController detelecine]] forKey:@"PictureDetelecine"]; + [preset setObject:[fPictureFilterController detelecineCustomString] forKey:@"PictureDetelecineCustom"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController denoise]] forKey:@"PictureDenoise"]; + [preset setObject:[fPictureFilterController denoiseCustomString] forKey:@"PictureDenoiseCustom"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController deblock]] forKey:@"PictureDeblock"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController decomb]] forKey:@"PictureDecomb"]; + [preset setObject:[fPictureFilterController decombCustomString] forKey:@"PictureDecombCustom"]; [preset setObject:[NSNumber numberWithInt:[fPictureFilterController grayscale]] forKey:@"VideoGrayScale"]; diff --git a/macosx/HBFilterController.h b/macosx/HBFilterController.h index d2b224c76..dc3cc47c2 100644 --- a/macosx/HBFilterController.h +++ b/macosx/HBFilterController.h @@ -91,20 +91,30 @@ - (IBAction) deblockSliderChanged: (id) sender; + - (int) detelecine; - (NSString*) detelecineCustomString; - (void) setDetelecine: (int) setting; +- (void) setDetelecineCustomString: (NSString*) string; + - (int) useDecomb; - (void) setUseDecomb: (int) setting; -- (int) deinterlace; -- (NSString*) deinterlaceCustomString; -- (void) setDeinterlace: (int) setting; + - (int) decomb; - (NSString*) decombCustomString; - (void) setDecomb: (int) setting; +- (void) setDecombCustomString: (NSString*) string; + +- (int) deinterlace; +- (NSString*) deinterlaceCustomString; +- (void) setDeinterlace: (int) setting; +- (void) setDeinterlaceCustomString: (NSString*) string; + - (int) denoise; - (NSString*) denoiseCustomString; - (void) setDenoise: (int) setting; +- (void) setDenoiseCustomString: (NSString*) string; + - (int) deblock; - (void) setDeblock: (int) setting; diff --git a/macosx/HBFilterController.mm b/macosx/HBFilterController.mm index 83f735823..2e71c9799 100644 --- a/macosx/HBFilterController.mm +++ b/macosx/HBFilterController.mm @@ -227,6 +227,7 @@ are maintained across different sources */ - (IBAction) FilterSettingsChanged: (id) sender { + fPictureFilterSettings.detelecine = [fDetelecinePopUp indexOfSelectedItem]; [self adjustFilterDisplay:fDetelecinePopUp]; @@ -334,6 +335,11 @@ are maintained across different sources */ fPictureFilterSettings.detelecine = setting; } +- (void) setDetelecineCustomString: (NSString*) string +{ + [fDetelecineField setStringValue:string]; +} + - (int) deinterlace { return fPictureFilterSettings.deinterlace; @@ -342,6 +348,12 @@ are maintained across different sources */ { return [fDeinterlaceField stringValue]; } + +- (void) setDeinterlaceCustomString: (NSString*) string +{ + [fDeinterlaceField setStringValue:string]; +} + - (void) setDeinterlace: (int) setting { fPictureFilterSettings.deinterlace = setting; @@ -364,11 +376,26 @@ are maintained across different sources */ - (void) setUseDecomb: (int) setting { fPictureFilterSettings.usedecomb = setting; + if (fPictureFilterSettings.usedecomb == 1) + { + [fDecombDeinterlaceSlider setFloatValue:0.0]; + } + else + { + [fDecombDeinterlaceSlider setFloatValue:1.0]; + } + [self modeDecombDeinterlaceSliderChanged:nil]; } - (void) setDecomb: (int) setting { fPictureFilterSettings.decomb = setting; } + +- (void) setDecombCustomString: (NSString*) string +{ + [fDecombField setStringValue:string]; +} + - (int) denoise { return fPictureFilterSettings.denoise; @@ -379,6 +406,11 @@ are maintained across different sources */ return [fDenoiseField stringValue]; } +- (void) setDenoiseCustomString: (NSString*) string +{ + [fDenoiseField setStringValue:string]; +} + - (void) setDenoise: (int) setting { fPictureFilterSettings.denoise = setting; |