diff --git a/Audio/Plugin.h b/Audio/Plugin.h index b0635065e..8be87d07d 100644 --- a/Audio/Plugin.h +++ b/Audio/Plugin.h @@ -31,6 +31,7 @@ @protocol CogContainer + (NSArray *)fileTypes; //mp3, ogg, etc ++ (NSArray *)mimeTypes; + (NSArray *)urlsForContainerURL:(NSURL *)url; @end @@ -51,6 +52,7 @@ @protocol CogMetadataReader + (NSArray *)fileTypes; ++ (NSArray *)mimeTypes; + (NSDictionary *)metadataForURL:(NSURL *)url; @end diff --git a/Plugins/CueSheet/CueSheetContainer.m b/Plugins/CueSheet/CueSheetContainer.m index 5c76cd4f0..e3b575aca 100644 --- a/Plugins/CueSheet/CueSheetContainer.m +++ b/Plugins/CueSheet/CueSheetContainer.m @@ -18,6 +18,11 @@ return [NSArray arrayWithObject:@"cue"]; } ++ (NSArray *)mimeTypes +{ + return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless +} + + (NSArray *)urlsForContainerURL:(NSURL *)url { if (![url isFileURL]) { diff --git a/Plugins/CueSheet/CueSheetDecoder.m b/Plugins/CueSheet/CueSheetDecoder.m index aca297060..f1c27239c 100644 --- a/Plugins/CueSheet/CueSheetDecoder.m +++ b/Plugins/CueSheet/CueSheetDecoder.m @@ -21,7 +21,7 @@ + (NSArray *)mimeTypes { - return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless + return [CueSheetContainer mimeTypes]; } - (NSDictionary *)properties @@ -63,7 +63,7 @@ return NO; } - decoder = [NSClassFromString(@"AudioDecoder") audioDecoderForURL:[source url]]; + decoder = [NSClassFromString(@"AudioDecoder") audioDecoderForSource:source]; [decoder retain]; if (![decoder open:source]) { diff --git a/Plugins/CueSheet/CueSheetMetadataReader.m b/Plugins/CueSheet/CueSheetMetadataReader.m index f9aa40e3d..09a5390f2 100644 --- a/Plugins/CueSheet/CueSheetMetadataReader.m +++ b/Plugins/CueSheet/CueSheetMetadataReader.m @@ -19,6 +19,11 @@ return [CueSheetDecoder fileTypes]; } ++ (NSArray *)mimeTypes +{ + return [CueSheetDecoder mimeTypes]; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { if (![url isFileURL]) { diff --git a/Plugins/Dumb/DumbMetadataReader.m b/Plugins/Dumb/DumbMetadataReader.m index 73d37c09f..e213d0fa0 100644 --- a/Plugins/Dumb/DumbMetadataReader.m +++ b/Plugins/Dumb/DumbMetadataReader.m @@ -18,6 +18,11 @@ return [DumbDecoder fileTypes]; } ++ (NSArray *)mimeTypes +{ + return [DumbDecoder mimeTypes]; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { if (![url isFileURL]) diff --git a/Plugins/GME/GameContainer.m b/Plugins/GME/GameContainer.m index debead3cc..e8deee209 100755 --- a/Plugins/GME/GameContainer.m +++ b/Plugins/GME/GameContainer.m @@ -28,6 +28,11 @@ return [[types copy] autorelease]; } ++ (NSArray *)mimeTypes +{ + return nil; +} + //This really should be source... + (NSArray *)urlsForContainerURL:(NSURL *)url { diff --git a/Plugins/GME/GameDecoder.m b/Plugins/GME/GameDecoder.m index 91db1f779..b321b9e3c 100755 --- a/Plugins/GME/GameDecoder.m +++ b/Plugins/GME/GameDecoder.m @@ -163,7 +163,7 @@ gme_err_t readCallback( void* data, void* out, long count ) + (NSArray *)mimeTypes { - return nil; + return [GameContainer fileTypes]; } - (void)setSource:(id)s diff --git a/Plugins/GME/GameMetadataReader.m b/Plugins/GME/GameMetadataReader.m index 208800bb6..78a525cd6 100644 --- a/Plugins/GME/GameMetadataReader.m +++ b/Plugins/GME/GameMetadataReader.m @@ -19,6 +19,11 @@ return [GameContainer fileTypes]; } ++ (NSArray *)mimeTypes +{ + return [GameContainer mimeTypes]; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { if (![url isFileURL]) diff --git a/Plugins/M3u/M3uContainer.m b/Plugins/M3u/M3uContainer.m index d54e9abb6..212681639 100644 --- a/Plugins/M3u/M3uContainer.m +++ b/Plugins/M3u/M3uContainer.m @@ -16,6 +16,11 @@ return [NSArray arrayWithObject:@"m3u"]; } ++ (NSArray *)mimeTypes +{ + return [NSArray arrayWithObjects:@"audio/x-mpegurl", @"audio/mpegurl", nil]; +} + + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename { if ([path hasPrefix:@"/"]) { diff --git a/Plugins/MAD/MADDecoder.m b/Plugins/MAD/MADDecoder.m index 2aa1a3954..fb7bd8d94 100644 --- a/Plugins/MAD/MADDecoder.m +++ b/Plugins/MAD/MADDecoder.m @@ -620,7 +620,7 @@ static inline signed int scale (mad_fixed_t sample) + (NSArray *)mimeTypes { - return [NSArray arrayWithObjects:@"audio/mpeg",nil]; + return [NSArray arrayWithObjects:@"audio/mpeg", @"audio/x-mp3", nil]; } @end diff --git a/Plugins/Pls/PlsContainer.m b/Plugins/Pls/PlsContainer.m index 1cdc8f8e6..bf42fb438 100644 --- a/Plugins/Pls/PlsContainer.m +++ b/Plugins/Pls/PlsContainer.m @@ -16,6 +16,11 @@ return [NSArray arrayWithObject:@"pls"]; } ++ (NSArray *)mimeTypes +{ + return [NSArray arrayWithObjects:@"audio/x-scpls", @"application/pls", nil]; +} + + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename { if ([path hasPrefix:@"/"]) { diff --git a/Plugins/TagLib/TagLibMetadataReader.m b/Plugins/TagLib/TagLibMetadataReader.m index 349e133db..db4dc2caf 100644 --- a/Plugins/TagLib/TagLibMetadataReader.m +++ b/Plugins/TagLib/TagLibMetadataReader.m @@ -74,7 +74,12 @@ + (NSArray *)fileTypes { //May be a way to get a list of supported formats - return [NSArray arrayWithObjects:@"shn",@"wv",@"ogg",@"mpc",@"flac",@"ape",@"mp3",@"m4a",nil]; + return [NSArray arrayWithObjects:@"ogg", @"mpc", @"flac", @"ape", @"mp3", nil]; +} + ++ (NSArray *)mimeTypes +{ + return [NSArray arrayWithObjects:@"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg", @"audio/x-musepack", @"audio/x-flac", @"audio/x-ape", @"audio/mpeg", @"audio/x-mp3", nil]; } @end