]> granicus.if.org Git - handbrake/commitdiff
Mac Gui - Changes
authordynaflash <dynaflashtech@gmail.com>
Thu, 1 Feb 2007 18:37:58 +0000 (18:37 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Thu, 1 Feb 2007 18:37:58 +0000 (18:37 +0000)
-  Moved initial setting of Picture values to controller.mm under -UpdateUI  HB_STATE_SCANDONE
- Added Picture Settings Display to Video Tab in main window
- Added Pref to auto size picture settings to 640 x when choosing x264 (iPod) encoder
- Added Pref to default Deinterlace to On upon launch
- Added EncoderPopUpChanged to controller.mm to facilitate pic/iPod auto resize (could also be used for future encoder settings related events)

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/MediaFork_0.8.0@258 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
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/PictureController.mm
macosx/PrefsController.h
macosx/PrefsController.m

index 2db61783bccf3ec00eff212c06d393b01a872943..157e033f3f65434e559ccf498d8bfa0eeb589a2a 100644 (file)
     IBOutlet NSButton            * fVidGrayscaleCheck;
     IBOutlet NSButton            * fVidTwoPassCheck;
 
+       
+       /* Picture Settings box */
+       IBOutlet NSTextField         * fPicLabelSettings;
+       IBOutlet NSTextField         * fPicLabelSrc;
+       IBOutlet NSTextField         * fPicLabelOutp;
+       IBOutlet NSTextField         * fPicLabelAr;
+       IBOutlet NSTextField         * fPicLabelDeinter;
+       IBOutlet NSTextField         * fPicLabelSrcX;
+       IBOutlet NSTextField         * fPicLabelOutputX;
+       
+       IBOutlet NSTextField         * fPicSrcWidth;
+       IBOutlet NSTextField         * fPicSrcHeight;
+       IBOutlet NSTextField         * fPicSettingWidth;
+       IBOutlet NSTextField         * fPicSettingHeight;
+       IBOutlet NSTextField         * fPicSettingARkeep;
+       IBOutlet NSTextField         * fPicSettingDeinterlace;
+       IBOutlet NSTextField         * fPicSettingARkeepDsply;
+       IBOutlet NSTextField         * fPicSettingDeinterlaceDsply;
+       
     /* Subtitles box */
     IBOutlet NSTextField         * fSubField;
     IBOutlet NSPopUpButton       * fSubPopUp;
     IBOutlet NSButton            * fRipButton;
 
     hb_handle_t                  * fHandle;
+       hb_title_t               * fTitle;
 }
 
 - (void)     TranslateStrings;
 
 - (IBAction) FormatPopUpChanged: (id) sender;
 - (IBAction) CodecsPopUpChanged: (id) sender;
+- (IBAction) EncoderPopUpChanged: (id) sender;
 - (IBAction) BrowseFile: (id) sender;
 - (void)     BrowseFileDone: (NSSavePanel *) sheet
     returnCode: (int) returnCode contextInfo: (void *) contextInfo;
 - (IBAction) QualitySliderChanged: (id) sender;
 
 - (IBAction) ShowPicturePanel: (id) sender;
+- (IBAction) CalculatePictureSizing: (id) sender;
 
 - (IBAction) EnableQueue: (id) sender;
 - (IBAction) AddToQueue: (id) sender;
index d02f6df67933317fb75a19dd73d93bff1de069cc..7f24e3e646cb6b996282a14ee4c958b4762c83dc 100644 (file)
@@ -304,6 +304,7 @@ static int FormatSettings[3][4] =
                 break;
             }
 
+
             [fSrcTitlePopUp removeAllItems];
             for( int i = 0; i < hb_list_count( list ); i++ )
             {
@@ -317,13 +318,47 @@ static int FormatSettings[3][4] =
                                [fDstFile2Field setStringValue: [NSString stringWithFormat:
                 @"%@/Desktop/%@.mp4", NSHomeDirectory(),[NSString
                   stringWithUTF8String: title->name]]];
+                               
+                               /* Start Get and set the initial pic size for display */
+                           hb_job_t * job = title->job;
+                           fTitle = title; 
+                //hb_job_t * job = fTitle->job;
+                                                               /* New Split Picture Panel */
+                               [fPicSrcWidth setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->width]];
+                               [fPicSrcHeight setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->height]];
+                               [fPicSettingWidth setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->width]];
+                               [fPicSettingHeight setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->height]];
+                               [fPicSettingARkeep setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->keep_ratio]];               
+                               [fPicSettingDeinterlace setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->deinterlace]];
+                               
+                               
+                 /* Set initial job pic values in case PictureController is never called */
+                                job->width = [fPicSettingWidth  intValue];
+                 job->height = [fPicSettingHeight intValue];
+                 job->keep_ratio = [fPicSettingARkeep intValue];
+                                /* Turn Deinterlace on/off depending on the preference */
+                            if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultDeinterlaceOn"] > 0)
+                    {
+                     job->deinterlace = 1;
+                    }
+                            else
+                            {
+                            job->deinterlace = 0;
+                            }
+                 /* END Get and set the initial pic size for display */  
+
 
                 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)
@@ -342,6 +377,8 @@ static int FormatSettings[3][4] =
                      ext = "ogm";
                               break;
                                   }
+                               
+                               
                                NSString * string = [fDstFile2Field stringValue];
                                /* Add/replace File Output name to the correct extension*/
                                if( [string characterAtIndex: [string length] - 4] == '.' )
@@ -361,6 +398,13 @@ static int FormatSettings[3][4] =
                     stringWithFormat: @"%d - %02dh%02dm%02ds",
                     title->index, title->hours, title->minutes,
                     title->seconds]];
+                                       
+                                       
+                                       
+                                       
+                       /* Run Through EncoderPopUpChanged to see if there
+                       needs to be any pic value modifications based on encoder settings */
+                       [self EncoderPopUpChanged: NULL];
                        
             }
 
@@ -500,7 +544,11 @@ static int FormatSettings[3][4] =
         fVidQualityMatrix, fVidGrayscaleCheck, fSubField, fSubPopUp,
         fAudLang1Field, fAudLang1PopUp, fAudLang2Field, fAudLang2PopUp,
         fAudRateField, fAudRatePopUp, fAudBitrateField,
-        fAudBitratePopUp, fPictureButton, fQueueCheck };
+        fAudBitratePopUp, fPictureButton, fQueueCheck, 
+               fPicSrcWidth,fPicSrcHeight,fPicSettingWidth,fPicSettingHeight,
+               fPicSettingARkeep,fPicSettingDeinterlace,fPicSettingARkeepDsply,
+               fPicSettingDeinterlaceDsply,fPicLabelSettings,fPicLabelSrc,fPicLabelOutp,
+               fPicLabelAr,fPicLabelDeinter,fPicLabelSrcX,fPicLabelOutputX};
 
     for( unsigned i = 0;
          i < sizeof( controls ) / sizeof( NSControl * ); i++ )
@@ -614,6 +662,7 @@ static int FormatSettings[3][4] =
     [NSApp runModalForWindow: fPicturePanel];
     [NSApp endSheet: fPicturePanel];
     [fPicturePanel orderOut: self];
+       [self CalculatePictureSizing: sender];
 }
 
 - (IBAction) ShowQueuePanel: (id) sender
@@ -639,6 +688,8 @@ static int FormatSettings[3][4] =
     /* Chapter selection */
     job->chapter_start = [fSrcChapterStartPopUp indexOfSelectedItem] + 1;
     job->chapter_end   = [fSrcChapterEndPopUp   indexOfSelectedItem] + 1;
+       
+
 
     /* Format and codecs */
     int format = [fDstFormatPopUp indexOfSelectedItem];
@@ -660,6 +711,8 @@ static int FormatSettings[3][4] =
                Lets Deprecate Baseline Level 1.3*/
                job->h264_level = 30;
                job->mux = HB_MUX_IPOD;
+
+
                }
                
                /* Set this flag to switch from Constant Quantizer(default) to Constant Rate Factor Thanks jbrjake
@@ -703,8 +756,11 @@ static int FormatSettings[3][4] =
     }
 
     job->grayscale = ( [fVidGrayscaleCheck state] == NSOnState );
+    
 
-    /* Subtitle settings */
+       
+       
+       /* Subtitle settings */
     job->subtitle = [fSubPopUp indexOfSelectedItem] - 1;
 
     /* Audio tracks */
@@ -888,30 +944,7 @@ static int FormatSettings[3][4] =
     }
     [fSubPopUp selectItemAtIndex: 0];
 
-    /* Update lang popups */
-       /* START Legacy */
-       /*
-        hb_audio_t * audio;
-    [fAudLang1PopUp removeAllItems];
-    [fAudLang2PopUp removeAllItems];
-    [fAudLang1PopUp addItemWithTitle: _( @"None" )];
-    [fAudLang2PopUp addItemWithTitle: _( @"None" )];
-    for( int i = 0; i < hb_list_count( title->list_audio ); i++ )
-    {
-        audio = (hb_audio_t *) hb_list_item( title->list_audio, i );
-
-        [[fAudLang1PopUp menu] addItemWithTitle:
-            [NSString stringWithCString: audio->lang]
-            action: NULL keyEquivalent: @""];
-        [[fAudLang2PopUp menu] addItemWithTitle:
-            [NSString stringWithCString: audio->lang]
-            action: NULL keyEquivalent: @""];
-    }
-    [fAudLang1PopUp selectItemAtIndex: 1];
-    [fAudLang2PopUp selectItemAtIndex: 0];
-       */
-       /* END Legacy */
-       /* START pri */
+    /* START pri */
        hb_audio_t * audio;
 
        // PRI CHANGES 02/12/06
@@ -1076,6 +1109,64 @@ static int FormatSettings[3][4] =
     [self CalculateBitrate: sender];
 }
 
+- (IBAction) EncoderPopUpChanged: (id) sender
+{
+    
+       // Check to see if we need to modify the job pic values based on ipod //
+    if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fVidEncoderPopUp indexOfSelectedItem] == 1)
+    {
+                if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPicSizeAutoiPod"] > 0)
+                {
+                hb_job_t * job = fTitle->job;
+                if (fTitle->job->width > 640)
+                               {
+                               fTitle->job->width = 640;
+                               }
+                fTitle->job->keep_ratio = 1;
+                hb_fix_aspect( job, HB_KEEP_WIDTH );
+                
+                }
+       }
+    
+[self CalculatePictureSizing: sender];    
+  
+}
+
+/* Get and Display Current Pic Settings in main window */
+- (IBAction) CalculatePictureSizing: (id) sender
+{
+
+       hb_job_t * job = fTitle->job;           
+
+       [fPicSettingWidth setStringValue: [NSString stringWithFormat:
+               @"%d", fTitle->job->width]];
+       [fPicSettingHeight setStringValue: [NSString stringWithFormat:
+               @"%d", fTitle->job->height]];
+       [fPicSettingARkeep setStringValue: [NSString stringWithFormat:
+               @"%d", fTitle->job->keep_ratio]];                
+       [fPicSettingDeinterlace setStringValue: [NSString stringWithFormat:
+               @"%d", fTitle->job->deinterlace]];
+       /* Set ON/Off values for the deinterlace/keep aspect ratio according to boolean */      
+       if (fTitle->job->keep_ratio > 0)
+               {
+               [fPicSettingARkeepDsply setStringValue: @"On"];
+        }
+               else
+               {
+               [fPicSettingARkeepDsply setStringValue: @"Off"];
+               }       
+       if (fTitle->job->deinterlace > 0)
+               {
+               [fPicSettingDeinterlaceDsply setStringValue: @"On"];
+        }
+               else
+               {
+               [fPicSettingDeinterlaceDsply setStringValue: @"Off"];
+               }       
+               
+       
+}
+
 - (IBAction) CalculateBitrate: (id) sender
 {
     if( !fHandle || [fVidQualityMatrix selectedRow] != 0 )
index 8605729958f163a9134a8de2165984ca9e0cdf17..1928593478e027400b7cfe98a3eed4c8d1fb1a52 100644 (file)
@@ -9,6 +9,7 @@
                 ChapterPopUpChanged = id; 
                 CodecsPopUpChanged = id; 
                 EnableQueue = id; 
+                EncoderPopUpChanged = id; 
                 FormatPopUpChanged = id; 
                 OpenForums = id; 
                 OpenHomepage = id; 
                 fDstFormatField = NSTextField; 
                 fDstFormatPopUp = NSPopUpButton; 
                 fPauseButton = NSButton; 
+                fPicLabelAr = NSTextField; 
+                fPicLabelDeinter = NSTextField; 
+                fPicLabelOutp = NSTextField; 
+                fPicLabelOutputX = NSTextField; 
+                fPicLabelSettings = NSTextField; 
+                fPicLabelSrc = NSTextField; 
+                fPicLabelSrcX = NSTextField; 
+                fPicSettingARkeep = NSTextField; 
+                fPicSettingARkeepDsply = NSTextField; 
+                fPicSettingDeinterlace = NSTextField; 
+                fPicSettingDeinterlaceDsply = NSTextField; 
+                fPicSettingHeight = NSTextField; 
+                fPicSettingWidth = NSTextField; 
+                fPicSrcHeight = NSTextField; 
+                fPicSrcWidth = NSTextField; 
                 fPictureButton = NSButton; 
                 fPictureController = PictureController; 
                 fPicturePanel = NSPanel; 
                 fHeightStepper = NSStepper; 
                 fInfoField = NSTextField; 
                 fNextButton = NSButton; 
+                fPicSettingARkeep = NSTextField; 
+                fPicSettingDeinterlace = NSTextField; 
+                fPicSettingHeight = NSTextField; 
+                fPicSettingWidth = NSTextField; 
+                fPicSettingsDisplay = NSTextField; 
+                fPicSrcHeight = NSTextField; 
+                fPicSrcWidth = NSTextField; 
                 fPictureGLView = HBPictureGLView; 
                 fPrevButton = NSButton; 
                 fRatioCheck = NSButton; 
             LANGUAGE = ObjC; 
             OUTLETS = {
                 fDefCrf = NSButton; 
+                fDefDeinterlace = NSButton; 
+                fDefPicSizeAutoSetipod = NSButton; 
                 fFileExtItunes = NSButton; 
                 fPanel = NSPanel; 
                 fUpdateCheck = NSButton; 
index d83d41d2981781711f9c35639989c4d08e1d48b1..614a4f85b27a06eb282ef7c14ebe0c348e495cd6 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>34 83 442 531 0 0 1440 878 </string>
+       <string>22 -14 555 411 0 0 1440 878 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
        </array>
        <key>IBOpenObjects</key>
        <array>
+               <integer>21</integer>
                <integer>1438</integer>
                <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8L127</string>
+       <key>IBUserGuides</key>
+       <dict>
+               <key>21</key>
+               <dict>
+                       <key>guideLocations</key>
+                       <array>
+                               <string>Horizontal:560.000000</string>
+                       </array>
+                       <key>guidesLocked</key>
+                       <false/>
+               </dict>
+       </dict>
 </dict>
 </plist>
index 1511c0a73959750581398608d1ed0c10b71f6464..7a6c7d9e34a32251ca0b50bd2fa26640db35d3de 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index f4e9d51d9ca71a9a6dbdb271804a8fe1e506d5ca..6b75a24136b74849d8021de668aa154372d8f8b0 100644 (file)
@@ -145,6 +145,51 @@ static int GetAlignedSize( int size )
     job->keep_ratio  = ( [fRatioCheck state] == NSOnState );
     job->deinterlace = ( [fDeinterlaceCheck state] == NSOnState );
 
+       /*
+       [fPicSrcWidth setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->width]];
+                               [fPicSrcHeight setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->height]];
+                               [fPicSettingWidth setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->width]];
+                               [fPicSettingHeight setStringValue: [NSString stringWithFormat:
+                                                @"%d", fTitle->job->height]];
+                               [fPicSettingARkeep setStringValue: [NSString stringWithFormat:
+                                                @"%d", job->keep_ratio]];               
+                               [fPicSettingDeinterlace setStringValue: [NSString stringWithFormat:
+                                                @"%d", job->deinterlace]];
+       if (job->keep_ratio)
+       {
+               if (job->deinterlace)
+               {
+               [fPicSettingsDisplay setStringValue: [NSString stringWithFormat:
+                @"Source %dx%d, Output %dx%d, Aspect Ratio On, Deinterlace On", fTitle->width, fTitle->height,
+                fTitle->job->width, fTitle->job->height]];
+                }
+                else
+                {
+                       [fPicSettingsDisplay setStringValue: [NSString stringWithFormat:
+                @"Source %dx%d, Output %dx%d, Aspect Ratio On, Deinterlace Off", fTitle->width, fTitle->height,
+                fTitle->job->width, fTitle->job->height]];
+                }
+       }
+       else
+       {
+               if (job->deinterlace)
+               {
+               [fPicSettingsDisplay setStringValue: [NSString stringWithFormat:
+                @"Source %dx%d, Output %dx%d, Aspect Ratio Off, Deinterlace On", fTitle->width, fTitle->height,
+                fTitle->job->width, fTitle->job->height]];
+                }
+                else
+                {
+                       [fPicSettingsDisplay setStringValue: [NSString stringWithFormat:
+                @"Source %dx%d, Output %dx%d, Aspect Ratio Off, Deinterlace Off", fTitle->width, fTitle->height,
+                fTitle->job->width, fTitle->job->height]];
+                }
+       }
+
+    */
     bool autocrop = ( [fCropMatrix selectedRow] == 0 );
     [fCropTopStepper    setEnabled: !autocrop];
     [fCropBottomStepper setEnabled: !autocrop];
@@ -222,7 +267,8 @@ static int GetAlignedSize( int size )
 
 - (IBAction) ClosePanel: (id) sender
 {
-    [NSApp stopModal];
+
+       [NSApp stopModal];
 }
 
 @end
index 8d3b950655c10dec0601a73973bf830532e71ce4..3101c18d4b93d3c37df2850ddec3656b93feefcc 100644 (file)
@@ -9,6 +9,9 @@
        IBOutlet NSComboBox * fdefaultlanguage;
        IBOutlet NSButton * fFileExtItunes;
        IBOutlet NSButton * fDefCrf;
+       IBOutlet NSButton * fDefDeinterlace;
+       IBOutlet NSButton * fDefPicSizeAutoSetipod;
+       
 }
 
 - (IBAction) OpenPanel:    (id) sender;
index b2c72e242119faa5e92468d1a469678baeac88fc..9639385eab573d60cad4065a0b0b4b0210ea6da9 100644 (file)
@@ -8,7 +8,7 @@
     NSDictionary   * appDefaults;
     
     /* Unless the user specified otherwise, default is to check
-       for update  */
+       for update  fDefPicSizeAutoSetipod*/
     defaults    = [NSUserDefaults standardUserDefaults];
     appDefaults = [NSDictionary dictionaryWithObject:@"YES"
                    forKey:@"CheckForUpdates"];
                    forKey:@"DefaultMpegName"];
        appDefaults = [NSDictionary dictionaryWithObject:@"NO"
                    forKey:@"DefaultCrf"];
+       appDefaults = [NSDictionary dictionaryWithObject:@"NO"
+                   forKey:@"DefaultDeinterlaceOn"];
+       appDefaults = [NSDictionary dictionaryWithObject:@"YES"
+                   forKey:@"DefaultPicSizeAutoiPod"];
+       
     [defaults registerDefaults: appDefaults];
 
-    /* fUpdateCheck Check or uncheck according to the preferences */
+       /* fUpdateCheck Check or uncheck according to the preferences */
     [fUpdateCheck setState: [defaults boolForKey:@"CheckForUpdates"] ?
         NSOnState : NSOffState];
        
+       
 
        // Fill the languages combobox
     [fdefaultlanguage removeAllItems];
     }
        [fdefaultlanguage selectItemWithObjectValue:[defaults stringForKey:@"DefaultLanguage"]];
 
+    
 
 
        /* fFileExtItunes Check or uncheck according to the preferences */
     [fFileExtItunes setState: [defaults boolForKey:@"DefaultMpegName"] ?
         NSOnState : NSOffState];
                
-               /* fDefCrf Check or uncheck according to the preferences */
+               /* fDefCrf Check or uncheck according to the preferences*/
     [fDefCrf setState: [defaults boolForKey:@"DefaultCrf"] ?
         NSOnState : NSOffState];
 
+       /* fDefDeinterlace Check or uncheck according to the preferences*/
+    [fDefDeinterlace setState: [defaults boolForKey:@"DefaultDeinterlaceOn"] ?
+        NSOnState : NSOffState];
+
+/* fDefPicSizeAutoSetipod Check or uncheck according to the preferences*/
+    [fDefPicSizeAutoSetipod setState: [defaults boolForKey:@"DefaultPicSizeAutoiPod"] ?
+        NSOnState : NSOffState];
 
 }
 
 
        [defaults setObject:[fdefaultlanguage objectValueOfSelectedItem]  forKey:@"DefaultLanguage"];
 
+
        /* File Extension Itunes Set */
        
        if( [fFileExtItunes state] == NSOnState )
         [defaults setObject:@"NO" forKey:@"DefaultCrf"];
     }
 
-
+  /* Use Deinterlace on as a default*/
+       
+       if( [fDefDeinterlace state] == NSOnState )
+    {
+        [defaults setObject:@"YES" forKey:@"DefaultDeinterlaceOn"];
+    }
+    else
+    {
+        [defaults setObject:@"NO" forKey:@"DefaultDeinterlaceOn"];
+    }
+       
+         /* Use Picture size set to 640 upon x264 (iPod) Selection as a default*/
+       
+       if( [fDefPicSizeAutoSetipod state] == NSOnState )
+    {
+        [defaults setObject:@"YES" forKey:@"DefaultPicSizeAutoiPod"];
+    }
+    else
+    {
+        [defaults setObject:@"NO" forKey:@"DefaultPicSizeAutoiPod"];
+    }
 }
 
 @end