if (nil == UserPresets)
{
UserPresets = [[NSMutableArray alloc] init];
+ [self AddFactoryPresets:NULL];
}
/* Show/Dont Show Presets drawer upon launch based
on user preference DefaultPresetsDrawerShow*/
}
// Select the longuest title
[fSrcTitlePopUp selectItemAtIndex: indxpri];
-
-
+ /* We set the Settings Display to "Default" here
+ until we get default presets implemented */
+ [fPresetSelectedDisplay setStringValue: @"Default"];
[self TitlePopUpChanged: NULL];
[self EnableUI: YES];
fPicSettingDeinterlaceDsply,fPicLabelSettings,fPicLabelSrc,fPicLabelOutp,
fPicLabelAr,fPicLabelDeinter,fPicLabelSrcX,fPicLabelOutputX,
fPicLabelPAROutp,fPicLabelPAROutputX,fPicSettingPARWidth,fPicSettingPARHeight,
- fPicSettingPARDsply,fPicLabelAnamorphic,tableView,fPresetsAdd,fPresetsDelete};
+ fPicSettingPARDsply,fPicLabelAnamorphic,tableView,fPresetsAdd,fPresetsDelete,
+ fCreateChapterMarkers};
for( unsigned i = 0;
i < sizeof( controls ) / sizeof( NSControl * ); i++ )
[self QualitySliderChanged: sender];
[self CalculateBitrate: sender];
+ [self CustomSettingUsed: sender];
}
- (IBAction) QualitySliderChanged: (id) sender
[fVidConstantCell setTitle: [NSString stringWithFormat:
_( @"Constant quality: %.0f %%" ), 100.0 *
[fVidQualitySlider floatValue]]];
+ [self CustomSettingUsed: sender];
}
- (IBAction) BrowseFile: (id) sender
if( returnCode == NSOKButton )
{
[fDstFile2Field setStringValue: [sheet filename]];
- [self FormatPopUpChanged: NULL];
+
}
}
job->mux = FormatSettings[format][codecs] & HB_MUX_MASK;
job->vcodec = FormatSettings[format][codecs] & HB_VCODEC_MASK;
job->acodec = FormatSettings[format][codecs] & HB_ACODEC_MASK;
-
+ /* We set the chapter marker extraction here based on the format being
+ mpeg4 and the checkbox being checked */
+ if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fCreateChapterMarkers state] == NSOnState)
+ {
+ job->chapter_markers = 1;
+ }
if( ( job->vcodec & HB_VCODEC_FFMPEG ) &&
[fVidEncoderPopUp indexOfSelectedItem] > 0 )
{
job->abitrate = hb_audio_bitrates[[fAudBitratePopUp
indexOfSelectedItem]].rate;
/* have we selected that 5.1 should be extracted as AAC? */
- if (job->acodec == HB_ACODEC_FAAC && [fAudLang1SurroundCheck isEnabled] && [fAudLang1SurroundCheck state] == NSOnState) {
+ if ((job->acodec == HB_ACODEC_FAAC || job->acodec == HB_ACODEC_VORBIS) && [fAudLang1SurroundCheck isEnabled] && [fAudLang1SurroundCheck state] == NSOnState) {
job->surround = 1;
} else {
job->surround = 0;
hb_list_t * list = hb_get_titles( fHandle );
hb_title_t * title = (hb_title_t*)
hb_list_item( list, [fSrcTitlePopUp indexOfSelectedItem] );
+
+
/* If Auto Naming is on. We create an output filename of dvd name - title number */
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"] > 0)
{
@"%d", fTitle->width]];
[fPicSrcHeight setStringValue: [NSString stringWithFormat:
@"%d", fTitle->height]];
+ /* We get the originial output picture width and height and put them
+ in variables for use with some presets later on */
+ PicOrigOutputWidth = job->width;
+ PicOrigOutputHeight = job->height;
+ /* we test getting the max output value for pic sizing here to be used later*/
+ [fPicSettingWidth setStringValue: [NSString stringWithFormat:
+ @"%d", PicOrigOutputWidth]];
+ [fPicSettingHeight setStringValue: [NSString stringWithFormat:
+ @"%d", PicOrigOutputHeight]];
/* Turn Deinterlace on/off depending on the preference */
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultDeinterlaceOn"] > 0)
{
}
/* Run Through EncoderPopUpChanged to see if there
needs to be any pic value modifications based on encoder settings */
- [self EncoderPopUpChanged: NULL];
+ //[self EncoderPopUpChanged: NULL];
/* END Get and set the initial pic size for display */
/* changing the title may have changed the audio channels on offer, so */
/* check if this change means we should / should't offer 6-channel AAC extraction */
[self Check6ChannelAACExtraction: sender];
+
+
}
_( @"MPEG-4 Video / AAC Audio" )];
[fDstCodecsPopUp addItemWithTitle:
_( @"AVC/H.264 Video / AAC Audio" )];
- break;
+ /* We enable the create chapters checkbox here since we are .mp4 */
+ [fCreateChapterMarkers setEnabled: YES];
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultChapterMarkers"] > 0)
+ {
+ [fCreateChapterMarkers setState: NSOnState];
+ }
+ break;
case 1:
ext = "avi";
[fDstCodecsPopUp addItemWithTitle:
_( @"AVC/H.264 Video / MP3 Audio" )];
[fDstCodecsPopUp addItemWithTitle:
_( @"AVC/H.264 Video / AC-3 Audio" )];
+ /* We disable the create chapters checkbox here since we are NOT .mp4
+ and make sure it is unchecked*/
+ [fCreateChapterMarkers setEnabled: NO];
+ [fCreateChapterMarkers setState: NSOffState];
break;
case 2:
ext = "ogm";
_( @"MPEG-4 Video / Vorbis Audio" )];
[fDstCodecsPopUp addItemWithTitle:
_( @"MPEG-4 Video / MP3 Audio" )];
- break;
+ /* We disable the create chapters checkbox here since we are NOT .mp4
+ and make sure it is unchecked*/
+ [fCreateChapterMarkers setEnabled: NO];
+ [fCreateChapterMarkers setState: NSOffState];
+ break;
}
[self CodecsPopUpChanged: NULL];
/* changing the codecs on offer may mean that we are/aren't now offering AAC, so */
/* check if this change means we should / should't offer 6-channel AAC extraction */
[self Check6ChannelAACExtraction: sender];
-
+ /* We call method method to change UI to reflect whether a preset is used or not*/
+ [self CustomSettingUsed: sender];
+
}
- (IBAction) CodecsPopUpChanged: (id) sender
[self Check6ChannelAACExtraction: sender];
[self CalculateBitrate: sender];
-
+ /* We call method method to change UI to reflect whether a preset is used or not*/
+ [self CustomSettingUsed: sender];
}
- (IBAction) EncoderPopUpChanged: (id) sender
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPicSizeAutoiPod"] > 0)
{
- if (fTitle->job->width > 640)
+ if (job->width > 640)
{
- fTitle->job->width = 640;
+ job->width = 640;
}
- fTitle->job->keep_ratio = 1;
+ job->keep_ratio = 1;
hb_fix_aspect( job, HB_KEEP_WIDTH );
}
}
- [self CalculatePictureSizing: sender];
-
+ [self CalculatePictureSizing: sender];
+ /* We call method method to change UI to reflect whether a preset is used or not*/
+ [self CustomSettingUsed: sender];
}
- (IBAction) Check6ChannelAACExtraction: (id) sender
int codecs = [fDstCodecsPopUp indexOfSelectedItem];
int acodec = FormatSettings[format][codecs] & HB_ACODEC_MASK;
- /* we only offer the option to extract 5.1 to 6-channel if the selected audio codec is AAC */
- if (acodec == HB_ACODEC_FAAC) {
+ /* we only offer the option to extract 5.1 to 6-channel if the selected audio codec is AAC or Vorbis*/
+ if (acodec == HB_ACODEC_FAAC || acodec == HB_ACODEC_VORBIS) {
bool doneaudios = false;
int thisaudio = 0;
}
}
- /* If we are extracting to AAC, and any of our soundtracks were 5.1, then enable the checkbox */
+ /* If we are extracting to AAC or Vorbis, and any of our soundtracks were 5.1, then enable the checkbox */
if (foundfiveoneaudio) {
[fAudLang1SurroundCheck setEnabled: YES];
/* Check default surround sound pref and if it is YES, lets also check the checkbox */
}
+/* lets set the picture size back to the max from right after title scan
+ Lets use an IBAction here as down the road we could always use a checkbox
+ in the gui to easily take the user back to max. Remember, the compiler
+ resolves IBActions down to -(void) during compile anyway */
+- (IBAction) RevertPictureSizeToMax: (id) sender
+{
+ hb_job_t * job = fTitle->job;
+ /* We use the output picture width and height
+ as calculated from libhb right after title is set
+ in TitlePopUpChanged */
+ job->width = PicOrigOutputWidth;
+ job->height = PicOrigOutputHeight;
+
+
+
+ [self CalculatePictureSizing: sender];
+ /* We call method method to change UI to reflect whether a preset is used or not*/
+ [self CustomSettingUsed: sender];
+}
+
/* Get and Display Current Pic Settings in main window */
- (IBAction) CalculatePictureSizing: (id) sender
@"%d", displayparwidth]];
[fPicSettingPARHeight setStringValue: [NSString stringWithFormat:
@"%d", displayparheight]];
- [fPicSettingHeight setStringValue: [NSString stringWithFormat:
- @"%d", displayparheight]];
+
fTitle->job->keep_ratio = 0;
}
else
[fVidBitrateField setIntValue: hb_calc_bitrate( job,
[fVidTargetSizeField intValue] )];
+
+
}
+/* Method to determine if we should change the UI
+To reflect whether or not a Preset is being used or if
+the user is using "Custom" settings by determining the sender*/
+- (IBAction) CustomSettingUsed: (id) sender
+{
+ if ([sender stringValue] != NULL)
+ {
+ /* Deselect the currently selected Preset if there is one*/
+ [tableView deselectRow:[tableView selectedRow]];
+ /* Change UI to show "Custom" settings are being used */
+ [fPresetSelectedDisplay setStringValue: @"Custom"];
+ }
+}
+
+
- (IBAction) ShowAddPresetPanel: (id) sender
{
/* Show the panel */
+ /* Temporarily disable until window hang bug is fixed */
+
[NSApp beginSheet: fAddPresetPanel modalForWindow: fWindow
modalDelegate: NULL didEndSelector: NULL contextInfo: NULL];
[NSApp runModalForWindow: fAddPresetPanel];
[NSApp endSheet: fAddPresetPanel];
[fAddPresetPanel orderOut: self];
+
}
- (IBAction) CloseAddPresetPanel: (id) sender
{
[NSApp stopModal];
}
-- (IBAction)addPreset:(id)sender
+- (IBAction)AddFactoryPresets:(id)sender
+{
+ /* Here we create each shipped preset */
+ [UserPresets addObject:[self CreateIpodPreset]];
+ [UserPresets addObject:[self CreateAppleTVPreset]];
+ [self AddPreset];
+}
+- (IBAction)AddUserPreset:(id)sender
+{
+ /* Here we create a custom user preset */
+ [UserPresets addObject:[self CreatePreset]];
+ [self AddPreset];
+
+}
+- (void)AddPreset
{
- [UserPresets addObject:[self CreatePreset]];
+
+
+ /* We Sort the Presets By Factory or Custom */
+ NSSortDescriptor * presetTypeDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"Type"
+ ascending:YES] autorelease];
/* We Sort the Presets Alphabetically by name */
- NSSortDescriptor * lastNameDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"PresetName"
+ NSSortDescriptor * presetNameDescriptor=[[[NSSortDescriptor alloc] initWithKey:@"PresetName"
ascending:YES selector:@selector(caseInsensitiveCompare:)] autorelease];
- NSArray *sortDescriptors=[NSArray arrayWithObject:lastNameDescriptor];
+ NSArray *sortDescriptors=[NSArray arrayWithObjects:presetTypeDescriptor,presetNameDescriptor,nil];
NSArray *sortedArray=[UserPresets sortedArrayUsingDescriptors:sortDescriptors];
[UserPresets setArray:sortedArray];
/* We stop the modal window for the new preset */
- [fPresetNewName setStringValue: @""];
+ [fPresetNewName setStringValue: @""];
[NSApp stopModal];
/* We Reload the New Table data for presets */
[tableView reloadData];
[self savePreset];
}
-- (IBAction)insertPreset:(id)sender
+- (IBAction)InsertPreset:(id)sender
{
int index = [tableView selectedRow];
[UserPresets insertObject:[self CreatePreset] atIndex:index];
NSMutableDictionary *preset = [[NSMutableDictionary alloc] init];
/* Get the New Preset Name from the field in the AddPresetPanel */
[preset setObject:[fPresetNewName stringValue] forKey:@"PresetName"];
+ /*Set whether or not this is a user preset or factory 0 is factory, 1 is user*/
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"Type"];
+ /*Set whether or not this is default, at creation set to 0*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"Default"];
/*Get the whether or not to apply pic settings in the AddPresetPanel*/
[preset setObject:[NSNumber numberWithInt:[fPresetNewPicSettingsApply state]] forKey:@"UsesPictureSettings"];
/* File Format */
[preset setObject:[fDstFormatPopUp titleOfSelectedItem] forKey:@"FileFormat"];
+ /* Chapter Markers fCreateChapterMarkers*/
+ [preset setObject:[NSNumber numberWithInt:[fCreateChapterMarkers state]] forKey:@"ChapterMarkers"];
/* Codecs */
[preset setObject:[fDstCodecsPopUp titleOfSelectedItem] forKey:@"FileCodecs"];
/* Video encoder */
/*Picture Settings*/
hb_job_t * job = fTitle->job;
/* Basic Picture Settings */
+ /* Use Max Picture settings for whatever the dvd is.*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"UsesMaxPictureSettings"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
}
-- (IBAction)deletePreset:(id)sender
+- (NSDictionary *)CreateIpodPreset
+{
+ NSMutableDictionary *preset = [[NSMutableDictionary alloc] init];
+ /* Get the New Preset Name from the field in the AddPresetPanel */
+ [preset setObject:@"HB-iPod" forKey:@"PresetName"];
+ /*Set whether or not this is a user preset or factory 0 is factory, 1 is user*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"Type"];
+ /*Set whether or not this is default, at creation set to 0*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"Default"];
+ /*Get the whether or not to apply pic settings in the AddPresetPanel*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"UsesPictureSettings"];
+ /* File Format */
+ [preset setObject:@"MP4 file" forKey:@"FileFormat"];
+ /* Chapter Markers*/
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"ChapterMarkers"];
+ /* Codecs */
+ [preset setObject:@"AVC/H.264 Video / AAC Audio" forKey:@"FileCodecs"];
+ /* Video encoder */
+ [preset setObject:@"x264 (h.264 iPod)" forKey:@"VideoEncoder"];
+ /* Video quality */
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"VideoQualityType"];
+ [preset setObject:[fVidTargetSizeField stringValue] forKey:@"VideoTargetSize"];
+ [preset setObject:@"1400" forKey:@"VideoAvgBitrate"];
+ [preset setObject:[NSNumber numberWithFloat:[fVidQualitySlider floatValue]] forKey:@"VideoQualitySlider"];
+
+ /* Video framerate */
+ [preset setObject:@"Same as source" forKey:@"VideoFramerate"];
+ /* GrayScale */
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoGrayScale"];
+ /* 2 Pass Encoding */
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoTwoPass"];
+
+ /*Picture Settings*/
+ //hb_job_t * job = fTitle->job;
+ /* Basic Picture Settings */
+ /* Use Max Picture settings for whatever the dvd is.*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"UsesMaxPictureSettings"];
+ //[preset setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
+ //[preset setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
+ //[preset setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
+ //[preset setObject:[NSNumber numberWithInt:fTitle->job->deinterlace] forKey:@"PictureDeinterlace"];
+ //[preset setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
+ /* Set crop settings here */
+ /* The Auto Crop Matrix in the Picture Window autodetects differences in crop settings */
+ //[preset setObject:[NSNumber numberWithInt:job->crop[0]] forKey:@"PictureTopCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[1]] forKey:@"PictureBottomCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[2]] forKey:@"PictureLeftCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[3]] forKey:@"PictureRightCrop"];
+
+ /*Audio*/
+ /* Audio Language One*/
+ [preset setObject:[fAudLang1PopUp titleOfSelectedItem] forKey:@"AudioLang1"];
+ /* Audio Language One Surround Sound Checkbox*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"AudioLang1Surround"];
+ /* Audio Sample Rate*/
+ [preset setObject:@"44.1" forKey:@"AudioSampleRate"];
+ /* Audio Bitrate Rate*/
+ [preset setObject:@"128" forKey:@"AudioBitRate"];
+ /* Subtitles*/
+ [preset setObject:@"None" forKey:@"Subtitles"];
+
+
+ [preset autorelease];
+ return preset;
+
+}
+
+- (NSDictionary *)CreateAppleTVPreset
+{
+ NSMutableDictionary *preset = [[NSMutableDictionary alloc] init];
+ /* Get the New Preset Name from the field in the AddPresetPanel */
+ [preset setObject:@"HB-AppleTV" forKey:@"PresetName"];
+ /*Set whether or not this is a user preset or factory 0 is factory, 1 is user*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"Type"];
+ /*Set whether or not this is default, at creation set to 0*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"Default"];
+ /*Get the whether or not to apply pic settings in the AddPresetPanel*/
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"UsesPictureSettings"];
+ /* File Format */
+ [preset setObject:@"MP4 file" forKey:@"FileFormat"];
+ /* Chapter Markers*/
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"ChapterMarkers"];
+ /* Codecs */
+ [preset setObject:@"AVC/H.264 Video / AAC Audio" forKey:@"FileCodecs"];
+ /* Video encoder */
+ [preset setObject:@"x264 (h.264 Main)" forKey:@"VideoEncoder"];
+ /* Video quality */
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"VideoQualityType"];
+ [preset setObject:[fVidTargetSizeField stringValue] forKey:@"VideoTargetSize"];
+ [preset setObject:@"3000" forKey:@"VideoAvgBitrate"];
+ [preset setObject:[NSNumber numberWithFloat:[fVidQualitySlider floatValue]] forKey:@"VideoQualitySlider"];
+
+ /* Video framerate */
+ [preset setObject:@"Same as source" forKey:@"VideoFramerate"];
+ /* GrayScale */
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoGrayScale"];
+ /* 2 Pass Encoding */
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoTwoPass"];
+
+ /*Picture Settings*/
+ /* For AppleTV we only want to retain UsesMaxPictureSettings
+ which depend on the source dvd picture settings, so we don't
+ record the current dvd's picture info since it will vary from
+ source to source*/
+ //hb_job_t * job = fTitle->job;
+ //hb_job_t * job = title->job;
+ /* Basic Picture Settings */
+ /* Use Max Picture settings for whatever the dvd is.*/
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"UsesMaxPictureSettings"];
+ //[preset setObject:[NSNumber numberWithInt:PicOrigOutputWidth] forKey:@"PictureWidth"];
+ //[preset setObject:[NSNumber numberWithInt:PicOrigOutputHeight] forKey:@"PictureHeight"];
+ //[preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureKeepRatio"];
+ //[preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDeinterlace"];
+ [preset setObject:[NSNumber numberWithInt:1] forKey:@"PicturePAR"];
+ /* Set crop settings here */
+ /* The Auto Crop Matrix in the Picture Window autodetects differences in crop settings */
+ //[preset setObject:[NSNumber numberWithInt:job->crop[0]] forKey:@"PictureTopCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[1]] forKey:@"PictureBottomCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[2]] forKey:@"PictureLeftCrop"];
+ //[preset setObject:[NSNumber numberWithInt:job->crop[3]] forKey:@"PictureRightCrop"];
+
+ /*Audio*/
+ /* Audio Language One*/
+ [preset setObject:[fAudLang1PopUp titleOfSelectedItem] forKey:@"AudioLang1"];
+ /* Audio Language One Surround Sound Checkbox*/
+ [preset setObject:[NSNumber numberWithInt:0] forKey:@"AudioLang1Surround"];
+ /* Audio Sample Rate*/
+ [preset setObject:@"44.1" forKey:@"AudioSampleRate"];
+ /* Audio Bitrate Rate*/
+ [preset setObject:@"320" forKey:@"AudioBitRate"];
+ /* Subtitles*/
+ [preset setObject:@"None" forKey:@"Subtitles"];
+
+
+ [preset autorelease];
+ return preset;
+
+}
+
+
+- (IBAction)DeletePreset:(id)sender
{
int status;
NSEnumerator *enumerator;
/* we get the chosen preset from the UserPresets array */
chosenPreset = [UserPresets objectAtIndex:[sender selectedRow]];
/* we set the preset display field in main window here */
- //[fPresetSelectedDisplay setStringValue: [NSString stringWithFormat: @"%@", [chosenPreset valueForKey:@"PresetName"]]];
+ [fPresetSelectedDisplay setStringValue: [NSString stringWithFormat: @"%@", [chosenPreset valueForKey:@"PresetName"]]];
/* File Format */
[fDstFormatPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"FileFormat"]]];
[self FormatPopUpChanged: NULL];
- /* Codecs */
+ /* Chapter Markers*/
+ [fCreateChapterMarkers setState:[[chosenPreset objectForKey:@"ChapterMarkers"] intValue]];
+ /* Codecs */
[fDstCodecsPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"FileCodecs"]]];
[self CodecsPopUpChanged: NULL];
/* Video encoder */
[fVidEncoderPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]]];
/* Lets run through the following functions to get variables set there */
- [self EncoderPopUpChanged: sender];
- [self Check6ChannelAACExtraction: sender];
- [self CalculateBitrate: sender];
+ [self EncoderPopUpChanged: NULL];
+ [self Check6ChannelAACExtraction: NULL];
+ [self CalculateBitrate: NULL];
/* Video quality */
[fVidQualityMatrix selectCellAtRow:[[chosenPreset objectForKey:@"VideoQualityType"] intValue] column:0];
[fVidBitrateField setStringValue: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoAvgBitrate"]]];
[fVidQualitySlider setFloatValue: [[chosenPreset valueForKey:@"VideoQualitySlider"] floatValue]];
- [self VideoMatrixChanged: sender];
+ [self VideoMatrixChanged: NULL];
/* Video framerate */
[fVidRatePopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoFramerate"]]];
[fAudLang1PopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"AudioLang1"]]];
/* Audio Language One Surround Sound Checkbox*/
[fAudLang1SurroundCheck setState:[[chosenPreset objectForKey:@"AudioLang1Surround"] intValue]];
- [self Check6ChannelAACExtraction: sender];
+ [self Check6ChannelAACExtraction: NULL];
/* Audio Sample Rate*/
[fAudRatePopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"AudioSampleRate"]]];
/* Audio Bitrate Rate*/
if ([[chosenPreset objectForKey:@"UsesPictureSettings"] intValue] == 1)
{
hb_job_t * job = fTitle->job;
- job->width = [[chosenPreset objectForKey:@"PictureWidth"] intValue];
- job->height = [[chosenPreset objectForKey:@"PictureHeight"] intValue];
- job->keep_ratio = [[chosenPreset objectForKey:@"PictureKeepRatio"] intValue];
- if (job->keep_ratio == 1)
+ /* Check to see if we should use the max picture setting for the current title*/
+ if ([[chosenPreset objectForKey:@"UsesMaxPictureSettings"] intValue] == 1)
+ {
+ /* Use Max Picture settings for whatever the dvd is.*/
+ [self RevertPictureSizeToMax: NULL];
+ job->keep_ratio = [[chosenPreset objectForKey:@"PictureKeepRatio"] intValue];
+ if (job->keep_ratio == 1)
+ {
+ hb_fix_aspect( job, HB_KEEP_WIDTH );
+ }
+ job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
+ }
+ else
{
- hb_fix_aspect( job, HB_KEEP_WIDTH );
+ job->width = [[chosenPreset objectForKey:@"PictureWidth"] intValue];
+ job->height = [[chosenPreset objectForKey:@"PictureHeight"] intValue];
+ job->keep_ratio = [[chosenPreset objectForKey:@"PictureKeepRatio"] intValue];
+ if (job->keep_ratio == 1)
+ {
+ hb_fix_aspect( job, HB_KEEP_WIDTH );
+ }
+ job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
+ job->crop[0] = [[chosenPreset objectForKey:@"PictureTopCrop"] intValue];
+ job->crop[1] = [[chosenPreset objectForKey:@"PictureBottomCrop"] intValue];
+ job->crop[2] = [[chosenPreset objectForKey:@"PictureLeftCrop"] intValue];
+ job->crop[3] = [[chosenPreset objectForKey:@"PictureRightCrop"] intValue];
}
- job->pixel_ratio = [[chosenPreset objectForKey:@"PicturePAR"] intValue];
- job->crop[0] = [[chosenPreset objectForKey:@"PictureTopCrop"] intValue];
- job->crop[1] = [[chosenPreset objectForKey:@"PictureBottomCrop"] intValue];
- job->crop[2] = [[chosenPreset objectForKey:@"PictureLeftCrop"] intValue];
- job->crop[3] = [[chosenPreset objectForKey:@"PictureRightCrop"] intValue];
- [self CalculatePictureSizing: sender];
+ [self CalculatePictureSizing: NULL];
}
- // Deselect the currently selected table //
- //[tableView deselectRow:[tableView selectedRow]];
+
+
+
}
}
+
+
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [UserPresets count];