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

View File

@ -18,6 +18,11 @@
return [NSArray arrayWithObject:@"cue"]; return [NSArray arrayWithObject:@"cue"];
} }
+ (NSArray *)mimeTypes
{
return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless
}
+ (NSArray *)urlsForContainerURL:(NSURL *)url + (NSArray *)urlsForContainerURL:(NSURL *)url
{ {
if (![url isFileURL]) { if (![url isFileURL]) {

View File

@ -21,7 +21,7 @@
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless return [CueSheetContainer mimeTypes];
} }
- (NSDictionary *)properties - (NSDictionary *)properties
@ -63,7 +63,7 @@
return NO; return NO;
} }
decoder = [NSClassFromString(@"AudioDecoder") audioDecoderForURL:[source url]]; decoder = [NSClassFromString(@"AudioDecoder") audioDecoderForSource:source];
[decoder retain]; [decoder retain];
if (![decoder open:source]) { if (![decoder open:source]) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,6 +16,11 @@
return [NSArray arrayWithObject:@"m3u"]; return [NSArray arrayWithObject:@"m3u"];
} }
+ (NSArray *)mimeTypes
{
return [NSArray arrayWithObjects:@"audio/x-mpegurl", @"audio/mpegurl", nil];
}
+ (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename
{ {
if ([path hasPrefix:@"/"]) { if ([path hasPrefix:@"/"]) {

View File

@ -620,7 +620,7 @@ static inline signed int scale (mad_fixed_t sample)
+ (NSArray *)mimeTypes + (NSArray *)mimeTypes
{ {
return [NSArray arrayWithObjects:@"audio/mpeg",nil]; return [NSArray arrayWithObjects:@"audio/mpeg", @"audio/x-mp3", nil];
} }
@end @end

View File

@ -16,6 +16,11 @@
return [NSArray arrayWithObject:@"pls"]; return [NSArray arrayWithObject:@"pls"];
} }
+ (NSArray *)mimeTypes
{
return [NSArray arrayWithObjects:@"audio/x-scpls", @"application/pls", nil];
}
+ (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename
{ {
if ([path hasPrefix:@"/"]) { if ([path hasPrefix:@"/"]) {

View File

@ -74,7 +74,12 @@
+ (NSArray *)fileTypes + (NSArray *)fileTypes
{ {
//May be a way to get a list of supported formats //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 @end