summaryrefslogtreecommitdiffstats
path: root/macosx/HBFilters.m
diff options
context:
space:
mode:
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