diff options
author | dynaflash <[email protected]> | 2007-12-26 16:26:57 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-12-26 16:26:57 +0000 |
commit | 966a6c6a61fc6e15e0ec71553b77d18cf04f9182 (patch) | |
tree | 15f01b3066a0e53c19caa2145d54f7513eefc517 | |
parent | 9de854ea647f370c31bf3919a6c7377b317ea19f (diff) |
MacGui: Maintain Picture Filters state across sources
- Picture filters no longer reset to their defaults when a new source is chosen (includes vfr as well setEnabled to the fps drop down in the main window).
- Added a new method -setInitialPictureFilters to PictureController.m to setup the filters upon first scan instead of in -SetTitle which reset them every time a new title was accessed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1148 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.mm | 15 | ||||
-rw-r--r-- | macosx/PictureController.h | 1 | ||||
-rw-r--r-- | macosx/PictureController.mm | 42 |
3 files changed, 36 insertions, 22 deletions
diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 88d700629..565987134 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -416,6 +416,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It /* if we're enabling the interface, check if the audio mixdown controls need to be enabled or not */ /* these will have been enabled by the mass control enablement above anyway, so we're sense-checking it here */ [self setEnabledStateOfAudioMixdownControls: NULL]; + /* we also call calculatePictureSizing here to sense check if we already have vfr selected */ + [self calculatePictureSizing: NULL]; } else { @@ -1297,11 +1299,19 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { [self selectDefaultPreset: NULL]; /* if Deinterlace upon launch is specified in the prefs, then set to 1 for "Fast", - if not, then set to 0 for none */ + if not, then set to 0 for none */ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultDeinterlaceOn"] > 0) + { [fPictureController setDeinterlace:1]; + } else + { [fPictureController setDeinterlace:0]; + } + /* lets set Denoise to index 0 or "None" since this is the first scan */ + [fPictureController setDenoise:0]; + + [fPictureController setInitialPictureFilters]; } } @@ -1988,6 +1998,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It hb_job_t * job = title->job; fTitle = title; /* Turn Deinterlace on/off depending on the preference */ + /* if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultDeinterlaceOn"] > 0) { [fPictureController setDeinterlace:1]; @@ -1996,7 +2007,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { [fPictureController setDeinterlace:0]; } - + */ /* Pixel Ratio Setting */ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"PixelRatio"]) { diff --git a/macosx/PictureController.h b/macosx/PictureController.h index ff1267b8e..b15eedb6d 100644 --- a/macosx/PictureController.h +++ b/macosx/PictureController.h @@ -74,6 +74,7 @@ - (void) SetHandle: (hb_handle_t *) handle; - (void) SetTitle: (hb_title_t *) title; +- (void) setInitialPictureFilters; - (void) Display: (int) anim; - (IBAction) SettingsChanged: (id) sender; diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index 80952edf6..4a27da9c5 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -104,18 +104,6 @@ static int GetAlignedSize( int size ) [fCropBottomStepper setMaxValue: title->height/2-2]; [fCropLeftStepper setMaxValue: title->width/2-2]; [fCropRightStepper setMaxValue: title->width/2-2]; - - - /* we use a popup to show the deinterlace settings */ - [fDeinterlacePopUp removeAllItems]; - [fDeinterlacePopUp addItemWithTitle: @"None"]; - [fDeinterlacePopUp addItemWithTitle: @"Fast"]; - [fDeinterlacePopUp addItemWithTitle: @"Slow"]; - [fDeinterlacePopUp addItemWithTitle: @"Slower"]; - [fDeinterlacePopUp addItemWithTitle: @"Slowest"]; - - /* Set deinterlaces level according to the integer in the main window */ - [fDeinterlacePopUp selectItemAtIndex: fPictureFilterSettings.deinterlace]; [fPARCheck setState:(job->pixel_ratio ? NSOnState : NSOffState)]; /* We initially set the previous state of keep ar to on */ @@ -138,8 +126,28 @@ static int GetAlignedSize( int size ) [fCropMatrix selectCellAtRow: 0 column:0]; } - - + MaxOutputWidth = job->width; + MaxOutputHeight = job->height; + fPicture = 0; + + [self SettingsChanged: nil]; +} + +/* we use this to setup the initial picture filters upon first launch, after that their states +are maintained across different sources */ +- (void) setInitialPictureFilters +{ + /* we use a popup to show the deinterlace settings */ + [fDeinterlacePopUp removeAllItems]; + [fDeinterlacePopUp addItemWithTitle: @"None"]; + [fDeinterlacePopUp addItemWithTitle: @"Fast"]; + [fDeinterlacePopUp addItemWithTitle: @"Slow"]; + [fDeinterlacePopUp addItemWithTitle: @"Slower"]; + [fDeinterlacePopUp addItemWithTitle: @"Slowest"]; + + /* Set deinterlaces level according to the integer in the main window */ + [fDeinterlacePopUp selectItemAtIndex: fPictureFilterSettings.deinterlace]; + /* we use a popup to show the denoise settings */ [fDenoisePopUp removeAllItems]; [fDenoisePopUp addItemWithTitle: @"None"]; @@ -148,14 +156,8 @@ static int GetAlignedSize( int size ) [fDenoisePopUp addItemWithTitle: @"Strong"]; /* Set denoises level according to the integer in the main window */ [fDenoisePopUp selectItemAtIndex: fPictureFilterSettings.denoise]; - - MaxOutputWidth = job->width; - MaxOutputHeight = job->height; - fPicture = 0; - [self SettingsChanged: nil]; } - - (void) Display: (int) anim { hb_get_preview( fHandle, fTitle, fPicture, fBuffer ); |