diff options
author | Damiano Galassi <[email protected]> | 2019-08-13 10:27:05 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-08-13 10:27:05 +0200 |
commit | f2a619679551fd988c4e28bf68108f174d64fb3d (patch) | |
tree | 3b7b294d44d5afd20a864c2b9d2f3676f7a4749a /macosx/HBAudio.m | |
parent | 5b3c3c620855130c7bcd47685ad69a765e0cfd7b (diff) |
MacGui: convert the last usage of NSDictionary to a proper class, fix external subtitles tracks when sandboxed. Add initial support to the model to store the track title.
Diffstat (limited to 'macosx/HBAudio.m')
-rw-r--r-- | macosx/HBAudio.m | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m index 093d70dff..f6427b8db 100644 --- a/macosx/HBAudio.m +++ b/macosx/HBAudio.m @@ -44,8 +44,8 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio _defaults = [[HBAudioDefaults alloc] init]; // Add the none and foreign track to the source array - NSMutableArray *sourceTracks = [job.title.audioTracks mutableCopy]; - NSDictionary *none = @{keyAudioTrackName: HBKitLocalizedString(@"None", @"HBAudio -> none track name")}; + NSMutableArray<HBTitleAudioTrack *> *sourceTracks = [job.title.audioTracks mutableCopy]; + HBTitleAudioTrack *none = [[HBTitleAudioTrack alloc] initWithDisplayName:HBKitLocalizedString(@"None", @"HBAudio -> none track name")]; [sourceTracks insertObject:none atIndex:0]; _sourceTracks = [sourceTracks copy]; } @@ -54,18 +54,18 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio #pragma mark - Data Source -- (NSDictionary<NSString *, id> *)sourceTrackAtIndex:(NSUInteger)idx +- (HBTitleAudioTrack *)sourceTrackAtIndex:(NSUInteger)idx { return self.sourceTracks[idx]; } - (NSArray<NSString *> *)sourceTracksArray { - NSMutableArray *sourceNames = [NSMutableArray array]; + NSMutableArray<NSString *> *sourceNames = [NSMutableArray array]; - for (NSDictionary *track in self.sourceTracks) + for (HBTitleAudioTrack *track in self.sourceTracks) { - [sourceNames addObject:track[keyAudioTrackName]]; + [sourceNames addObject:track.displayName]; } return sourceNames; @@ -278,7 +278,7 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio self = [super init]; decodeInt(_container); if (_container != HB_MUX_MP4 && _container != HB_MUX_MKV && _container != HB_MUX_WEBM) { goto fail; } - decodeCollectionOfObjects3(_sourceTracks, NSArray, NSDictionary, NSString, NSNumber); + decodeCollectionOfObjects(_sourceTracks, NSArray, HBTitleAudioTrack); decodeCollectionOfObjects(_tracks, NSMutableArray, HBAudioTrack); for (HBAudioTrack *track in _tracks) |