diff options
author | ritsuka <[email protected]> | 2014-12-22 07:55:39 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-12-22 07:55:39 +0000 |
commit | a052152ebb5b1844ca76ca65b1fed359307e8ad4 (patch) | |
tree | df12b6ae8d8e02c3aa9f835d4f828bea00501607 /macosx/HBJob.m | |
parent | 546f57a1402492f2aedeab1ca6cf9f3d3201795f (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/HBJob.m')
-rw-r--r-- | macosx/HBJob.m | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/macosx/HBJob.m b/macosx/HBJob.m index 744952401..5e334bae2 100644 --- a/macosx/HBJob.m +++ b/macosx/HBJob.m @@ -11,7 +11,7 @@ #import "HBAudioController.h" #import "HBSubtitlesController.h" -#include "lang.h" +#import "NSCodingMacro.h" @implementation HBJob @@ -71,6 +71,8 @@ */ - (hb_job_t *)hb_job { + NSAssert(self.title, @"HBJob: calling hb_job without a valid title loaded"); + hb_title_t *title = self.title.hb_title; hb_job_t *job = hb_job_init(title); @@ -574,11 +576,58 @@ - (void)encodeWithCoder:(NSCoder *)coder { + [coder encodeInt:1 forKey:@"HBVideoVersion"]; + + encodeInt(_state); + + encodeObject(_fileURL); + encodeObject(_destURL); + + encodeInt(_fileFormat); + encodeBool(_mp4HttpOptimize); + encodeBool(_mp4iPodCompatible); + + encodeObject(_video); + encodeObject(_picture); + encodeObject(_filters); + + encodeObject(_audioTracks); + encodeObject(_subtitlesTracks); + + encodeBool(_chaptersEnabled); + encodeObject(_chapterNames); + + encodeObject(_audioDefaults); + encodeObject(_subtitlesDefaults); } - (id)initWithCoder:(NSCoder *)decoder { - return nil; + self = [super init]; + + decodeInt(_state); + + decodeObject(_fileURL); + decodeObject(_destURL); + + decodeInt(_fileFormat); + decodeBool(_mp4HttpOptimize); + decodeBool(_mp4iPodCompatible); + + decodeObject(_video); + decodeObject(_picture); + decodeObject(_filters); + + decodeObject(_audioTracks); + decodeObject(_subtitlesTracks); + + decodeBool(_chaptersEnabled); + decodeObject(_chapterNames); + + decodeObject(_audioDefaults); + decodeObject(_subtitlesDefaults); + + return self; } #pragma mark - NSCopying |