OSDN Git Service

x264 bump to r1338-19977e9
[handbrake-jp/handbrake-jp-git.git] / macosx / InstantHandBrake / Preset.m
1 //
2 //  Preset.h
3 //  InstantHandBrake
4 //
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.
9 //
10 //
11
12 #import "Preset.h"
13
14
15 @implementation Preset
16
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;
27 {
28     if (self = [super init])
29     {
30         fMuxer = muxer;
31         fVideoCodec = videoCodec;
32         fVideoBitRate = videoBitRate;
33         fVideoCodecOptions = videoCodecOptions;
34         fAudioCodec = audioCodec;
35         fAudioBitRate = audioBitrate;
36         fAudioSampleRate = audioSampleRate;
37         fMaxWidth = maxWidth;
38         fMaxHeight = maxHeight;
39         fAnamorphic = anamorphic;
40     }
41     return self;
42 }
43
44 - (void) dealloc
45 {
46     [fVideoCodecOptions release];
47     [super dealloc];
48 }
49
50 - (id) initWithCoder:(NSCoder *) coder
51 {
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"];
63         
64     return self;
65 }
66
67 - (void) encodeWithCoder:(NSCoder *)encoder
68 {
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"];
80 }
81
82 - (int) muxer
83 {
84     return fMuxer;
85 }
86
87 - (int) videoCodec;
88 {
89     return fVideoCodec;
90 }
91
92 - (NSString *) videoCodecOptions
93 {
94     return fVideoCodecOptions;
95 }
96
97 - (int) videoBitRate
98 {
99     return fVideoBitRate;
100 }
101
102 - (int) AudioCodec;
103 {
104     return fAudioCodec;
105 }
106
107 - (int) maxWidth;
108 {
109     return fMaxWidth;
110 }
111
112 - (int) maxHeight;
113 {
114     return fMaxHeight;
115 }
116
117 @end