summaryrefslogtreecommitdiffstats
path: root/macosx/HBAudioTrackPreset.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBAudioTrackPreset.m')
-rw-r--r--macosx/HBAudioTrackPreset.m31
1 files changed, 31 insertions, 0 deletions
diff --git a/macosx/HBAudioTrackPreset.m b/macosx/HBAudioTrackPreset.m
index 7a0f4d39d..7d5cc2e90 100644
--- a/macosx/HBAudioTrackPreset.m
+++ b/macosx/HBAudioTrackPreset.m
@@ -7,6 +7,7 @@
//
#import "HBAudioTrackPreset.h"
+#import "NSCodingMacro.h"
#include "hb.h"
#define DEFAULT_SAMPLERATE 48000
@@ -216,6 +217,36 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex;
return retval;
}
+#pragma mark - NSCoding
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeInt:1 forKey:@"HBAudioTrackPresetVersion"];
+
+ encodeInt(_encoder);
+ encodeInt(_mixdown);
+ encodeInt(_sampleRate);
+ encodeInt(_bitRate);
+
+ encodeInt(_gain);
+ encodeDouble(_drc);
+}
+
+- (id)initWithCoder:(NSCoder *)decoder
+{
+ self = [super init];
+
+ decodeInt(_encoder);
+ decodeInt(_mixdown);
+ decodeInt(_sampleRate);
+ decodeInt(_bitRate);
+
+ decodeInt(_gain);
+ decodeDouble(_drc);
+
+ return self;
+}
+
@end
#pragma mark - Value Trasformers