summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordynaflash <[email protected]>2008-02-21 13:47:09 +0000
committerdynaflash <[email protected]>2008-02-21 13:47:09 +0000
commit2d0511d66ba06c3559ddf6ea504082fb805e07db (patch)
treec9b3d6ee83f29c3140cbfea4346784b7c3b02e87
parent3aa14dbf73e98a3a4bbd091a3b083e4e256bf92f (diff)
MacGui: Fix and issue for auto adding the .m4v file extension for the aac + ac3 encoder for mp4 where reselecting mp4 format would reset the extension back to .mp4 and not .m4v
- Moves this to a new method called codecsPopUpChanged: so it is easier to call form multiple methods git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1309 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/Controller.h1
-rw-r--r--macosx/Controller.mm26
2 files changed, 18 insertions, 9 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h
index 3c912f077..4994e8149 100644
--- a/macosx/Controller.h
+++ b/macosx/Controller.h
@@ -227,6 +227,7 @@
- (IBAction) formatPopUpChanged: (id) sender;
- (IBAction) codecsPopUpChanged: (id) sender;
- (IBAction) encoderPopUpChanged: (id) sender;
+- (IBAction) autoSetM4vExtension: (id) sender;
- (IBAction) twoPassCheckboxChanged: (id) sender;
- (IBAction) videoFrameRateChanged: (id) sender;
- (IBAction) setEnabledStateOfAudioMixdownControls: (id) sender;
diff --git a/macosx/Controller.mm b/macosx/Controller.mm
index 75c536fbe..7a0cd5602 100644
--- a/macosx/Controller.mm
+++ b/macosx/Controller.mm
@@ -2270,6 +2270,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
/* We show the HTTP Optimized checkbox here since we are mp4 */
[fDstMp4HttpOptFileCheck setHidden: NO];
[fDstMp4iPodFileCheck setHidden: NO];
+
break;
case 1:
@@ -2339,6 +2340,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
}
}
+ /* Lets check to see if we want to auto set the .m4v extension for mp4 */
+ [self autoSetM4vExtension: sender];
[self customSettingUsed: sender];
}
@@ -2357,15 +2360,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
[fVidEncoderPopUp addItemWithTitle: @"x264"];
[fVidEncoderPopUp selectItemAtIndex: 0];
[fAdvancedOptions setHidden:NO];
- /* if MP4 format and [fDstCodecsPopUp indexOfSelectedItem] > 1 we know that the audio is going to be
- * either aac + ac3 passthru, or just ac3 passthru so we need to make sure the output file extension is m4v
- * otherwise Quicktime will not play it at all */
- if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fDstCodecsPopUp indexOfSelectedItem] > 1)
- {
- NSString *newpath = [[[fDstFile2Field stringValue] stringByDeletingPathExtension] stringByAppendingPathExtension: @"m4v"];
- [fDstFile2Field setStringValue: [NSString stringWithFormat:
- @"%@", newpath]];
- }
+ [self autoSetM4vExtension: sender];
}
else if( ( FormatSettings[format][codecs] & HB_VCODEC_FFMPEG ) )
@@ -2429,6 +2424,19 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It
[self twoPassCheckboxChanged: sender];
}
+
+ /* if MP4 format and [fDstCodecsPopUp indexOfSelectedItem] > 1 we know that the audio is going to be
+ * either aac + ac3 passthru, or just ac3 passthru so we need to make sure the output file extension is m4v
+ * otherwise Quicktime will not play it at all */
+- (IBAction) autoSetM4vExtension: (id) sender
+{
+ if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fDstCodecsPopUp indexOfSelectedItem] > 1)
+ {
+ NSString *newpath = [[[fDstFile2Field stringValue] stringByDeletingPathExtension] stringByAppendingPathExtension: @"m4v"];
+ [fDstFile2Field setStringValue: [NSString stringWithFormat:
+ @"%@", newpath]];
+ }
+}
/* 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*/