summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.m
diff options
context:
space:
mode:
authordynaflash <[email protected]>2010-06-28 20:11:34 +0000
committerdynaflash <[email protected]>2010-06-28 20:11:34 +0000
commit185bb81f9be03b3d24590dc4edea21c56c7ccb8d (patch)
treebf5189526b73745f4633f7cb272fe8f1ccea3d70 /macosx/Controller.m
parentd6b8fa70071ed9ef8dfa6e7e9675cc2b9b4b01d5 (diff)
MacGui: Presets - Add abliity to modify width and height on a preset independent of the currently loaded settings via repurposing the old "Current" picture size setting in the add new preset dialogue.
- Changes "Current" to "Custom". - When Custom is selected two text fields for width and height appear, initially populated with the current picture settings which means that if not changed will behave as old "Current" settings used to. - Editable fields means the preset can be save to pic dimensions other than what is setup for the current encode setup. - For example you can have a dvd loaded up and then save a preset using say 1280 x 720 as max dims, even though the currently loaded source would not have allowed that before. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3419 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.m')
-rw-r--r--macosx/Controller.m26
1 files changed, 22 insertions, 4 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index 9f2f4e8b8..60e169404 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -7190,6 +7190,18 @@ return YES;
}
+- (IBAction) addPresetPicDropdownChanged: (id) sender
+{
+ if ([fPresetNewPicSettingsPopUp indexOfSelectedItem] == 1)
+ {
+ [fPresetNewPicWidthHeightBox setHidden:NO];
+ }
+ else
+ {
+ [fPresetNewPicWidthHeightBox setHidden:YES];
+ }
+}
+
- (IBAction) showAddPresetPanel: (id) sender
{
/* Deselect the currently selected Preset if there is one*/
@@ -7198,7 +7210,7 @@ return YES;
/* Populate the preset picture settings popup here */
[fPresetNewPicSettingsPopUp removeAllItems];
[fPresetNewPicSettingsPopUp addItemWithTitle:@"None"];
- [fPresetNewPicSettingsPopUp addItemWithTitle:@"Current"];
+ [fPresetNewPicSettingsPopUp addItemWithTitle:@"Custom"];
[fPresetNewPicSettingsPopUp addItemWithTitle:@"Source Maximum (post source scan)"];
[fPresetNewPicSettingsPopUp selectItemAtIndex: 0];
/* Uncheck the preset use filters checkbox */
@@ -7208,6 +7220,12 @@ return YES;
/* Erase info from the input fields*/
[fPresetNewName setStringValue: @""];
[fPresetNewDesc setStringValue: @""];
+
+ /* Initialize custom height and width settings to current values */
+
+ [fPresetNewPicWidth setStringValue: [NSString stringWithFormat:@"%d",fTitle->job->width]];
+ [fPresetNewPicHeight setStringValue: [NSString stringWithFormat:@"%d",fTitle->job->height]];
+ [self addPresetPicDropdownChanged:nil];
/* Show the panel */
[NSApp beginSheet:fAddPresetPanel modalForWindow:fWindow modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
}
@@ -7340,11 +7358,11 @@ return YES;
[preset setObject:[NSNumber numberWithInt:[fVidTurboPassCheck state]] forKey:@"VideoTurboTwoPass"];
/*Picture Settings*/
hb_job_t * job = fTitle->job;
+
/* Picture Sizing */
- /* 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:[fPresetNewPicWidth intValue]] forKey:@"PictureWidth"];
+ [preset setObject:[NSNumber numberWithInt:[fPresetNewPicHeight intValue]] forKey:@"PictureHeight"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->anamorphic.mode] forKey:@"PicturePAR"];
[preset setObject:[NSNumber numberWithInt:fTitle->job->modulus] forKey:@"PictureModulus"];