OSDN Git Service

MacGui: Maintain Picture Filters state across sources
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Dec 2007 16:26:57 +0000 (16:26 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Dec 2007 16:26:57 +0000 (16:26 +0000)
- 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://localhost/HandBrake/trunk@1148 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/PictureController.h
macosx/PictureController.mm

index 88d7006..5659871 100644 (file)
@@ -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"])
     {
index ff1267b..b15eedb 100644 (file)
@@ -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;
index 80952ed..4a27da9 100644 (file)
@@ -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 );