Implements the localised media names.
This commit is contained in:
1 parent
1c562a65ea
commit
1310202592
13 files changed
+486
-239
No files matched your search
+366
-66
@@ -6,7 +6,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42MediaFormat.h"
|
||||
|
||||
// File Type
|
||||
NSString *const MP42FileTypeMP4 = @"mp4";
|
||||
@@ -15,73 +15,373 @@ NSString *const MP42FileTypeM4A = @"m4a";
|
||||
NSString *const MP42FileTypeM4B = @"m4b";
|
||||
NSString *const MP42FileTypeM4R = @"m4r";
|
||||
|
||||
|
||||
// Media Type
|
||||
NSString *const MP42MediaTypeVideo = @"Video Track";
|
||||
NSString *const MP42MediaTypeAudio = @"Sound Track";
|
||||
NSString *const MP42MediaTypeText = @"Text Track";
|
||||
NSString *const MP42MediaTypeClosedCaption = @"Closed Caption Track";
|
||||
NSString *const MP42MediaTypeSubtitle = @"Subtitle Track";
|
||||
NSString *const MP42MediaTypeTimecode = @"TimeCode Track";
|
||||
|
||||
|
||||
// Video Format
|
||||
NSString *const MP42VideoFormatH265 = @"H.265";
|
||||
NSString *const MP42VideoFormatH264 = @"H.264";
|
||||
NSString *const MP42VideoFormatMPEG4Visual = @"MPEG-4 Visual";
|
||||
NSString *const MP42VideoFormatSorenson = @"Sorenson Video";
|
||||
NSString *const MP42VideoFormatSorenson3 = @"Sorenson Video 3";
|
||||
NSString *const MP42VideoFormatMPEG1 = @"MPEG-1";
|
||||
NSString *const MP42VideoFormatMPEG2 = @"MPEG-2";
|
||||
NSString *const MP42VideoFormatDV = @"DV";
|
||||
NSString *const MP42VideoFormatPNG = @"PNG";
|
||||
NSString *const MP42VideoFormatAnimation = @"Animation";
|
||||
NSString *const MP42VideoFormatProRes = @"Apple ProRes";
|
||||
NSString *const MP42VideoFormatJPEG = @"Photo-JPEG";
|
||||
NSString *const MP42VideoFormatMotionJPEG = @"Motion JPEG";
|
||||
NSString *const MP42VideoFormatFairPlay = @"FairPlay Video";
|
||||
|
||||
|
||||
// Audio Format
|
||||
NSString *const MP42AudioFormatAAC = @"AAC";
|
||||
NSString *const MP42AudioFormatHEAAC = @"HE-AAC";
|
||||
NSString *const MP42AudioFormatMP1 = @"MP1";
|
||||
NSString *const MP42AudioFormatMP2 = @"MP2";
|
||||
NSString *const MP42AudioFormatMP3 = @"MP3";
|
||||
NSString *const MP42AudioFormatVorbis = @"Vorbis";
|
||||
NSString *const MP42AudioFormatFLAC = @"FLAC";
|
||||
NSString *const MP42AudioFormatALAC = @"ALAC";
|
||||
NSString *const MP42AudioFormatAC3 = @"AC-3";
|
||||
NSString *const MP42AudioFormatEAC3 = @"E-AC-3";
|
||||
NSString *const MP42AudioFormatDTS = @"DTS";
|
||||
NSString *const MP42AudioFormatTrueHD = @"True HD";
|
||||
NSString *const MP42AudioFormatOpus = @"Opus";
|
||||
NSString *const MP42AudioFormatAMR = @"AMR Narrow Band";
|
||||
NSString *const MP42AudioFormatPCM = @"PCM";
|
||||
NSString *const MP42AudioFormatFairPlay = @"FairPlay Sound";
|
||||
|
||||
|
||||
// Subtitle Format
|
||||
NSString *const MP42SubtitleFormatWebVTT = @"WebVTT";
|
||||
NSString *const MP42SubtitleFormatTx3g = @"Tx3g";
|
||||
NSString *const MP42SubtitleFormatText = @"Text";
|
||||
NSString *const MP42SubtitleFormatVobSub = @"VobSub";
|
||||
NSString *const MP42SubtitleFormatPGS = @"PGS";
|
||||
NSString *const MP42SubtitleFormatSSA = @"SSA";
|
||||
NSString *const MP42SubtitleFormatFairPlay = @"FairPlay Tx3g";
|
||||
|
||||
|
||||
// Closed Caption Format
|
||||
NSString *const MP42ClosedCaptionFormatFairPlay = @"FairPlay CEA-608";
|
||||
NSString *const MP42ClosedCaptionFormatCEA608 = @"CEA-608";
|
||||
NSString *const MP42ClosedCaptionFormatCEA708 = @"CEA-708";
|
||||
|
||||
|
||||
// TimeCode Format
|
||||
NSString *const MP42TimeCodeFormat = @"TimeCode";
|
||||
|
||||
// Audio Downmixes
|
||||
NSString * const SBMonoMixdown = @"SBMonoMixdown";
|
||||
NSString * const SBStereoMixdown = @"SBStereoMixdown";
|
||||
NSString * const SBDolbyMixdown = @"SBDolbyMixdown";
|
||||
NSString * const SBDolbyPlIIMixdown = @"SBDolbyPlIIMixdown";
|
||||
|
||||
NSString *localizedMediaDisplayName(FourCharCode mediaType)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaType));
|
||||
|
||||
switch (mediaType) {
|
||||
case kMP42MediaType_Video:
|
||||
result = NSLocalizedString(@"Video Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Audio:
|
||||
result = NSLocalizedString(@"Sound Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Muxed:
|
||||
result = NSLocalizedString(@"Muxed Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Text:
|
||||
result = NSLocalizedString(@"Text Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_ClosedCaption:
|
||||
result = NSLocalizedString(@"Closed Caption Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Subtitle:
|
||||
case kMP42MediaType_Subpic:
|
||||
result = NSLocalizedString(@"Subtitle Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_TimeCode:
|
||||
result = NSLocalizedString(@"TimeCode Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Metadata:
|
||||
result = NSLocalizedString(@"Metadata Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_OD:
|
||||
result = NSLocalizedString(@"MPEG-4 ODSM Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Scene:
|
||||
result = NSLocalizedString(@"MPEG-4 SDSM Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Control:
|
||||
result = NSLocalizedString(@"MPEG-4 Control Track", nil);
|
||||
break;
|
||||
|
||||
case kMP42MediaType_Hint:
|
||||
result = NSLocalizedString(@"Hint Track", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedVideoDisplayName(FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaSubtype) {
|
||||
case kMP42VideoCodecType_Animation:
|
||||
result = NSLocalizedString(@"Animation", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_Cinepak:
|
||||
result = NSLocalizedString(@"Cinepak", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_JPEG:
|
||||
result = NSLocalizedString(@"JPEG", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_JPEG_OpenDML:
|
||||
result = NSLocalizedString(@"JPEG OpenDML", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_PNG:
|
||||
result = NSLocalizedString(@"PNG", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_H263:
|
||||
result = NSLocalizedString(@"H.263", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_H264:
|
||||
result = NSLocalizedString(@"H.264", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_HEVC:
|
||||
case kMP42VideoCodecType_HEVC_2:
|
||||
result = NSLocalizedString(@"HEVC", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_MPEG4Video:
|
||||
result = NSLocalizedString(@"MPEG-4 Visual", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_MPEG2Video:
|
||||
result = NSLocalizedString(@"MPEG-2 Video", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_MPEG1Video:
|
||||
result = NSLocalizedString(@"MPEG-1 Video", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_SorensonVideo:
|
||||
result = NSLocalizedString(@"Sorenson Video", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_SorensonVideo3:
|
||||
result = NSLocalizedString(@"Sorenson Video 3", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_Theora:
|
||||
result = NSLocalizedString(@"Theora", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_VP8:
|
||||
result = NSLocalizedString(@"VP8", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_VP9:
|
||||
result = NSLocalizedString(@"VP9", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_AppleProRes4444:
|
||||
result = NSLocalizedString(@"ProRes 4444", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_AppleProRes422HQ:
|
||||
result = NSLocalizedString(@"ProRes 422 HQ", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_AppleProRes422:
|
||||
result = NSLocalizedString(@"ProRes 422", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_AppleProRes422LT:
|
||||
result = NSLocalizedString(@"ProRes 422 LT", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_AppleProRes422Proxy:
|
||||
result = NSLocalizedString(@"ProRes 422 Proxy", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_DVCNTSC:
|
||||
result = NSLocalizedString(@"DV NTSC", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_DVCPAL:
|
||||
result = NSLocalizedString(@"DV PAL", nil);
|
||||
break;
|
||||
|
||||
case kMP42VideoCodecType_DVCProPAL:
|
||||
result = NSLocalizedString(@"DVC Pro PAL", nil);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedAudioDisplayName(FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaSubtype) {
|
||||
case kMP42AudioCodecType_MPEG4AAC:
|
||||
result = NSLocalizedString(@"AAC", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_MPEG4AAC_HE:
|
||||
result = NSLocalizedString(@"HE-AAC", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_MPEGLayer1:
|
||||
result = NSLocalizedString(@"MP1", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_MPEGLayer2:
|
||||
result = NSLocalizedString(@"MP2", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_MPEGLayer3:
|
||||
result = NSLocalizedString(@"Vorbis", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_FLAC:
|
||||
result = NSLocalizedString(@"FLAC", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_AppleLossless:
|
||||
result = NSLocalizedString(@"Apple Loseless", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_AC3:
|
||||
result = NSLocalizedString(@"AC-3", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_EnhancedAC3:
|
||||
result = NSLocalizedString(@"Enhanced AC-3", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_DTS:
|
||||
result = NSLocalizedString(@"DTS", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_TrueHD:
|
||||
result = NSLocalizedString(@"True HD", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_Opus:
|
||||
result = NSLocalizedString(@"Opus", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_TTA:
|
||||
result = NSLocalizedString(@"True Audio", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_FairPlay:
|
||||
result = NSLocalizedString(@"FairPlay Sound", nil);
|
||||
break;
|
||||
|
||||
case kMP42AudioCodecType_LinearPCM:
|
||||
result = NSLocalizedString(@"PCM", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedSubtitlesDisplayName(FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaSubtype) {
|
||||
case kMP42SubtitleCodecType_Text:
|
||||
result = NSLocalizedString(@"Text", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_3GText:
|
||||
result = NSLocalizedString(@"Tx3g", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_WebVTT:
|
||||
result = NSLocalizedString(@"WebVTT", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_VobSub:
|
||||
result = NSLocalizedString(@"VobSub", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_PGS:
|
||||
result = NSLocalizedString(@"PGS", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_SSA:
|
||||
result = NSLocalizedString(@"SSA", nil);
|
||||
break;
|
||||
|
||||
case kMP42SubtitleCodecType_FairPlay:
|
||||
result = NSLocalizedString(@"FairPlay Tx3g", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedClosedCaptionDisplayName(FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaSubtype) {
|
||||
case kMP42ClosedCaptionCodecType_CEA608:
|
||||
result = NSLocalizedString(@"CEA-608", nil);
|
||||
break;
|
||||
|
||||
case kMP42ClosedCaptionCodecType_CEA708:
|
||||
result = NSLocalizedString(@"CEA-708", nil);
|
||||
break;
|
||||
|
||||
case kMP42ClosedCaptionCodecType_ATSC:
|
||||
result = NSLocalizedString(@"ATSC", nil);
|
||||
break;
|
||||
|
||||
case kMP42ClosedCaptionCodecType_FairPlay:
|
||||
result = NSLocalizedString(@"FairPlay CEA-608", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedTimeCodeDisplayName(FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaSubtype) {
|
||||
case kMP42TimeCodeFormatType_TimeCode32:
|
||||
result = NSLocalizedString(@"TimeCode 32", nil);
|
||||
break;
|
||||
|
||||
case kMP42TimeCodeFormatType_TimeCode64:
|
||||
result = NSLocalizedString(@"TimeCode 64", nil);
|
||||
break;
|
||||
|
||||
case kCMP42TimeCodeFormatType_Counter32:
|
||||
result = NSLocalizedString(@"Counter 32", nil);
|
||||
break;
|
||||
|
||||
case kMP42TimeCodeFormatType_Counter64:
|
||||
result = NSLocalizedString(@"Counter 64", nil);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NSString *localizedDisplayName(FourCharCode mediaType, FourCharCode mediaSubtype)
|
||||
{
|
||||
NSString *result = @(FourCC2Str(mediaSubtype));
|
||||
|
||||
switch (mediaType) {
|
||||
case kMP42MediaType_Video:
|
||||
result = localizedVideoDisplayName(mediaSubtype);
|
||||
break;
|
||||
case kMP42MediaType_Audio:
|
||||
result = localizedAudioDisplayName(mediaSubtype);
|
||||
break;
|
||||
case kMP42MediaType_Subtitle:
|
||||
result = localizedSubtitlesDisplayName(mediaSubtype);
|
||||
break;
|
||||
case kMP42MediaType_ClosedCaption:
|
||||
result = localizedClosedCaptionDisplayName(mediaSubtype);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user