diff options
author | ritsuka <[email protected]> | 2015-02-23 07:45:40 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-02-23 07:45:40 +0000 |
commit | 96ad515f2c533b3905e38d725c15fb0668b094a2 (patch) | |
tree | abdfebf51660ff877a7cebcf10fdbe271c1288f0 /macosx/HBPresetsManager.m | |
parent | 7b0f081409e324a581140d8886a32cf3bf00024a (diff) |
MacGui: load the built-in presets from a plist file. The plist is the almost the same as the LinGui one, but it's a duplicated to avoid having to wait for one gui in case of breaking presets changes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6939 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPresetsManager.m')
-rw-r--r-- | macosx/HBPresetsManager.m | 1362 |
1 files changed, 24 insertions, 1338 deletions
diff --git a/macosx/HBPresetsManager.m b/macosx/HBPresetsManager.m index 34a80723b..108859cbb 100644 --- a/macosx/HBPresetsManager.m +++ b/macosx/HBPresetsManager.m @@ -15,22 +15,6 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification"; @property (nonatomic, readonly, copy) NSURL *fileURL; -/* Dictionaries for individual presets ("Devices" folder) */ -- (NSDictionary *)createUniversalPreset; -- (NSDictionary *)createiPodPreset; -- (NSDictionary *)createiPhoneiPodtouchPreset; -- (NSDictionary *)createiPadPreset; -- (NSDictionary *)createAppleTVPreset; -- (NSDictionary *)createAppleTV2Preset; -- (NSDictionary *)createAppleTV3Preset; -- (NSDictionary *)createAndroidPreset; -- (NSDictionary *)createAndroidTabletPreset; -- (NSDictionary *)createW8PhonePreset; - -/* Dictionaries for individual presets ("Regular" folder) */ -- (NSDictionary *)createNormalPreset; -- (NSDictionary *)createHighProfilePreset; - @end @implementation HBPresetsManager @@ -362,54 +346,39 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification"; #pragma mark - Built In Generation -- (void)loadPresetsForType:(NSString *)type fromSel:(SEL[])selArray length:(int)len -{ - HBPreset *folderNode = [[HBPreset alloc] initWithFolderName:type builtIn:YES]; - - for (int i = 0; i < len; i++) - { - NSMutableDictionary *presetDict = [self performSelector:selArray[i]]; - presetDict[@"PresetBuildNumber"] = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"]; - HBPreset *presetNode = [[HBPreset alloc] initWithName:presetDict[@"PresetName"] - content:presetDict - builtIn:YES]; - [folderNode.children addObject:presetNode]; - [presetNode release]; - } - - [self.root insertObject:folderNode inChildrenAtIndex:0]; - [folderNode release]; -} - /** * Built-in preset folders at the root of the hierarchy - * - * Re-create new built-in presets programmatically and add them to the array - * +* * Note: the built-in presets will *not* sort themselves alphabetically, * so they will appear in the order you create them. */ - (void)generateBuiltInPresets { - SEL devicesPresets[] = { @selector(createUniversalPreset), - @selector(createiPodPreset), - @selector(createiPhoneiPodtouchPreset), - @selector(createiPadPreset), - @selector(createAppleTVPreset), - @selector(createAppleTV2Preset), - @selector(createAppleTV3Preset), - @selector(createAndroidPreset), - @selector(createAndroidTabletPreset), - @selector(createW8PhonePreset) - }; - - SEL regularPresets[] = { @selector(createNormalPreset), - @selector(createHighProfilePreset)}; - [self deleteBuiltInPresets]; - [self loadPresetsForType:@"Regular" fromSel:regularPresets length:2]; - [self loadPresetsForType:@"Devices" fromSel:devicesPresets length:10]; + // Load the built-in presets from the app bundle Resources folder. + NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"presets" withExtension:@".plist"]; + NSArray *presetsArray = [[NSArray alloc] initWithContentsOfURL:fileURL]; + + for (NSDictionary *child in presetsArray.reverseObjectEnumerator) + { + HBPreset *preset = [self loadFromDict:child]; + + [preset enumerateObjectsUsingBlock:^(id obj, NSIndexPath *idx, BOOL *stop) + { + NSMutableDictionary *presetDict = [[obj content] mutableCopy]; + + // Set the current version in the built-in presets, to they won't be reupdated + // each time the app checks the version. + presetDict[@"PresetBuildNumber"] = [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"]; + [obj setContent:presetDict]; + [presetDict release]; + }]; + + [self.root insertObject:preset inChildrenAtIndex:0]; + } + + [presetsArray release]; // set a new Default preset [self selectNewDefault]; @@ -433,1287 +402,4 @@ NSString *HBPresetsChangedNotification = @"HBPresetsChangedNotification"; [self didChangeValueForKey:@"root"]; } -#pragma mark - -#pragma mark Individual Preset Definitions -/* These NSDictionary definitions contain settings for one built-in preset */ - -- (NSMutableDictionary *)createUniversalPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"Universal"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for compatibility with all Apple devices (including the iPod 6G and later). Includes Dolby Digital audio for surround sound."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"fast"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"baseline"; - preset[@"VideoLevel"] = @"3.0"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @720; - preset[@"PictureHeight"] = @576; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Track 2 */ - NSMutableDictionary *audioTrack2Array = [[NSMutableDictionary alloc] init]; - audioTrack2Array[@"AudioTrack"] = @1; - audioTrack2Array[@"AudioEncoder"] = @"AC3 Passthru"; - audioTrack2Array[@"AudioMixdown"] = @"None"; - audioTrack2Array[@"AudioSamplerate"] = @"Auto"; - audioTrack2Array[@"AudioBitrate"] = @"160"; - audioTrack2Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack2Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack2Array autorelease]; - [audioListArray addObject:audioTrack2Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createiPodPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"iPod"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for playback on the iPod with Video (all generations)."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @1; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"baseline"; - preset[@"VideoLevel"] = @"1.3"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @22.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @320; - preset[@"PictureHeight"] = @240; - preset[@"PicturePAR"] = @0; //none - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @1; - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createiPhoneiPodtouchPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"iPhone & iPod touch"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for handheld iOS devices (iPhone 4, iPod touch 3G and later)."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @22.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @960; - preset[@"PictureHeight"] = @640; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createiPadPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"iPad"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for playback on the iPad (all generations)."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @1280; - preset[@"PictureHeight"] = @720; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createAppleTVPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"AppleTV"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for the original AppleTV. Includes Dolby Digital audio for surround sound. Also compatible with iOS devices released since 2009."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @"qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500"; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @960; - preset[@"PictureHeight"] = @720; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Track 2 */ - NSMutableDictionary *audioTrack2Array = [[NSMutableDictionary alloc] init]; - audioTrack2Array[@"AudioTrack"] = @1; - audioTrack2Array[@"AudioEncoder"] = @"AC3 Passthru"; - audioTrack2Array[@"AudioMixdown"] = @"None"; - audioTrack2Array[@"AudioSamplerate"] = @"Auto"; - audioTrack2Array[@"AudioBitrate"] = @"160"; - audioTrack2Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack2Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack2Array autorelease]; - [audioListArray addObject:audioTrack2Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createAppleTV2Preset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"AppleTV 2"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for the second-generation AppleTV. Includes Dolby Digital audio for surround sound. NOT compatible with the original AppleTV."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @1280; - preset[@"PictureHeight"] = @720; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Track 2 */ - NSMutableDictionary *audioTrack2Array = [[NSMutableDictionary alloc] init]; - audioTrack2Array[@"AudioTrack"] = @1; - audioTrack2Array[@"AudioEncoder"] = @"AC3 Passthru"; - audioTrack2Array[@"AudioMixdown"] = @"None"; - audioTrack2Array[@"AudioSamplerate"] = @"Auto"; - audioTrack2Array[@"AudioBitrate"] = @"160"; - audioTrack2Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack2Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack2Array autorelease]; - [audioListArray addObject:audioTrack2Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createAppleTV3Preset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"AppleTV 3"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for the third-generation AppleTV. Includes Dolby Digital audio for surround sound. NOT compatible with the original AppleTV. May stutter on the second-generation AppleTV."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"4.0"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @1920; - preset[@"PictureHeight"] = @1080; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @3; //fast - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Track 2 */ - NSMutableDictionary *audioTrack2Array = [[NSMutableDictionary alloc] init]; - audioTrack2Array[@"AudioTrack"] = @1; - audioTrack2Array[@"AudioEncoder"] = @"AC3 Passthru"; - audioTrack2Array[@"AudioMixdown"] = @"None"; - audioTrack2Array[@"AudioSamplerate"] = @"Auto"; - audioTrack2Array[@"AudioBitrate"] = @"160"; - audioTrack2Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack2Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack2Array autorelease]; - [audioListArray addObject:audioTrack2Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createAndroidPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"Android"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's settings for midrange devices running Android 2.3 or later."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @0; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"main"; - preset[@"VideoLevel"] = @"3.0"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @22.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @720; - preset[@"PictureHeight"] = @576; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"128"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createAndroidTabletPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"Android Tablet"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's preset for tablets running Android 2.3 or later."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @0; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"main"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @22.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @1280; - preset[@"PictureHeight"] = @720; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"128"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createW8PhonePreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"Windows Phone 8"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's preset for Windows Phone 8 devices"; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @0; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"main"; - preset[@"VideoLevel"] = @"3.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @22.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"30"; - preset[@"VideoFramerateMode"] = @"pfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @1280; - preset[@"PictureHeight"] = @720; - preset[@"PicturePAR"] = @0; //None - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @1; - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"128"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createNormalPreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"Normal"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @1; //default - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's normal, default settings."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"veryfast"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"main"; - preset[@"VideoLevel"] = @"4.0"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"Same as source"; - preset[@"VideoFramerateMode"] = @"vfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @0; - preset[@"PictureHeight"] = @0; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @0; //off - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - -- (NSMutableDictionary *)createHighProfilePreset -{ - NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; - - /* Preset properties (name, type: factory/user, default, folder, tooltip) */ - preset[@"PresetName"] = @"High Profile"; - preset[@"Type"] = @0; //factory - preset[@"Default"] = @0; - preset[@"Folder"] = @NO; - preset[@"PresetDescription"] = @"HandBrake's general-purpose preset for High Profile H.264 video."; - - /* Container format and related settings */ - preset[@"FileFormat"] = @"MP4 file"; - preset[@"Mp4HttpOptimize"] = @0; - preset[@"Mp4iPodCompatible"] = @0; - - /* Chapter markers */ - preset[@"ChapterMarkers"] = @1; - - /* Video encoder and advanced options */ - preset[@"VideoEncoder"] = @"H.264 (x264)"; - preset[@"x264Option"] = @""; - preset[@"x264UseAdvancedOptions"] = @0; - preset[@"VideoPreset"] = @"medium"; - preset[@"VideoTune"] = @""; - preset[@"VideoOptionExtra"] = @""; - preset[@"VideoProfile"] = @"high"; - preset[@"VideoLevel"] = @"4.1"; - - /* Video rate control */ - preset[@"VideoAvgBitrate"] = @"2500"; - preset[@"VideoTwoPass"] = @0; - preset[@"VideoTurboTwoPass"] = @0; - preset[@"VideoQualityType"] = @2; //cq - preset[@"VideoQualitySlider"] = @20.0f; - - /* Video frame rate */ - preset[@"VideoFramerate"] = @"Same as source"; - preset[@"VideoFramerateMode"] = @"vfr"; - - /* Picture size */ - preset[@"UsesPictureSettings"] = @1; - preset[@"PictureWidth"] = @0; - preset[@"PictureHeight"] = @0; - preset[@"PicturePAR"] = @2; //loose - preset[@"PictureModulus"] = @2; - preset[@"PictureKeepRatio"] = @0; //set to 0 for Loose (FIXME: why?) - - /* Picture filters */ - preset[@"UsesPictureFilters"] = @1; - preset[@"PictureDecomb"] = @2; //default - preset[@"PictureDecombCustom"] = @""; - preset[@"PictureDecombDeinterlace"] = @1; //decomb - preset[@"PictureDeinterlace"] = @0; - preset[@"PictureDeinterlaceCustom"] = @""; - preset[@"PictureDetelecine"] = @0; - preset[@"PictureDetelecineCustom"] = @""; - preset[@"PictureDenoise"] = @0; - preset[@"PictureDenoiseCustom"] = @""; - preset[@"PictureDeblock"] = @0; - preset[@"VideoGrayScale"] = @0; - - /* Picture crop */ - preset[@"PictureAutoCrop"] = @1; - preset[@"PictureTopCrop"] = @0; - preset[@"PictureBottomCrop"] = @0; - preset[@"PictureLeftCrop"] = @0; - preset[@"PictureRightCrop"] = @0; - - /* Auto Passthru */ - preset[@"AudioEncoderFallback"] = @"AC3 (ffmpeg)"; - preset[@"AudioAllowAACPass"] = @1; - preset[@"AudioAllowAC3Pass"] = @1; - preset[@"AudioAllowDTSHDPass"] = @1; - preset[@"AudioAllowDTSPass"] = @1; - preset[@"AudioAllowMP3Pass"] = @1; - - /* Audio track list - no need to add "None" at the end */ - NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; - /* Track 1 */ - NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; - audioTrack1Array[@"AudioTrack"] = @1; - audioTrack1Array[@"AudioEncoder"] = @"AAC (avcodec)"; - audioTrack1Array[@"AudioMixdown"] = @"Dolby Pro Logic II"; - audioTrack1Array[@"AudioSamplerate"] = @"Auto"; - audioTrack1Array[@"AudioBitrate"] = @"160"; - audioTrack1Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack1Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack1Array autorelease]; - [audioListArray addObject:audioTrack1Array]; - /* Track 2 */ - NSMutableDictionary *audioTrack2Array = [[NSMutableDictionary alloc] init]; - audioTrack2Array[@"AudioTrack"] = @1; - audioTrack2Array[@"AudioEncoder"] = @"AC3 Passthru"; - audioTrack2Array[@"AudioMixdown"] = @"None"; - audioTrack2Array[@"AudioSamplerate"] = @"Auto"; - audioTrack2Array[@"AudioBitrate"] = @"160"; - audioTrack2Array[@"AudioTrackGainSlider"] = @0.0f; - audioTrack2Array[@"AudioTrackDRCSlider"] = @0.0f; - [audioTrack2Array autorelease]; - [audioListArray addObject:audioTrack2Array]; - /* Add the audio track(s) to the preset's audio list */ - preset[@"AudioList"] = [NSMutableArray arrayWithArray:audioListArray]; - [audioListArray release]; - - /* Subtitles (note: currently ignored) */ - preset[@"Subtitles"] = @"None"; - - /* Clean up and return the preset */ - [preset autorelease]; - return preset; -} - @end |