summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesDefaults.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBSubtitlesDefaults.m')
-rw-r--r--macosx/HBSubtitlesDefaults.m24
1 files changed, 22 insertions, 2 deletions
diff --git a/macosx/HBSubtitlesDefaults.m b/macosx/HBSubtitlesDefaults.m
index efcd49c8d..359b19ea2 100644
--- a/macosx/HBSubtitlesDefaults.m
+++ b/macosx/HBSubtitlesDefaults.m
@@ -19,7 +19,7 @@
return self;
}
-- (void)applySettingsFromPreset:(NSDictionary *)preset
+- (void)applyPreset:(NSDictionary *)preset
{
if ([preset[@"SubtitleTrackSelectionBehavior"] isEqualToString:@"first"])
{
@@ -39,7 +39,7 @@
self.addForeignAudioSubtitle = [preset[@"SubtitleAddForeignAudioSubtitle"] boolValue];
}
-- (void)prepareSubtitlesDefaultsForPreset:(NSMutableDictionary *)preset
+- (void)writeToPreset:(NSMutableDictionary *)preset
{
if (self.trackSelectionBehavior == HBSubtitleTrackSelectionBehaviorFirst)
{
@@ -60,6 +60,26 @@
preset[@"SubtitleAddForeignAudioSubtitle"] = @(self.addForeignAudioSubtitle);
}
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone
+{
+ HBSubtitlesDefaults *copy = [[[self class] alloc] init];
+
+ if (copy)
+ {
+ copy->_trackSelectionBehavior = _trackSelectionBehavior;
+ [copy->_trackSelectionLanguages release];
+ copy->_trackSelectionLanguages = [_trackSelectionLanguages mutableCopy];
+
+ copy->_addForeignAudioSearch = _addForeignAudioSearch;
+ copy->_addForeignAudioSubtitle = _addForeignAudioSubtitle;
+ copy->_addCC = _addCC;
+ }
+
+ return copy;
+}
+
#pragma mark - NSCoding
- (void)encodeWithCoder:(NSCoder *)coder