5 // Created by Damiano Galassi on 15/01/08.
6 // This file is part of the HandBrake source code.
7 // Homepage: <http://handbrake.fr/>.
8 // It may be used under the terms of the GNU General Public License.
15 @implementation Preset
17 - (id) initWithMuxer: (int) muxer
18 videoCodec: (int) videoCodec
19 videoBitRate: (int) videoBitRate
20 videoCodecOptions: (NSString *) videoCodecOptions
21 audioCodec: (int) audioCodec
22 audioBitrate: (int) audioBitrate
23 audioSampleRate: (int) audioSampleRate
24 maxWidth: (int) maxWidth
25 maxHeight: (int) maxHeight
26 anamorphic: (int) anamorphic;
28 if (self = [super init])
31 fVideoCodec = videoCodec;
32 fVideoBitRate = videoBitRate;
33 fVideoCodecOptions = videoCodecOptions;
34 fAudioCodec = audioCodec;
35 fAudioBitRate = audioBitrate;
36 fAudioSampleRate = audioSampleRate;
38 fMaxHeight = maxHeight;
39 fAnamorphic = anamorphic;
46 [fVideoCodecOptions release];
50 - (id) initWithCoder:(NSCoder *) coder
52 presetName = [[coder decodeObjectForKey:@"Name"] retain];
53 fMuxer = [coder decodeIntForKey:@"Muxer"];
54 fVideoCodec = [coder decodeIntForKey:@"VideoCodec"];
55 fVideoBitRate = [coder decodeIntForKey:@"VideoBitRate"];
56 fVideoCodecOptions = [[coder decodeObjectForKey:@"VideoCodecOptions"] retain];
57 fAudioCodec = [coder decodeIntForKey:@"AudioCodec"];
58 fAudioBitRate = [coder decodeIntForKey:@"AudioBitRate"];
59 fAudioSampleRate = [coder decodeIntForKey:@"AudioSampleRate"];
60 fMaxWidth = [coder decodeIntForKey:@"MaxWidth"];
61 fMaxHeight = [coder decodeIntForKey:@"MaxHeight"];
62 fAnamorphic = [coder decodeIntForKey:@"Anarmophic"];
67 - (void) encodeWithCoder:(NSCoder *)encoder
69 [encoder encodeObject:presetName forKey:@"Name"];
70 [encoder encodeInt:fMuxer forKey:@"Muxer"];
71 [encoder encodeInt:fVideoCodec forKey:@"VideoCodec"];
72 [encoder encodeInt:fVideoBitRate forKey:@"VideoBitRate"];
73 [encoder encodeObject:fVideoCodecOptions forKey:@"VideoCodecOptions"];
74 [encoder encodeInt:fAudioCodec forKey:@"AudioCodec"];
75 [encoder encodeInt:fAudioBitRate forKey:@"AudioBitRate"];
76 [encoder encodeInt:fAudioSampleRate forKey:@"AudioSampleRate"];
77 [encoder encodeInt:fMaxWidth forKey:@"MaxWidth"];
78 [encoder encodeInt:fMaxHeight forKey:@"MaxHeight"];
79 [encoder encodeInt:fAnamorphic forKey:@"Anarmophic"];
92 - (NSString *) videoCodecOptions
94 return fVideoCodecOptions;