summaryrefslogtreecommitdiffstats
path: root/macosx/HBFilters.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/HBFilters.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/HBFilters.m')
-rw-r--r--macosx/HBFilters.m61
1 files changed, 61 insertions, 0 deletions
diff --git a/macosx/HBFilters.m b/macosx/HBFilters.m
index 4d3583daf..1d9c5893b 100644
--- a/macosx/HBFilters.m
+++ b/macosx/HBFilters.m
@@ -5,6 +5,7 @@
It may be used under the terms of the GNU General Public License. */
#import "HBFilters.h"
+#import "NSCodingMacro.h"
NSString * const HBFiltersChangedNotification = @"HBFiltersChangedNotification";
@@ -257,6 +258,66 @@ static NSDictionary *_nlmeansTunesDict;
[self postChangedNotification];
}
+#pragma mark - NSCoding
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [coder encodeInt:1 forKey:@"HBFiltersVersion"];
+
+ encodeInteger(_detelecine);
+ encodeObject(_detelecineCustomString);
+
+ encodeInteger(_deinterlace);
+ encodeObject(_deinterlaceCustomString);
+
+ encodeInteger(_decomb);
+ encodeObject(_decombCustomString);
+
+ encodeInteger(_detelecine);
+ encodeObject(_detelecineCustomString);
+
+ encodeObject(_denoise);
+ encodeObject(_denoisePreset);
+ encodeObject(_denoiseTune);
+ encodeObject(_denoiseCustomString);
+
+ encodeInteger(_deblock);
+ encodeBool(_grayscale);
+
+ encodeBool(_useDecomb);
+}
+
+- (id)initWithCoder:(NSCoder *)decoder
+{
+ self = [super init];
+
+ decodeInteger(_detelecine);
+ decodeObject(_detelecineCustomString);
+
+ decodeInteger(_deinterlace);
+ decodeObject(_deinterlaceCustomString);
+
+ decodeInteger(_decomb);
+ decodeObject(_decombCustomString);
+
+ decodeInteger(_detelecine);
+ decodeObject(_detelecineCustomString);
+
+ decodeObject(_denoise);
+ decodeObject(_denoisePreset);
+ decodeObject(_denoiseTune);
+ decodeObject(_denoiseCustomString);
+
+ decodeInteger(_deblock);
+ decodeBool(_grayscale);
+
+ decodeBool(_useDecomb);
+
+ _notificationsEnabled = YES;
+
+ return self;
+}
+
#pragma mark - Presets and queue
- (void)prepareFiltersForPreset:(NSMutableDictionary *)preset