summaryrefslogtreecommitdiffstats
path: root/macosx/HBAudio.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBAudio.m')
-rw-r--r--macosx/HBAudio.m41
1 files changed, 41 insertions, 0 deletions
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index bdafebf0d..6eae9a1f6 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -7,6 +7,7 @@
#import "HBAudio.h"
#import "HBAudioController.h"
+#import "NSCodingMacro.h"
#import "hb.h"
NSString *keyAudioCodecName = @"keyAudioCodecName";
@@ -574,5 +575,45 @@ static NSMutableArray *masterBitRateArray = nil;
return retval;
}
+#pragma mark - NSCoding
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeInt:1 forKey:@"HBAudioTrackVersion"];
+
+ encodeObject(_track);
+ encodeObject(_codec);
+ encodeObject(_mixdown);
+ encodeObject(_sampleRate);
+ encodeObject(_bitRate);
+ encodeObject(_drc);
+ encodeObject(_gain);
+ encodeObject(_videoContainerTag);
+
+ encodeObject(_codecs);
+ encodeObject(_mixdowns);
+ encodeObject(_bitRates);
+}
+
+- (id)initWithCoder:(NSCoder *)decoder
+{
+ self = [super init];
+
+ decodeObject(_track);
+ decodeObject(_codec);
+ decodeObject(_mixdown);
+ decodeObject(_sampleRate);
+ decodeObject(_bitRate);
+ decodeObject(_drc);
+ decodeObject(_gain);
+ decodeObject(_videoContainerTag);
+
+ decodeObject(_codecs);
+ decodeObject(_mixdowns);
+ decodeObject(_bitRates);
+
+ return self;
+}
+
@end