Fix the formatSummary after the conversion settings changes.
This commit is contained in:
1 parent
815119bccb
commit
523399be1b
2 files changed
+21
-3
No files matched your search
+14
-1
@@ -227,7 +227,20 @@
|
|||||||
|
|
||||||
- (NSString *)formatSummary
|
- (NSString *)formatSummary
|
||||||
{
|
{
|
||||||
return [NSString stringWithFormat:@"%@, %u ch", localizedDisplayName(self.mediaType, self.format), (unsigned int)_channels];
|
if (self.conversionSettings && [self.conversionSettings isKindOfClass:[MP42AudioConversionSettings class]]) {
|
||||||
|
MP42AudioConversionSettings *settings = (MP42AudioConversionSettings *)self.conversionSettings;
|
||||||
|
unsigned int channels = _channels;
|
||||||
|
if ([settings.mixDown isEqualToString:SBMonoMixdown]) {
|
||||||
|
channels = 1;
|
||||||
|
}
|
||||||
|
else if (![settings.mixDown isEqualToString:SBNoneMixdown]) {
|
||||||
|
channels = 2;
|
||||||
|
}
|
||||||
|
return [NSString stringWithFormat:@"%@, %u ch", localizedDisplayName(self.mediaType, self.conversionSettings.format), channels];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [NSString stringWithFormat:@"%@, %u ch", localizedDisplayName(self.mediaType, self.format), (unsigned int)_channels];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
|
|||||||
+7
-2
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
- (instancetype)initWithFormat:(FourCharCode)format mediaType:(MP42MediaType)mediaType enabled:(BOOL)enabled language:(NSString *)language
|
- (instancetype)initWithFormat:(FourCharCode)format mediaType:(MP42MediaType)mediaType enabled:(BOOL)enabled language:(NSString *)language
|
||||||
{
|
{
|
||||||
self = [self init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
_format = format;
|
_format = format;
|
||||||
_mediaType = mediaType;
|
_mediaType = mediaType;
|
||||||
@@ -370,7 +370,12 @@
|
|||||||
|
|
||||||
- (NSString *)formatSummary
|
- (NSString *)formatSummary
|
||||||
{
|
{
|
||||||
return localizedDisplayName(_mediaType, _format);
|
if (self.conversionSettings) {
|
||||||
|
return localizedDisplayName(_mediaType, self.conversionSettings.format);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return localizedDisplayName(_mediaType, _format);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - NSSecureCoding
|
#pragma mark - NSSecureCoding
|
||||||
|
|||||||
Reference in new issue
Block a user