diff options
author | ritsuka <[email protected]> | 2014-12-23 10:23:59 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-12-23 10:23:59 +0000 |
commit | a66b692e29674de9c444fd54f0493d03b4900abc (patch) | |
tree | 1356eec981d0542ad6ca9087794e7cc52a09c664 /macosx/HBAudioTrackPreset.m | |
parent | ee10e1fdb417c7f1047406522379c85c47143bfd (diff) |
MacGui: move the UI helper methods to new categories. Implement NSCoding in more classes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6643 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBAudioTrackPreset.m')
-rw-r--r-- | macosx/HBAudioTrackPreset.m | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/macosx/HBAudioTrackPreset.m b/macosx/HBAudioTrackPreset.m index 7a0f4d39d..7d5cc2e90 100644 --- a/macosx/HBAudioTrackPreset.m +++ b/macosx/HBAudioTrackPreset.m @@ -7,6 +7,7 @@ // #import "HBAudioTrackPreset.h" +#import "NSCodingMacro.h" #include "hb.h" #define DEFAULT_SAMPLERATE 48000 @@ -216,6 +217,36 @@ static void *HBAudioEncoderContex = &HBAudioEncoderContex; return retval; } +#pragma mark - NSCoding + +- (void)encodeWithCoder:(NSCoder *)coder +{ + [coder encodeInt:1 forKey:@"HBAudioTrackPresetVersion"]; + + encodeInt(_encoder); + encodeInt(_mixdown); + encodeInt(_sampleRate); + encodeInt(_bitRate); + + encodeInt(_gain); + encodeDouble(_drc); +} + +- (id)initWithCoder:(NSCoder *)decoder +{ + self = [super init]; + + decodeInt(_encoder); + decodeInt(_mixdown); + decodeInt(_sampleRate); + decodeInt(_bitRate); + + decodeInt(_gain); + decodeDouble(_drc); + + return self; +} + @end #pragma mark - Value Trasformers |