]> granicus.if.org Git - handbrake/commitdiff
MediaFork mac gui changes:
authordynaflash <dynaflashtech@gmail.com>
Fri, 26 Jan 2007 07:21:36 +0000 (07:21 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Fri, 26 Jan 2007 07:21:36 +0000 (07:21 +0000)
- Added pref for ipod/itunes friendly mp4 filename extension (.m4v) at launch.  Default is still .mp4

- Added Pref for using CRF method instead of the default CQP method for x264 Constant Quality encodes.

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/MediaFork_0.8.0@194 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 281c3372ba358aa7fc94947de36cd06da32ea826..370aa2219476e28cd9b0d2be7bc3cbc0a2d7d4ec 100644 (file)
@@ -298,6 +298,45 @@ static int FormatSettings[3][4] =
                                [fDstFile2Field setStringValue: [NSString stringWithFormat:
                 @"%@/Desktop/%@.mp4", NSHomeDirectory(),[NSString
                   stringWithUTF8String: title->name]]];
+
+                int format = [fDstFormatPopUp indexOfSelectedItem];
+                               char * ext = NULL;
+                               switch( format )
+                {
+                 case 0:
+                                        /* if Format is mpeg4 Change extension to proper for mpeg4 output */
+                                        
+                                        /*Get Default MP4 File Extension for mpeg4 (.mp4 or .m4v) from prefs*/
+                                        if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0)
+                                        {
+                                        ext = "m4v";
+                                        }
+                                    else
+                                    {
+                                        ext = "mp4";
+                                        }
+                                       break;
+                               case 1: 
+                     ext = "avi";
+                               case 2:
+                                  break;
+                     ext = "ogm";
+                              break;
+                                  }
+                               NSString * string = [fDstFile2Field stringValue];
+                               /* Add/replace File Output name to the correct extension*/
+                               if( [string characterAtIndex: [string length] - 4] == '.' )
+                               {
+                                       [fDstFile2Field setStringValue: [NSString stringWithFormat:
+                                               @"%@.%s", [string substringToIndex: [string length] - 4],
+                                               ext]];
+                               }
+                               else
+                               {
+                                       [fDstFile2Field setStringValue: [NSString stringWithFormat:
+                                               @"%@.%s", string, ext]];
+                               }
+
                                
                            [fSrcTitlePopUp addItemWithTitle: [NSString
                     stringWithFormat: @"%d - %02dh%02dm%02ds",
@@ -604,8 +643,13 @@ static int FormatSettings[3][4] =
                job->mux = HB_MUX_IPOD;
                }
                
-               /* Set this flag to switch from Constant Quantizer(default) to Constant Rate Factor */
-               // job->crf = 1;
+               /* Set this flag to switch from Constant Quantizer(default) to Constant Rate Factor Thanks jbrjake
+               Currently only used with Constant Quality setting*/
+                       if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultCrf"] > 0 && [fVidQualityMatrix selectedRow] == 2)
+               {
+               /* Can only be used with svn rev >= 89 */
+                       job->crf = 1;
+               }
                
         job->h264_13 = [fVidEncoderPopUp indexOfSelectedItem];
     }
@@ -896,7 +940,15 @@ static int FormatSettings[3][4] =
     switch( format )
     {
         case 0:
-            ext = "mp4";
+                               /*Get Default MP4 File Extension*/
+                               if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0)
+                               {
+                               ext = "m4v";
+                               }
+                               else
+                               {
+                               ext = "mp4";
+                               }
             [fDstCodecsPopUp addItemWithTitle:
                 _( @"MPEG-4 Video / AAC Audio" )];
             [fDstCodecsPopUp addItemWithTitle:
index 8c19d8c283a2808d18e0eea54e7c4be8d40125cd..8605729958f163a9134a8de2165984ca9e0cdf17 100644 (file)
             ACTIONS = {CheckChanged = id; ClosePanel = id; OpenPanel = id; }; 
             CLASS = PrefsController; 
             LANGUAGE = ObjC; 
-            OUTLETS = {fPanel = NSPanel; fUpdateCheck = NSButton; fdefaultlanguage = NSComboBox; }; 
+            OUTLETS = {
+                fDefCrf = NSButton; 
+                fFileExtItunes = NSButton; 
+                fPanel = NSPanel; 
+                fUpdateCheck = NSButton; 
+                fdefaultlanguage = NSComboBox; 
+            }; 
             SUPERCLASS = NSObject; 
         }, 
         {
index 4c967486e5c98b792638ca196a2b5a42cb30ea40..f8f5b983d6cd0a52d9c04407076b012b24d4e439 100644 (file)
@@ -17,8 +17,7 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>1162</integer>
-               <integer>21</integer>
+               <integer>1438</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8L127</string>
index 25b3abfd99db843139a8832da0919f659fe9f84c..07ea8fbb8a10f9ab3ab1674c3605a8ba95a62e56 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index 46ff48b3be1d35c1c76ef878b46d8847a25c79f0..8d3b950655c10dec0601a73973bf830532e71ce4 100644 (file)
@@ -7,6 +7,8 @@
     IBOutlet NSPanel  * fPanel;
     IBOutlet NSButton * fUpdateCheck;
        IBOutlet NSComboBox * fdefaultlanguage;
+       IBOutlet NSButton * fFileExtItunes;
+       IBOutlet NSButton * fDefCrf;
 }
 
 - (IBAction) OpenPanel:    (id) sender;
index a4622ae51c4a73849e9ac40e2af6922738591b9a..3f0472179898b7bb5d39421fb31407fc24ce1e3c 100644 (file)
@@ -8,17 +8,30 @@
     NSDictionary   * appDefaults;
     
     /* Unless the user specified otherwise, default is to check
-       for update */
+       for update  */
     defaults    = [NSUserDefaults standardUserDefaults];
     appDefaults = [NSDictionary dictionaryWithObject:@"YES"
                    forKey:@"CheckForUpdates"];
        appDefaults = [NSDictionary dictionaryWithObject:@"English"
                    forKey:@"DefaultLanguage"];
+    appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+                   forKey:@"DefaultMpegName"];
+       appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+                   forKey:@"DefaultCrf"];
     [defaults registerDefaults: appDefaults];
 
-    /* Check or uncheck according to the preferences */
+    /* fUpdateCheck Check or uncheck according to the preferences */
     [fUpdateCheck setState: [defaults boolForKey:@"CheckForUpdates"] ?
         NSOnState : NSOffState];
+       /* fFileExtItunes Check or uncheck according to the preferences */
+    [fFileExtItunes setState: [defaults boolForKey:@"DefaultMpegName"] ?
+        NSOnState : NSOffState];
+               
+               /* fDefCrf Check or uncheck according to the preferences */
+    [fDefCrf setState: [defaults boolForKey:@"DefaultCrf"] ?
+        NSOnState : NSOffState];
+       
+       
        // Fill the languages combobox
     [fdefaultlanguage removeAllItems];
        [fdefaultlanguage addItemWithObjectValue: @"Afar"];
 {
     NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
     
-    if( [fUpdateCheck state] == NSOnState )
+    /* Check Update Itunes Set */
+       if( [fUpdateCheck state] == NSOnState )
     {
         [defaults setObject:@"YES" forKey:@"CheckForUpdates"];
     }
     {
         [defaults setObject:@"NO" forKey:@"CheckForUpdates"];
     }
+       /* File Extension Itunes Set */
+       
+       if( [fFileExtItunes state] == NSOnState )
+    {
+        [defaults setObject:@"YES" forKey:@"DefaultMpegName"];
+    }
+    else
+    {
+        [defaults setObject:@"NO" forKey:@"DefaultMpegName"];
+    }
+       
+       /* Use CRF for constant mode */
+       
+       if( [fDefCrf state] == NSOnState )
+    {
+        [defaults setObject:@"YES" forKey:@"DefaultCrf"];
+    }
+    else
+    {
+        [defaults setObject:@"NO" forKey:@"DefaultCrf"];
+    }
        
+       /* Preferred Language Combobox Set */
        [defaults setObject:[fdefaultlanguage objectValueOfSelectedItem]  forKey:@"DefaultLanguage"];
 
 }