]> granicus.if.org Git - handbrake/commitdiff
MacGui: Clean up a few things w/x264optstring prefs and presets
authordynaflash <dynaflashtech@gmail.com>
Wed, 18 Apr 2007 14:51:38 +0000 (14:51 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Wed, 18 Apr 2007 14:51:38 +0000 (14:51 +0000)
- Change abr of AppleTV built in preset to 2500 kbps
- Note: as usual, after updating your copy, use "Update Built-In Presets" in the presets menu for changes to take effect.
- Fix so that closing picture window does not reset the preset chosen display to "Custom"
- Add a user preference to show or hide the chosen x264 option strings in the main gui window. Defaults to off.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@525 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/English.lproj/MainMenu.nib/classes.nib
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
macosx/PrefsController.h
macosx/PrefsController.m

index 95f43b548c3956d79c4eca1a12403601405c8e2d..6a8bd095e25e84c92583d01e48b0e8562df948a6 100644 (file)
@@ -1700,8 +1700,11 @@ static int FormatSettings[3][4] =
                {
                [fPicSettingPARDsply setStringValue: @"Off"];
                }       
-               
-       [self CustomSettingUsed: sender];
+       /* below will trigger the preset, if selected, to be
+       changed to "Custom". Lets comment out for now until
+       we figure out a way to determine if the picture values
+       changed modify the preset values */     
+       //[self CustomSettingUsed: sender];
 }
 
 - (IBAction) CalculateBitrate: (id) sender
@@ -1739,11 +1742,14 @@ the user is using "Custom" settings by determining the sender*/
                [fDisplayX264Options setStringValue: @""];
                curUserPresetChosenNum = nil;
                /* If we have MP4, AVC H.264 and x264 Main then we look to see
-               if there are any x264 options from the preferences to use */
+                       if there are any x264 options from the preferences to use */
                if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fDstCodecsPopUp indexOfSelectedItem] == 1)
                {
-               //[fDisplayX264Options setStringValue: [NSString stringWithFormat:[chosenPreset valueForKey:@"x264Option"]]];
-                       [fDisplayX264Options setStringValue: [NSString stringWithFormat:[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"]]];
+                   /* Lets check to see if the user wants them displayed from the preferences */
+                       if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefAdvancedx264FlagsShow"] > 0)
+                       {
+                               [fDisplayX264Options setStringValue: [NSString stringWithFormat:[[NSUserDefaults standardUserDefaults] stringForKey:@"DefAdvancedx264Flags"]]];
+                       }
                }
                
        }
@@ -1889,8 +1895,7 @@ the user is using "Custom" settings by determining the sender*/
        [preset setObject:[fVidEncoderPopUp titleOfSelectedItem] forKey:@"VideoEncoder"];
        /* x264 Option String */
        [preset setObject:[fPresetNewX264Opt stringValue] forKey:@"x264Option"];
-       //[fDisplayX264Options setStringValue: [NSString stringWithFormat: @"Using Option: %@",CurUserPresetx264Opt]];
-       /* Video quality */
+       
        [preset setObject:[NSNumber numberWithInt:[fVidQualityMatrix selectedRow]] forKey:@"VideoQualityType"];
        [preset setObject:[fVidTargetSizeField stringValue] forKey:@"VideoTargetSize"];
        [preset setObject:[fVidBitrateField stringValue] forKey:@"VideoAvgBitrate"];
@@ -2051,7 +2056,7 @@ the user is using "Custom" settings by determining the sender*/
        /* Video quality */
        [preset setObject:[NSNumber numberWithInt:1] forKey:@"VideoQualityType"];
        [preset setObject:[fVidTargetSizeField stringValue] forKey:@"VideoTargetSize"];
-       [preset setObject:@"3000" forKey:@"VideoAvgBitrate"];
+       [preset setObject:@"2500" forKey:@"VideoAvgBitrate"];
        [preset setObject:[NSNumber numberWithFloat:[fVidQualitySlider floatValue]] forKey:@"VideoQualitySlider"];
        
        /* Video framerate */
@@ -2235,8 +2240,12 @@ the user is using "Custom" settings by determining the sender*/
                [fVidEncoderPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]]];
                
                /* We can show the preset options here in the gui if we want to
-               Field is currently hidden from user, unhide it if we need to test */
-               [fDisplayX264Options setStringValue: [NSString stringWithFormat:[chosenPreset valueForKey:@"x264Option"]]];
+                       so we check to see it the user has specified it in the prefs */
+               if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefAdvancedx264FlagsShow"] > 0)
+               {
+                       [fDisplayX264Options setStringValue: [NSString stringWithFormat:[chosenPreset valueForKey:@"x264Option"]]];
+               }
+               
                /* Lets run through the following functions to get variables set there */
                [self EncoderPopUpChanged: NULL];
                [self CalculateBitrate: NULL];
index 6205a2dcc59c173311b317022dc538a12bdf602b..f10ce5e60c299003dafa4c252294c43bafeead8b 100644 (file)
             CLASS = PrefsController; 
             LANGUAGE = ObjC; 
             OUTLETS = {
-                fDefAdvancedx264FlagsView = NSButton; 
+                fDefAdvancedx264FlagsShow = NSButton; 
+                fDefAdvancedx264FlagsView = NSTextField; 
                 fDefAutoNaming = NSButton; 
                 fDefChapterMarkers = NSButton; 
                 fDefCrf = NSButton; 
index 5ec8a74dfc51a22d5ba44255edc4972014b039e6..6c0f51e56ff4561575d22ef70a7e52584803205b 100644 (file)
@@ -9,7 +9,7 @@
                <key>1843</key>
                <string>610 276 220 592 0 0 1440 878 </string>
                <key>29</key>
-               <string>16 1134 365 44 0 0 1920 1178 </string>
+               <string>11 834 365 44 0 0 1440 878 </string>
        </dict>
        <key>IBFramework Version</key>
        <string>446.1</string>
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>1438</integer>
-               <integer>1867</integer>
                <integer>29</integer>
+               <integer>1867</integer>
+               <integer>1438</integer>
+               <integer>365</integer>
+               <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8P2137</string>
index be60a38390188150fe0fdb7a71b90ada4e816f95..3a3dd72ce1c7f8f41192e7154f404ca033a08c11 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index 2d298a5156c9c177f29f8204393a1966fecd5613..c6a66be62f660156993bb792f783127856ee1829 100644 (file)
@@ -16,7 +16,9 @@
        IBOutlet NSButton * fDefAutoNaming;
        IBOutlet NSButton * fDefChapterMarkers;
 
-       IBOutlet NSTextView * fDefAdvancedx264FlagsView;
+       IBOutlet NSTextField * fDefAdvancedx264FlagsView;
+       IBOutlet NSButton * fDefAdvancedx264FlagsShow;
+
 }
 
 - (IBAction) OpenPanel:    (id) sender;
index 4c9121e57e26c3e7f4c9ad075ae454fe53e556fb..6f98fa2144fb23ec429f6068d7868c1af346a043 100644 (file)
@@ -24,6 +24,8 @@
                    forKey:@"DefaultPicSizeAutoiPod"];
        appDefaults = [NSDictionary dictionaryWithObject:@"NO"
                    forKey:@"PixelRatio"];
+       appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+                   forKey:@"DefAdvancedx264FlagsShow"];
        appDefaults = [NSDictionary dictionaryWithObject:@""
                    forKey:@"DefAdvancedx264Flags"];
        appDefaults = [NSDictionary dictionaryWithObject:@"YES"
@@ -40,7 +42,8 @@
                    forKey:@"DefaultAutoNaming"];
        appDefaults = [NSDictionary dictionaryWithObject:@"NO"
                    forKey:@"DefaultChapterMarkers"];
-    [defaults registerDefaults: appDefaults];
+    
+       [defaults registerDefaults: appDefaults];
 
        /* fUpdateCheck Check or uncheck according to the preferences */
     [fUpdateCheck setState: [defaults boolForKey:@"CheckForUpdates"] ?
     [fDefPixelRatio setState: [defaults boolForKey:@"PixelRatio"] ?
                                  NSOnState : NSOffState];
        
+       /* fDefAdvancedx264FlagsShow */
+    [fDefAdvancedx264FlagsShow setState: [defaults boolForKey:@"DefAdvancedx264FlagsShow"] ?
+                                 NSOnState : NSOffState];
        /* Insert default DefAdvanced x264 Flag here */
        if ([defaults stringForKey:@"DefAdvancedx264Flags"]!=NULL)
        {
-       [fDefAdvancedx264FlagsView setString:[defaults stringForKey:@"DefAdvancedx264Flags"]];
+       [fDefAdvancedx264FlagsView setStringValue:[defaults stringForKey:@"DefAdvancedx264Flags"]];
        }
        
        /* fDefPresetDrawerShow Check or uncheck according to the preferences*/
     {
         [defaults setObject:@"NO" forKey:@"PixelRatio"];
     }
+ /* Show Chosen Advanced Flags to be used in main window*/
+ if( [fDefAdvancedx264FlagsShow state] == NSOnState )
+    {
+        [defaults setObject:@"YES" forKey:@"DefAdvancedx264FlagsShow"];
+    }
+    else
+    {
+        [defaults setObject:@"NO" forKey:@"DefAdvancedx264FlagsShow"];
+    }
                
        /*Advanced x264 Flag string into */
-      [defaults setObject:[fDefAdvancedx264FlagsView string]  forKey:@"DefAdvancedx264Flags"]; 
+      [defaults setObject:[fDefAdvancedx264FlagsView stringValue]  forKey:@"DefAdvancedx264Flags"];    
          
            /* Show Presets Drawer upon launch*/