summaryrefslogtreecommitdiffstats
path: root/macosx/InstantHandBrake/Preset.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2008-01-30 12:28:55 +0000
committerritsuka <[email protected]>2008-01-30 12:28:55 +0000
commit70de68d465248336a1d68e5932ac00f60882a612 (patch)
tree0207bd6c451bc97780597226292420e654af8db7 /macosx/InstantHandBrake/Preset.m
parent0ec912f5fd9008e4643bf375db3088f29c389304 (diff)
IHB: - Various bugfix
- IHB can loads .ihbdevice presets from a directory inside the application bundle, and from ~/Application Support/Instant Handbrake - A .ihbdevice file can contain multiple presets, but IHB only reads the first at the moment. I am not sure how to handle multiple presets yet. - The only way to create an .ihbprofile file is to edit DeviceController.m , another thing I still need to think about. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1239 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/InstantHandBrake/Preset.m')
-rw-r--r--macosx/InstantHandBrake/Preset.m34
1 files changed, 33 insertions, 1 deletions
diff --git a/macosx/InstantHandBrake/Preset.m b/macosx/InstantHandBrake/Preset.m
index b42bd510f..8eba139f1 100644
--- a/macosx/InstantHandBrake/Preset.m
+++ b/macosx/InstantHandBrake/Preset.m
@@ -4,7 +4,7 @@
//
// Created by Damiano Galassi on 15/01/08.
// This file is part of the HandBrake source code.
-// Homepage: <http://handbrake.m0k.org/>.
+// Homepage: <http://handbrake.fr/>.
// It may be used under the terms of the GNU General Public License.
//
//
@@ -47,6 +47,38 @@
[super dealloc];
}
+- (id) initWithCoder:(NSCoder *) coder
+{
+ presetName = [[coder decodeObjectForKey:@"Name"] retain];
+ fMuxer = [coder decodeIntForKey:@"Muxer"];
+ fVideoCodec = [coder decodeIntForKey:@"VideoCodec"];
+ fVideoBitRate = [coder decodeIntForKey:@"VideoBitRate"];
+ fVideoCodecOptions = [[coder decodeObjectForKey:@"VideoCodecOptions"] retain];
+ fAudioCodec = [coder decodeIntForKey:@"AudioCodec"];
+ fAudioBitRate = [coder decodeIntForKey:@"AudioBitRate"];
+ fAudioSampleRate = [coder decodeIntForKey:@"AudioSampleRate"];
+ fMaxWidth = [coder decodeIntForKey:@"MaxWidth"];
+ fMaxHeight = [coder decodeIntForKey:@"MaxHeight"];
+ fAnamorphic = [coder decodeIntForKey:@"Anarmophic"];
+
+ return self;
+}
+
+- (void) encodeWithCoder:(NSCoder *)encoder
+{
+ [encoder encodeObject:presetName forKey:@"Name"];
+ [encoder encodeInt:fMuxer forKey:@"Muxer"];
+ [encoder encodeInt:fVideoCodec forKey:@"VideoCodec"];
+ [encoder encodeInt:fVideoBitRate forKey:@"VideoBitRate"];
+ [encoder encodeObject:fVideoCodecOptions forKey:@"VideoCodecOptions"];
+ [encoder encodeInt:fAudioCodec forKey:@"AudioCodec"];
+ [encoder encodeInt:fAudioBitRate forKey:@"AudioBitRate"];
+ [encoder encodeInt:fAudioSampleRate forKey:@"AudioSampleRate"];
+ [encoder encodeInt:fMaxWidth forKey:@"MaxWidth"];
+ [encoder encodeInt:fMaxHeight forKey:@"MaxHeight"];
+ [encoder encodeInt:fAnamorphic forKey:@"Anarmophic"];
+}
+
- (int) muxer
{
return fMuxer;