summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesDefaults.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-22 07:55:39 +0000
committerritsuka <[email protected]>2014-12-22 07:55:39 +0000
commita052152ebb5b1844ca76ca65b1fed359307e8ad4 (patch)
treedf12b6ae8d8e02c3aa9f835d4f828bea00501607 /macosx/HBSubtitlesDefaults.m
parent546f57a1402492f2aedeab1ca6cf9f3d3201795f (diff)
MacGui: implement NSCoding protocol in HBJob.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6638 b64f7644-9d1e-0410-96f1-a4d463321fa5
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];