Updated mime-types.

CQTexperiment
vspader 2007-10-14 18:56:23 +00:00
parent 3ee193e975
commit 535e0e802f
12 changed files with 47 additions and 5 deletions

View File

@ -31,6 +31,7 @@
@protocol CogContainer <NSObject>
+ (NSArray *)fileTypes; //mp3, ogg, etc
+ (NSArray *)mimeTypes;
+ (NSArray *)urlsForContainerURL:(NSURL *)url;
@end
@ -51,6 +52,7 @@
@protocol CogMetadataReader <NSObject>
+ (NSArray *)fileTypes;
+ (NSArray *)mimeTypes;
+ (NSDictionary *)metadataForURL:(NSURL *)url;
@end

View File

@ -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]) {

View File

@ -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]) {

View File

@ -19,6 +19,11 @@
return [CueSheetDecoder fileTypes];
}
+ (NSArray *)mimeTypes
{
return [CueSheetDecoder mimeTypes];
}
+ (NSDictionary *)metadataForURL:(NSURL *)url
{
if (![url isFileURL]) {

View File

@ -18,6 +18,11 @@
return [DumbDecoder fileTypes];
}
+ (NSArray *)mimeTypes
{
return [DumbDecoder mimeTypes];
}
+ (NSDictionary *)metadataForURL:(NSURL *)url
{
if (![url isFileURL])

View File

@ -28,6 +28,11 @@
return [[types copy] autorelease];
}
+ (NSArray *)mimeTypes
{
return nil;
}
//This really should be source...
+ (NSArray *)urlsForContainerURL:(NSURL *)url
{

View File

@ -163,7 +163,7 @@ gme_err_t readCallback( void* data, void* out, long count )
+ (NSArray *)mimeTypes
{
return nil;
return [GameContainer fileTypes];
}
- (void)setSource:(id<CogSource>)s

View File

@ -19,6 +19,11 @@
return [GameContainer fileTypes];
}
+ (NSArray *)mimeTypes
{
return [GameContainer mimeTypes];
}
+ (NSDictionary *)metadataForURL:(NSURL *)url
{
if (![url isFileURL])

View File

@ -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:@"/"]) {

View File

@ -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

View File

@ -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:@"/"]) {

View File

@ -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