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;
break;
}
+
[fSrcTitlePopUp removeAllItems];
for( int i = 0; i < hb_list_count( list ); i++ )
{
[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)
ext = "ogm";
break;
}
+
+
NSString * string = [fDstFile2Field stringValue];
/* Add/replace File Output name to the correct extension*/
if( [string characterAtIndex: [string length] - 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];
}
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++ )
[NSApp runModalForWindow: fPicturePanel];
[NSApp endSheet: fPicturePanel];
[fPicturePanel orderOut: self];
+ [self CalculatePictureSizing: sender];
}
- (IBAction) ShowQueuePanel: (id) sender
/* Chapter selection */
job->chapter_start = [fSrcChapterStartPopUp indexOfSelectedItem] + 1;
job->chapter_end = [fSrcChapterEndPopUp indexOfSelectedItem] + 1;
+
+
/* Format and codecs */
int format = [fDstFormatPopUp indexOfSelectedItem];
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
}
job->grayscale = ( [fVidGrayscaleCheck state] == NSOnState );
+
- /* Subtitle settings */
+
+
+ /* Subtitle settings */
job->subtitle = [fSubPopUp indexOfSelectedItem] - 1;
/* Audio tracks */
}
[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
[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 )
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;
<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>
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];
- (IBAction) ClosePanel: (id) sender
{
- [NSApp stopModal];
+
+ [NSApp stopModal];
}
@end
IBOutlet NSComboBox * fdefaultlanguage;
IBOutlet NSButton * fFileExtItunes;
IBOutlet NSButton * fDefCrf;
+ IBOutlet NSButton * fDefDeinterlace;
+ IBOutlet NSButton * fDefPicSizeAutoSetipod;
+
}
- (IBAction) OpenPanel: (id) sender;
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