diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/English.lproj/Video.xib | 5 | ||||
-rw-r--r-- | macosx/HBVideo+UIAdditions.h | 2 | ||||
-rw-r--r-- | macosx/HBVideo+UIAdditions.m | 43 | ||||
-rw-r--r-- | macosx/HBVideo.m | 61 |
4 files changed, 68 insertions, 43 deletions
diff --git a/macosx/English.lproj/Video.xib b/macosx/English.lproj/Video.xib index d250e61d1..17f560460 100644 --- a/macosx/English.lproj/Video.xib +++ b/macosx/English.lproj/Video.xib @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10102" systemVersion="15E39c" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G7a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> <deployment identifier="macosx"/> <development version="6300" identifier="xcode"/> - <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10102"/> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="HBVideoController"> @@ -350,6 +350,7 @@ </textFieldCell> <connections> <binding destination="-2" name="textColor" keyPath="self.labelColor" id="S90-zY-jeW"/> + <binding destination="-2" name="value" keyPath="self.video.constantQualityLabel" id="ri5-aE-FP5"/> </connections> </textField> </subviews> diff --git a/macosx/HBVideo+UIAdditions.h b/macosx/HBVideo+UIAdditions.h index 341c633ee..beb0584b5 100644 --- a/macosx/HBVideo+UIAdditions.h +++ b/macosx/HBVideo+UIAdditions.h @@ -25,6 +25,8 @@ @property (nonatomic, readonly) NSString *unparseOptions; +@property (nonatomic, readonly) NSString *constantQualityLabel; + @property (nonatomic, readonly) double qualityMinValue; @property (nonatomic, readonly) double qualityMaxValue; diff --git a/macosx/HBVideo+UIAdditions.m b/macosx/HBVideo+UIAdditions.m index 1ca41ef0b..23419565b 100644 --- a/macosx/HBVideo+UIAdditions.m +++ b/macosx/HBVideo+UIAdditions.m @@ -19,6 +19,11 @@ #pragma mark - Possible values ++ (NSSet<NSString *> *)keyPathsForValuesAffectingEncoders +{ + return [NSSet setWithObjects:@"job.container", nil]; +} + - (NSArray *)encoders { NSMutableArray *encoders = [NSMutableArray array]; @@ -67,6 +72,11 @@ return [framerates copy]; } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingFastDecodeSupported +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (BOOL)fastDecodeSupported { const char * const *tunes = hb_video_encoder_get_tunes(self.encoder); @@ -81,12 +91,45 @@ return NO; } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingTurboTwoPassSupported +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (BOOL)turboTwoPassSupported { return ((self.encoder & HB_VCODEC_X264_MASK) || (self.encoder & HB_VCODEC_X265_MASK)); } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingConstantQualityLabel +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + +- (NSString *)constantQualityLabel +{ + if ((self.encoder & HB_VCODEC_X264_MASK) || + (self.encoder & HB_VCODEC_X265_MASK)) + { + return @"RF:"; + } + else if (self.encoder == HB_VCODEC_FFMPEG_VP8) + { + return @"CQ:"; + } + else + { + return @"QP:"; + } +} + ++ (NSSet<NSString *> *)keyPathsForValuesAffectingUnparseOptions +{ + return [NSSet setWithObjects:@"encoder", @"preset", @"tune", @"profile", @"level", + @"videoOptionExtra", @"fastDecode", @"job.picture.width", @"job.picture.height", nil]; +} + /** * This is called everytime a x264 widget in the video tab is changed to * display the expanded options in a text field via outlet fDisplayX264PresetsUnparseTextField diff --git a/macosx/HBVideo.m b/macosx/HBVideo.m index df4c98a99..6a1bdf5fb 100644 --- a/macosx/HBVideo.m +++ b/macosx/HBVideo.m @@ -308,47 +308,6 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; } } -+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key -{ - NSSet *retval = nil; - - // Tell KVO to reload the presets settings - // after a change to the encoder. - if ([key isEqualToString:@"presets"] || - [key isEqualToString:@"tunes"] || - [key isEqualToString:@"profiles"] || - [key isEqualToString:@"levels"]) - { - retval = [NSSet setWithObjects:@"encoder", nil]; - } - - // Tell KVO to reload the x264 unparse string - // after values changes. - else if ([key isEqualToString:@"unparseOptions"]) - { - retval = [NSSet setWithObjects:@"encoder", @"preset", @"tune", @"profile", @"level", - @"videoOptionExtra", @"fastDecode", @"job.picture.width", @"job.picture.height", nil]; - } - - else if ([key isEqualToString:@"encoders"]) - { - retval = [NSSet setWithObjects:@"job.container", nil]; - } - - else if ([key isEqualToString:@"fastDecodeSupported"] || - [key isEqualToString:@"turboTwoPassSupported"]) - { - retval = [NSSet setWithObjects:@"encoder", nil]; - } - - else - { - retval = [NSSet set]; - } - - return retval; -} - - (void)setNilValueForKey:(NSString *)key { [self setValue:@0 forKey:key]; @@ -356,6 +315,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; #pragma mark - ++ (NSSet<NSString *> *)keyPathsForValuesAffectingPresets +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (NSArray *)presets { NSMutableArray *temp = [NSMutableArray array]; @@ -373,6 +337,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; return [temp copy]; } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingTunes +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (NSArray *)tunes { NSMutableArray *temp = [NSMutableArray array]; @@ -393,6 +362,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; return [temp copy]; } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingProfiles +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (NSArray *)profiles { NSMutableArray *temp = [NSMutableArray array]; @@ -410,6 +384,11 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification"; return [temp copy]; } ++ (NSSet<NSString *> *)keyPathsForValuesAffectingLevels +{ + return [NSSet setWithObjects:@"encoder", nil]; +} + - (NSArray *)levels { NSMutableArray *temp = [NSMutableArray array]; |