]> granicus.if.org Git - handbrake/commitdiff
MacGui: Detelecine initial implementation
authordynaflash <dynaflashtech@gmail.com>
Mon, 13 Aug 2007 17:02:37 +0000 (17:02 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Mon, 13 Aug 2007 17:02:37 +0000 (17:02 +0000)
- Added -VideoFramerateChanged method to controller.mm to detect NTSC Film content to error check detelecine.
- Auto detected or manually choosing  23.967 (NTSC Film) disables detelecine checkbox in the picture preview window.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@800 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.h
macosx/PictureController.mm

index c415f98b663356d8aab5f230ac982496b6792f92..68df8913b038bc430ade4c811d34fefa8ef45e8f 100644 (file)
@@ -99,6 +99,9 @@
        IBOutlet NSTextField         * fPicSettingAutoCrop;
        IBOutlet NSTextField         * fPicSettingAutoCropDsply;
        IBOutlet NSTextField         * fPicSettingDeinterlaceDsply;
+       IBOutlet NSTextField         * fPicSettingDetelecine;
+       IBOutlet NSTextField         * fPicSettingDetelecineLabel;
+
        IBOutlet NSTextField         * fPicLabelAnamorphic;
        IBOutlet NSTextField         * fPicLabelPAROutp;
        IBOutlet NSTextField         * fPicLabelPAROutputX;
 - (IBAction) CodecsPopUpChanged: (id) sender;
 - (IBAction) EncoderPopUpChanged: (id) sender;
 - (IBAction) TwoPassCheckboxChanged: (id) sender;
+- (IBAction ) VideoFrameRateChanged: (id) sender;
 - (IBAction) SetEnabledStateOfAudioMixdownControls: (id) sender;
 - (IBAction) AddAllAudioTracksToPopUp: (id) sender;
 - (IBAction) SelectAudioTrackInPopUp: (id) sender searchPrefixString: (NSString *) searchPrefixString selectIndexIfNotFound: (int) selectIndexIfNotFound;
index 964254c0cca1791c528761e2e6db89b34b31ffb7..2c59450b068c9fcb03c9357b1ba2095649dda9d6 100644 (file)
@@ -263,7 +263,10 @@ static NSString*       ChooseSourceIdentifier   = @"Choose Source Item Identifie
        [fPicSettingPARWidth setStringValue: @""];
        [fPicSettingPARHeight setStringValue:  @""];
        
-    /* Audio bitrate */
+       /*Set detelecine to Off upon launch */
+       [fPicSettingDetelecine setStringValue: @"No"];
+       
+       /* Audio bitrate */
     [fAudBitratePopUp removeAllItems];
     for( int i = 0; i < hb_audio_bitrates_count; i++ )
     {
@@ -1082,7 +1085,7 @@ list = hb_get_titles( fHandle );
                fX264optDirectPredLabel,fX264optDirectPredPopUp,fX264optDeblockLabel,fX264optAnalyseLabel,
                fX264optAnalysePopUp,fX264opt8x8dctLabel,fX264opt8x8dctSwitch,fX264optCabacLabel,fX264optCabacSwitch,
                fX264optAlphaDeblockPopUp,fX264optBetaDeblockPopUp,fVidTurboPassCheck,fDstMpgLargeFileCheck,fPicSettingAutoCropLabel,
-               fPicSettingAutoCropDsply};
+               fPicSettingAutoCropDsply,fPicSettingDetelecine,fPicSettingDetelecineLabel};
 
     for( unsigned i = 0;
          i < sizeof( controls ) / sizeof( NSControl * ); i++ )
@@ -1409,6 +1412,13 @@ list = hb_get_titles( fHandle );
     }
     job->filters = hb_list_init();
    
+   /* Detelecine */
+   if ([[fPicSettingDetelecine stringValue] isEqualToString: @"Yes"])
+   {
+   hb_list_add( job->filters, &hb_filter_detelecine );
+   }
+   
+   /* Deinterlace */
    if( job->deinterlace == 1)
     {        
         if ([fPicSettingDeinterlace intValue] == 1)
@@ -2000,6 +2010,15 @@ list = hb_get_titles( fHandle );
        [self CustomSettingUsed: sender];
 }
 
+- (IBAction ) VideoFrameRateChanged: (id) sender
+{
+/* We call method method to CalculatePictureSizing to error check detelecine*/
+[self CalculatePictureSizing: sender];
+
+/* We call method method to change UI to reflect whether a preset is used or not*/
+       [self CustomSettingUsed: sender];
+}
+
 - (IBAction) SetEnabledStateOfAudioMixdownControls: (id) sender
 {
 
@@ -2468,6 +2487,13 @@ list = hb_get_titles( fHandle );
        {
                [fPicSettingAutoCropDsply setStringValue: @"Auto"];
        }       
+       /* check video framerate and turn off detelecine if necessary */
+       if (fTitle->rate_base == 1126125 || [[fVidRatePopUp titleOfSelectedItem] isEqualToString: @"23.976 (NTSC Film)"])
+       {
+               [fPicSettingDetelecine setStringValue: @"No"];
+       }
+       
+       
        
        /* below will trigger the preset, if selected, to be
        changed to "Custom". Lets comment out for now until
index 56978b1c745cb852ac618124fb4133bd9e38447e..0fb334d9240fc443e2dec4e923a817a4224f718f 100644 (file)
@@ -39,6 +39,7 @@
                 ShowScanPanel = id; 
                 TitlePopUpChanged = id; 
                 TwoPassCheckboxChanged = id; 
+                VideoFrameRateChanged = id; 
                 VideoMatrixChanged = id; 
                 X264AdvancedOptionsChanged = id; 
                 X264AdvancedOptionsSet = id; 
@@ -94,6 +95,8 @@
                 fPicSettingAutoCropLabel = NSTextField; 
                 fPicSettingDeinterlace = NSTextField; 
                 fPicSettingDeinterlaceDsply = NSTextField; 
+                fPicSettingDetelecine = NSTextField; 
+                fPicSettingDetelecineLabel = NSTextField; 
                 fPicSettingHeight = NSTextField; 
                 fPicSettingPAR = NSTextField; 
                 fPicSettingPARDsply = NSTextField; 
                 fCropTopStepper = NSStepper; 
                 fDeinterlaceLevelMainWindow = NSTextField; 
                 fDeinterlacePopUp = NSPopUpButton; 
+                fDetelecineCheck = NSButton; 
+                fDetelecineMainWindow = NSTextField; 
                 fEffectsCheck = NSButton; 
                 fHeightField = NSTextField; 
                 fHeightStepper = NSStepper; 
                 fPictureGLView = HBPictureGLView; 
                 fPrevButton = NSButton; 
                 fRatioCheck = NSButton; 
+                fVidFrameRatePopUpMainWindow = NSPopUpButton; 
                 fWidthField = NSTextField; 
                 fWidthStepper = NSStepper; 
             }; 
index fb661e2d8c009b8238a962511a28e2efdb4b1ce5..9d18815dcb1ec266ccd6cdd12fcc860ac8a9bb1b 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>87 46 558 375 0 0 1440 878 </string>
+       <string>-2 463 763 415 0 0 1440 878 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1843</key>
@@ -28,9 +28,8 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>2436</integer>
+               <integer>365</integer>
                <integer>21</integer>
-               <integer>29</integer>
-               <integer>1843</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8R2218</string>
index e6539fd7b027507a3dffdacb12d76dda1d46f8c3..a4fcb87b55f8d16ede6705f99ebe032c2d564cf9 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index b7c93c79df6953104667b775a5984195bc4595d6..5e876b555076f8daa0504e6e1f45a1e3404c8cdd 100644 (file)
@@ -37,6 +37,7 @@
     IBOutlet NSTextField     * fCropRightField;
     IBOutlet NSStepper       * fCropRightStepper;
     IBOutlet NSPopUpButton   * fDeinterlacePopUp;
+       IBOutlet NSButton        * fDetelecineCheck;
        IBOutlet NSButton        * fPARCheck;
     IBOutlet NSButton        * fEffectsCheck;
     IBOutlet NSButton        * fPrevButton;
@@ -51,6 +52,9 @@
        /* widgets in main window */
        IBOutlet NSTextField     * fAutoCropMainWindow;
        IBOutlet NSTextField     * fDeinterlaceLevelMainWindow;
+       IBOutlet NSTextField     * fDetelecineMainWindow;
+       IBOutlet NSPopUpButton   * fVidFrameRatePopUpMainWindow;
+       
 
 }
 
index afdb6f6ccd9f02e0b924a43ea0f283be9ca90835..0cf80da05c6f9417c2c0f12b3eb4092e29d11f8e 100644 (file)
@@ -117,6 +117,31 @@ static int GetAlignedSize( int size )
        {
        [fCropMatrix  selectCellAtRow: 0 column:0];
        }
+       
+       /* set the detelecine state according to the state in main window */
+       /* if framerate is 23.976 we do not allow detelecine, otherwise, enable and set according to fDetelecineMainWindow outlet */ 
+       if (fTitle->rate_base == 1126125 || [[fVidFrameRatePopUpMainWindow titleOfSelectedItem] isEqualToString: @"23.976 (NTSC Film)"])
+       {
+               [fDetelecineMainWindow setStringValue: @"No"];
+               [fDetelecineCheck setEnabled: NO];
+               [fDetelecineCheck setState: NSOffState];
+               
+       }
+       else
+       {
+       [fDetelecineCheck setEnabled: YES];
+               if ([[fDetelecineMainWindow stringValue] isEqualToString: @"Yes"])
+               {
+                       [fDetelecineCheck setState: NSOnState];
+               }
+               else
+               {
+                       [fDetelecineCheck setState: NSOffState];
+               }
+               
+       }
+       
+       
     MaxOutputWidth = job->width;
        MaxOutputHeight = job->height;
     fPicture = 0;
@@ -245,6 +270,16 @@ static int GetAlignedSize( int size )
        job->deinterlace = 1;
        }
        
+       /* set the detelecine state according to the integer set in the main window field */
+       if ([fDetelecineCheck state] == 1)
+       {
+       [fDetelecineMainWindow setStringValue: @"Yes"];
+       }
+       else
+       {
+       [fDetelecineMainWindow setStringValue: @"No"];
+       }
+       
        
        job->pixel_ratio = ( [fPARCheck state] == NSOnState );