diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBJob+UIAdditions.m | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/macosx/HBJob+UIAdditions.m b/macosx/HBJob+UIAdditions.m index ebdf3e374..d6a9499b9 100644 --- a/macosx/HBJob+UIAdditions.m +++ b/macosx/HBJob+UIAdditions.m @@ -18,6 +18,7 @@ #import "HBPicture+UIAdditions.h" #import "HBFilters+UIAdditions.h" +#import "HBAudioTransformers.h" #import "HBLocalizationUtilities.h" #include "handbrake/handbrake.h" @@ -26,6 +27,7 @@ static NSDictionary *detailAttr; static NSDictionary *detailBoldAttr; static NSDictionary *shortHeightAttr; +static HBMixdownTransformer *mixdownTransformer; @implementation HBJob (UIAdditions) @@ -115,6 +117,14 @@ static NSDictionary *shortHeightAttr; } } +- (void)initTransformers +{ + if (!mixdownTransformer) + { + mixdownTransformer = [[HBMixdownTransformer alloc] init]; + } +} + - (NSString *)rangeDescription { // Range type @@ -539,11 +549,13 @@ static NSDictionary *shortHeightAttr; self.audio.sourceTracks[audioTrack.sourceTrackIdx].displayName, @(hb_audio_encoder_get_name(audioTrack.encoder))]; - if ((audioTrack.encoder & HB_ACODEC_PASS_FLAG) == 0) + if ((audioTrack.encoder & HB_ACODEC_PASS_FLAG) == 0) { + NSString *mixdown = [mixdownTransformer transformedValue:@(audioTrack.mixdown)]; + [detailString appendString:@", "]; [detailString appendFormat:HBKitLocalizedString(@"Mixdown: %@, Samplerate: %@, Bitrate: %d kbps", @"Audio description"), - @(hb_mixdown_get_name(audioTrack.mixdown)), + mixdown, audioTrack.sampleRate ? [NSString stringWithFormat:@"%@ khz", @(hb_audio_samplerate_get_name(audioTrack.sampleRate))] : @"Auto", audioTrack.bitRate]; @@ -633,6 +645,7 @@ static NSDictionary *shortHeightAttr; { NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] init]; [self initStyles]; + [self initTransformers]; @autoreleasepool { @@ -739,13 +752,13 @@ static NSDictionary *shortHeightAttr; [info appendString:@(encoder)]; } - if ((audioTrack.encoder & HB_ACODEC_PASS_FLAG) == 0) + if ((audioTrack.encoder & HB_ACODEC_PASS_FLAG) == 0) { - const char *mixdown = hb_mixdown_get_name(audioTrack.mixdown); + NSString *mixdown = [mixdownTransformer transformedValue:@(audioTrack.mixdown)]; if (mixdown) { [info appendString:@", "]; - [info appendString:@(mixdown)]; + [info appendString:mixdown]; } } @@ -831,6 +844,8 @@ static NSDictionary *shortHeightAttr; { NSMutableString *info = [NSMutableString string]; + [self initTransformers]; + [info appendString:[self videoShortDescription]]; NSString *audioInfo = [self audioShortDescription]; |