summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-09-24 16:05:45 +0200
committerDamiano Galassi <[email protected]>2019-09-24 16:05:45 +0200
commitfd1bc0c4ce651e68c4eb88d9abbbba011a95addf (patch)
tree23e56181772ca6ab256dee871b4560729b490223 /macosx
parentdd2b9aea44e61e78af36f097eb42948b91a10a81 (diff)
MacGui: show localized mixdown names in summary.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBJob+UIAdditions.m25
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];