summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesDefaults.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-02-17 17:30:34 +0000
committerritsuka <[email protected]>2015-02-17 17:30:34 +0000
commitbed344976b3757dd3b6ac4fa4e7b3589b0f9f6cb (patch)
tree65225d81c2f3730753e9684b7dadad370cf78b4b /macosx/HBSubtitlesDefaults.m
parenta5dbf52da865d7de0fc721744212a324a4391e08 (diff)
MacGui: add Burn-In options to subtitle defaults hopefully similar to the LinGui.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6916 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBSubtitlesDefaults.m')
-rw-r--r--macosx/HBSubtitlesDefaults.m58
1 files changed, 56 insertions, 2 deletions
diff --git a/macosx/HBSubtitlesDefaults.m b/macosx/HBSubtitlesDefaults.m
index 359b19ea2..02d9cc345 100644
--- a/macosx/HBSubtitlesDefaults.m
+++ b/macosx/HBSubtitlesDefaults.m
@@ -37,6 +37,28 @@
self.addCC = [preset[@"SubtitleAddCC"] boolValue];
self.addForeignAudioSearch = [preset[@"SubtitleAddForeignAudioSearch"] boolValue];
self.addForeignAudioSubtitle = [preset[@"SubtitleAddForeignAudioSubtitle"] boolValue];
+
+ NSString *burnInBehavior = preset[@"SubtitleBurnBehavior"];
+
+ if ([burnInBehavior isEqualToString:@"foreign"])
+ {
+ self.burnInBehavior = HBSubtitleTrackBurnInBehaviorForeignAudio;
+ }
+ else if ([burnInBehavior isEqualToString:@"fist"])
+ {
+ self.burnInBehavior = HBSubtitleTrackBurnInBehaviorFirst;
+ }
+ else if ([burnInBehavior isEqualToString:@"foreign_first"])
+ {
+ self.burnInBehavior = HBSubtitleTrackBurnInBehaviorForeignAudioThenFirst;
+ }
+ else
+ {
+ self.burnInBehavior = HBSubtitleTrackBurnInBehaviorNone;
+ }
+
+ self.burnInDVDSubtitles = [preset[@"SubtitleBurnDVDSub"] boolValue];
+ self.burnInBluraySubtitles = [preset[@"SubtitleBurnBDSub"] boolValue];
}
- (void)writeToPreset:(NSMutableDictionary *)preset
@@ -58,6 +80,26 @@
preset[@"SubtitleAddCC"] = @(self.addCC);
preset[@"SubtitleAddForeignAudioSearch"] = @(self.addForeignAudioSearch);
preset[@"SubtitleAddForeignAudioSubtitle"] = @(self.addForeignAudioSubtitle);
+
+ if (self.burnInBehavior == HBSubtitleTrackBurnInBehaviorForeignAudio)
+ {
+ preset[@"SubtitleBurnBehavior"] = @"foreign";
+ }
+ else if (self.burnInBehavior == HBSubtitleTrackBurnInBehaviorFirst)
+ {
+ preset[@"SubtitleBurnBehavior"] = @"fist";
+ }
+ else if (self.burnInBehavior == HBSubtitleTrackBurnInBehaviorForeignAudioThenFirst)
+ {
+ preset[@"SubtitleBurnBehavior"] = @"foreign_first";
+ }
+ else
+ {
+ preset[@"SubtitleBurnBehavior"] = @"none";
+ }
+
+ preset[@"SubtitleBurnDVDSub"] = @(self.burnInDVDSubtitles);
+ preset[@"SubtitleBurnBDSub"] = @(self.burnInBluraySubtitles);
}
#pragma mark - NSCopying
@@ -75,8 +117,12 @@
copy->_addForeignAudioSearch = _addForeignAudioSearch;
copy->_addForeignAudioSubtitle = _addForeignAudioSubtitle;
copy->_addCC = _addCC;
+
+ copy->_burnInBehavior = _burnInBehavior;
+ copy->_burnInDVDSubtitles = _burnInDVDSubtitles;
+ copy->_burnInBluraySubtitles = _burnInBluraySubtitles;
}
-
+
return copy;
}
@@ -84,7 +130,7 @@
- (void)encodeWithCoder:(NSCoder *)coder
{
- [coder encodeInt:1 forKey:@"HBAudioDefaultsVersion"];
+ [coder encodeInt:1 forKey:@"HBSubtitlesDefaultsVersion"];
encodeInteger(_trackSelectionBehavior);
encodeObject(_trackSelectionLanguages);
@@ -92,6 +138,10 @@
encodeBool(_addForeignAudioSearch);
encodeBool(_addForeignAudioSubtitle);
encodeBool(_addCC);
+
+ encodeInteger(_burnInBehavior);
+ encodeBool(_burnInDVDSubtitles);
+ encodeBool(_burnInBluraySubtitles);
}
- (id)initWithCoder:(NSCoder *)decoder
@@ -105,6 +155,10 @@
decodeBool(_addForeignAudioSubtitle);
decodeBool(_addCC);
+ decodeInteger(_burnInBehavior);
+ decodeBool(_burnInDVDSubtitles);
+ decodeBool(_burnInBluraySubtitles);
+
return self;
}