Use the iso639_2 to store the language in MP42Track.
This commit is contained in:
1 parent
4ea4fa3d19
commit
d503c045fb
5 files changed
+14
-10
No files matched your search
@@ -10,6 +10,7 @@
|
||||
#import "SBMediaTagsController.h"
|
||||
|
||||
#import <MP42Foundation/MP42File.h>
|
||||
#import <MP42Foundation/MP42Languages.h>
|
||||
|
||||
@implementation SBSoundViewController
|
||||
{
|
||||
@@ -54,7 +55,7 @@
|
||||
NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@",
|
||||
fileTrack.trackId ? [NSString stringWithFormat:@"%d", fileTrack.trackId] : @"na",
|
||||
fileTrack.name,
|
||||
fileTrack.language]
|
||||
[MP42Languages langForISO_639_2Code:fileTrack.language]]
|
||||
action:@selector(setFallbackTrack:)
|
||||
keyEquivalent:@""];
|
||||
newItem.target = self;
|
||||
@@ -84,7 +85,7 @@
|
||||
NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@",
|
||||
fileTrack.trackId ? [NSString stringWithFormat:@"%d", fileTrack.trackId] : @"na",
|
||||
fileTrack.name,
|
||||
fileTrack.language]
|
||||
[MP42Languages langForISO_639_2Code:fileTrack.language]]
|
||||
action:@selector(setFollowsTrack:)
|
||||
keyEquivalent:@""];
|
||||
newItem.target = self;
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
|
||||
#import "SBVideoViewController.h"
|
||||
#import "SBMediaTagsController.h"
|
||||
|
||||
#import <MP42Foundation/MP42File.h>
|
||||
#import <MP42Foundation/MP42Languages.h>
|
||||
|
||||
@interface SBVideoViewController ()
|
||||
|
||||
@@ -126,7 +128,7 @@ static NSString *getLevelName(uint8_t level) {
|
||||
[alternateGroup selectItemAtIndex:(NSInteger)track.alternate_group];
|
||||
|
||||
if (track.format == kMP42VideoCodecType_H264 && track.origProfile && track.origLevel) {
|
||||
profileLevelUnchanged.title = [NSString stringWithFormat:@"Current profile: %@ @ %@",
|
||||
profileLevelUnchanged.title = [NSString stringWithFormat:@"%@ %@ @ %@", NSLocalizedString(@"Current profile:", nil),
|
||||
getProfileName(track.origProfile), getLevelName(track.origLevel)];
|
||||
if ((track.origProfile == track.newProfile) && (track.origLevel == track.newLevel)) {
|
||||
[videoProfile selectItemWithTag:1];
|
||||
@@ -165,7 +167,7 @@ static NSString *getLevelName(uint8_t level) {
|
||||
NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%@ - %@ - %@",
|
||||
fileTrack.trackId ? [NSString stringWithFormat:@"%d", fileTrack.trackId] : @"NA",
|
||||
fileTrack.name,
|
||||
fileTrack.language]
|
||||
[MP42Languages langForISO_639_2Code:fileTrack.language]]
|
||||
action:@selector(setForcedTrack:)
|
||||
keyEquivalent:@""];
|
||||
newItem.target = self;
|
||||
|
||||
@@ -571,7 +571,7 @@ static NSDictionary *_detailMonospacedAttr;
|
||||
}
|
||||
else if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) {
|
||||
SBComboBoxCellView *comboCell = [tableView makeViewWithIdentifier:@"ComboCell" owner:self];
|
||||
comboCell.comboBox.stringValue = track.language;
|
||||
comboCell.comboBox.stringValue = [MP42Languages langForISO_639_2Code:track.language];
|
||||
cell = comboCell;
|
||||
}
|
||||
}
|
||||
@@ -633,7 +633,7 @@ static NSDictionary *_detailMonospacedAttr;
|
||||
MP42Track *track = [self trackAtAtTableRow:row];
|
||||
|
||||
if (track && ![sender.stringValue isEqualToString:track.name]) {
|
||||
track.language = sender.stringValue;
|
||||
track.language = [MP42Languages ISO_639_2CodeForLang:sender.stringValue];
|
||||
[self updateChangeCount:NSChangeDone];
|
||||
}
|
||||
}
|
||||
@@ -648,9 +648,9 @@ static NSDictionary *_detailMonospacedAttr;
|
||||
return row - 1;
|
||||
}
|
||||
|
||||
- (MP42Track *)trackAtAtTableRow:(NSUInteger)row
|
||||
- (MP42Track *)trackAtAtTableRow:(NSInteger)row
|
||||
{
|
||||
if (row == 0) {
|
||||
if (row <= 0) {
|
||||
return nil;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#import <MP42Foundation/MP42File.h>
|
||||
#import <MP42Foundation/MP42FileImporter.h>
|
||||
#import <MP42Foundation/MP42Utilities.h>
|
||||
#import <MP42Foundation/MP42Languages.h>
|
||||
|
||||
@interface SBFileImport () <NSTableViewDelegate>
|
||||
{
|
||||
@@ -347,7 +348,7 @@
|
||||
}
|
||||
|
||||
if ([tableColumn.identifier isEqualToString:@"trackLanguage"]) {
|
||||
return track.language;
|
||||
return [MP42Languages langForISO_639_2Code:track.language];
|
||||
}
|
||||
|
||||
if ([tableColumn.identifier isEqualToString:@"trackAction"]) {
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
|
||||
- (void)runAction:(SBQueueItem *)item {
|
||||
for (MP42Track *track in item.mp4File.tracks) {
|
||||
if ([track.language isEqualToString:@"Unknown"]) {
|
||||
if ([track.language isEqualToString:@"und"]) {
|
||||
track.language = self.language;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user