From 85df20369cf73f5115a1707a47a7ac52f2881efb Mon Sep 17 00:00:00 2001 From: ritsuka Date: Mon, 4 Nov 2013 07:09:50 +0000 Subject: MacGUI: Refactor HBPreviewController. Rename the actual class to HBPreviewController, and move the image and video creation code to a separate HBPreviewGenerator class. Update the preview duration list as Rodeo suggested. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5874 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/PictureController.m | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'macosx/PictureController.m') diff --git a/macosx/PictureController.m b/macosx/PictureController.m index e5b30844a..7bf9bf404 100644 --- a/macosx/PictureController.m +++ b/macosx/PictureController.m @@ -12,7 +12,7 @@ { hb_title_t * fTitle; - PreviewController * fPreviewController; + HBPreviewController * fPreviewController; /* Picture Sizing */ IBOutlet NSTabView * fSizeFilterView; @@ -126,7 +126,7 @@ _decombCustomString = @""; _denoiseCustomString = @""; - fPreviewController = [[PreviewController alloc] init]; + fPreviewController = [[HBPreviewController alloc] init]; } return self; @@ -191,12 +191,19 @@ - (void) setHandle: (hb_handle_t *) handle { - [fPreviewController SetHandle: handle]; - [fPreviewController setHBController:(HBController *)self.delegate]; + [fPreviewController setHandle: handle]; + [fPreviewController setDelegate:(HBController *)self.delegate]; } - (void) setTitle: (hb_title_t *) title { + fTitle = title; + + if (!title) { + [fPreviewController setTitle:NULL]; + return; + } + hb_job_t * job = title->job; fTitle = title; @@ -257,8 +264,9 @@ titleParWidth = job->anamorphic.par_width; titleParHeight = job->anamorphic.par_height; - [fPreviewController SetTitle:title]; + [fPreviewController setTitle:title]; + [self FilterSettingsChanged:nil]; [self settingsChanged:nil]; } @@ -504,7 +512,7 @@ - (void) reloadStillPreview { - [fPreviewController SetTitle:fTitle]; + [fPreviewController reload]; } #pragma mark - @@ -570,6 +578,9 @@ - (IBAction) settingsChanged: (id) sender { + if (!fTitle) + return; + hb_job_t * job = fTitle->job; /* if we are anything but strict anamorphic */ @@ -1038,6 +1049,9 @@ - (IBAction) FilterSettingsChanged: (id) sender { + if (!fTitle) + return; + self.detelecine = [fDetelecinePopUp indexOfSelectedItem]; [self adjustFilterDisplay:fDetelecinePopUp]; @@ -1070,10 +1084,9 @@ { fPreviewController.deinterlacePreview = NO; } - + self.grayscale = [fGrayscaleCheck state]; - - + if (sender != nil) { [self.delegate pictureSettingsDidChange]; -- cgit v1.2.3