summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesDefaults.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBSubtitlesDefaults.m')
-rw-r--r--macosx/HBSubtitlesDefaults.m29
1 files changed, 29 insertions, 0 deletions
diff --git a/macosx/HBSubtitlesDefaults.m b/macosx/HBSubtitlesDefaults.m
index 544123de1..efcd49c8d 100644
--- a/macosx/HBSubtitlesDefaults.m
+++ b/macosx/HBSubtitlesDefaults.m
@@ -5,6 +5,7 @@
It may be used under the terms of the GNU General Public License. */
#import "HBSubtitlesDefaults.h"
+#import "NSCodingMacro.h"
@implementation HBSubtitlesDefaults
@@ -59,6 +60,34 @@
preset[@"SubtitleAddForeignAudioSubtitle"] = @(self.addForeignAudioSubtitle);
}
+#pragma mark - NSCoding
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeInt:1 forKey:@"HBAudioDefaultsVersion"];
+
+ encodeInteger(_trackSelectionBehavior);
+ encodeObject(_trackSelectionLanguages);
+
+ encodeBool(_addForeignAudioSearch);
+ encodeBool(_addForeignAudioSubtitle);
+ encodeBool(_addCC);
+}
+
+- (id)initWithCoder:(NSCoder *)decoder
+{
+ self = [super init];
+
+ decodeInteger(_trackSelectionBehavior);
+ decodeObject(_trackSelectionLanguages);
+
+ decodeBool(_addForeignAudioSearch);
+ decodeBool(_addForeignAudioSubtitle);
+ decodeBool(_addCC);
+
+ return self;
+}
+
- (void)dealloc
{
[_trackSelectionLanguages release];