diff --git a/Audio/CogAudio.xcodeproj/project.pbxproj b/Audio/CogAudio.xcodeproj/project.pbxproj index 6d26bbe47..baf536799 100644 --- a/Audio/CogAudio.xcodeproj/project.pbxproj +++ b/Audio/CogAudio.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 17F94DD60B8D0F7000A34E87 /* PluginController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17F94DD40B8D0F7000A34E87 /* PluginController.m */; }; 17F94DDD0B8D101100A34E87 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F94DDC0B8D101100A34E87 /* Plugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8384912718080FF100E7332D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 8384912618080FF100E7332D /* Logging.h */; }; - 839366671815923C006DD712 /* CogDecoderMulti.h in Headers */ = {isa = PBXBuildFile; fileRef = 839366651815923C006DD712 /* CogDecoderMulti.h */; }; - 839366681815923C006DD712 /* CogDecoderMulti.m in Sources */ = {isa = PBXBuildFile; fileRef = 839366661815923C006DD712 /* CogDecoderMulti.m */; }; + 839366671815923C006DD712 /* CogPluginMulti.h in Headers */ = {isa = PBXBuildFile; fileRef = 839366651815923C006DD712 /* CogPluginMulti.h */; }; + 839366681815923C006DD712 /* CogPluginMulti.m in Sources */ = {isa = PBXBuildFile; fileRef = 839366661815923C006DD712 /* CogPluginMulti.m */; }; 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; 8E8D3D2F0CBAEE6E00135C1B /* AudioContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E8D3D2D0CBAEE6E00135C1B /* AudioContainer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8E8D3D300CBAEE6E00135C1B /* AudioContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E8D3D2E0CBAEE6E00135C1B /* AudioContainer.m */; }; @@ -109,8 +109,8 @@ 17F94DDC0B8D101100A34E87 /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = ""; }; 32DBCF5E0370ADEE00C91783 /* CogAudio_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CogAudio_Prefix.pch; sourceTree = ""; }; 8384912618080FF100E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = ""; }; - 839366651815923C006DD712 /* CogDecoderMulti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CogDecoderMulti.h; sourceTree = ""; }; - 839366661815923C006DD712 /* CogDecoderMulti.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CogDecoderMulti.m; sourceTree = ""; }; + 839366651815923C006DD712 /* CogPluginMulti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CogPluginMulti.h; sourceTree = ""; }; + 839366661815923C006DD712 /* CogPluginMulti.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CogPluginMulti.m; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* CogAudio.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CogAudio.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8E8D3D2D0CBAEE6E00135C1B /* AudioContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioContainer.h; sourceTree = ""; }; @@ -193,8 +193,8 @@ 17B6192F0B909BC300BC003F /* AudioPropertiesReader.m */, 17ADB13A0B97926D00257CA2 /* AudioSource.h */, 17ADB13B0B97926D00257CA2 /* AudioSource.m */, - 839366651815923C006DD712 /* CogDecoderMulti.h */, - 839366661815923C006DD712 /* CogDecoderMulti.m */, + 839366651815923C006DD712 /* CogPluginMulti.h */, + 839366661815923C006DD712 /* CogPluginMulti.m */, 17F94DD30B8D0F7000A34E87 /* PluginController.h */, 17F94DD40B8D0F7000A34E87 /* PluginController.m */, 17D21C750B8BE4BA00D1EBDE /* Chain */, @@ -323,7 +323,7 @@ 17A2D3C50B8D1D37000778C4 /* AudioDecoder.h in Headers */, 17C940230B900909008627D6 /* AudioMetadataReader.h in Headers */, 17B619300B909BC300BC003F /* AudioPropertiesReader.h in Headers */, - 839366671815923C006DD712 /* CogDecoderMulti.h in Headers */, + 839366671815923C006DD712 /* CogPluginMulti.h in Headers */, 17ADB13C0B97926D00257CA2 /* AudioSource.h in Headers */, 8EC1225F0B993BD500C5B3AD /* ConverterNode.h in Headers */, 8384912718080FF100E7332D /* Logging.h in Headers */, @@ -409,7 +409,7 @@ 17D21CE00B8BE5B400D1EBDE /* VirtualRingBuffer.m in Sources */, 17D21CF40B8BE5EF00D1EBDE /* Semaphore.m in Sources */, 17D21DC80B8BE79700D1EBDE /* CoreAudioUtils.m in Sources */, - 839366681815923C006DD712 /* CogDecoderMulti.m in Sources */, + 839366681815923C006DD712 /* CogPluginMulti.m in Sources */, 17D21EBE0B8BF44000D1EBDE /* AudioPlayer.m in Sources */, 17F94DD60B8D0F7000A34E87 /* PluginController.m in Sources */, 17A2D3C60B8D1D37000778C4 /* AudioDecoder.m in Sources */, diff --git a/Audio/CogDecoderMulti.h b/Audio/CogDecoderMulti.h deleted file mode 100644 index 650463ad6..000000000 --- a/Audio/CogDecoderMulti.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// CogDecoderMulti.h -// CogAudio -// -// Created by Christopher Snowhill on 10/21/13. -// -// - -#import -#import "Plugin.h" - -@interface CogDecoderMulti : NSObject { - NSArray *theDecoders; - id theDecoder; - NSMutableArray *cachedObservers; -} - --(id)initWithDecoders:(NSArray *)decoders; - -@end diff --git a/Audio/CogPluginMulti.h b/Audio/CogPluginMulti.h new file mode 100644 index 000000000..450c62eb7 --- /dev/null +++ b/Audio/CogPluginMulti.h @@ -0,0 +1,41 @@ +// +// CogPluginMulti.h +// CogAudio +// +// Created by Christopher Snowhill on 10/21/13. +// +// + +#import +#import "Plugin.h" + +@interface CogDecoderMulti : NSObject { + NSArray *theDecoders; + id theDecoder; + NSMutableArray *cachedObservers; +} + +-(id)initWithDecoders:(NSArray *)decoders; + +@end + +@interface CogContainerMulti : NSObject { +} + ++ (NSArray *)urlsForContainerURL:(NSURL *)url containers:(NSArray *)containers; + +@end + +@interface CogMetadataReaderMulti : NSObject { +} + ++ (NSDictionary *)metadataForURL:(NSURL *)url readers:(NSArray *)readers; + +@end + +@interface CogPropertiesReaderMulti : NSObject { +} + ++ (NSDictionary *)propertiesForSource:(id)source readers:(NSArray *)readers; + +@end diff --git a/Audio/CogDecoderMulti.m b/Audio/CogPluginMulti.m similarity index 57% rename from Audio/CogDecoderMulti.m rename to Audio/CogPluginMulti.m index 4d55bc9a2..743a5e511 100644 --- a/Audio/CogDecoderMulti.m +++ b/Audio/CogPluginMulti.m @@ -1,12 +1,34 @@ // -// CogDecoderMulti.m +// CogPluginMulti.m // CogAudio // // Created by Christopher Snowhill on 10/21/13. // // -#import "CogDecoderMulti.h" +#import "CogPluginMulti.h" + +NSArray * sortClassesByPriority(NSArray * theClasses) +{ + NSMutableArray *sortedClasses = [NSMutableArray arrayWithArray:theClasses]; + [sortedClasses sortUsingComparator: + ^NSComparisonResult(id obj1, id obj2) + { + NSString *classString1 = (NSString *)obj1; + NSString *classString2 = (NSString *)obj2; + + Class class1 = NSClassFromString(classString1); + Class class2 = NSClassFromString(classString2); + + float priority1 = [class1 priority]; + float priority2 = [class2 priority]; + + if (priority1 == priority2) return NSOrderedSame; + else if (priority1 > priority2) return NSOrderedAscending; + else return NSOrderedDescending; + }]; + return sortedClasses; +} @implementation CogDecoderMulti @@ -30,24 +52,7 @@ self = [super init]; if ( self ) { - NSMutableArray *sortedDecoders = [NSMutableArray arrayWithArray:decoders]; - [sortedDecoders sortUsingComparator: - ^NSComparisonResult(id obj1, id obj2) - { - NSString *classString1 = (NSString *)obj1; - NSString *classString2 = (NSString *)obj2; - - Class decoder1 = NSClassFromString(classString1); - Class decoder2 = NSClassFromString(classString2); - - float priority1 = [decoder1 priority]; - float priority2 = [decoder2 priority]; - - if (priority1 == priority2) return NSOrderedSame; - else if (priority1 > priority2) return NSOrderedAscending; - else return NSOrderedDescending; - }]; - theDecoders = sortedDecoders; + theDecoders = sortClassesByPriority(decoders); theDecoder = nil; cachedObservers = [[NSMutableArray alloc] init]; } @@ -136,3 +141,54 @@ } @end + +@implementation CogContainerMulti + ++ (NSArray *)urlsForContainerURL:(NSURL *)url containers:(NSArray *)containers +{ + NSArray * sortedContainers = sortClassesByPriority(containers); + for (NSString *classString in sortedContainers) + { + Class container = NSClassFromString(classString); + NSArray * urls = [container urlsForContainerURL:url]; + if ([urls count]) + return urls; + } + return nil; +} + +@end + +@implementation CogMetadataReaderMulti + ++ (NSDictionary *)metadataForURL:(NSURL *)url readers:(NSArray *)readers +{ + NSArray * sortedReaders = sortClassesByPriority(readers); + for (NSString *classString in sortedReaders) + { + Class reader = NSClassFromString(classString); + NSDictionary * data = [reader metadataForURL:url]; + if ([data count]) + return data; + } + return nil; +} + +@end + +@implementation CogPropertiesReaderMulti + ++ (NSDictionary *)propertiesForSource:(id)source readers:(NSArray *)readers +{ + NSArray * sortedReaders = sortClassesByPriority(readers); + for (NSString *classString in sortedReaders) + { + Class reader = NSClassFromString(classString); + NSDictionary * data = [reader propertiesForSource:source]; + if ([data count]) + return data; + } + return nil; +} + +@end diff --git a/Audio/Plugin.h b/Audio/Plugin.h index d1c5b3ddd..1bbd29d83 100644 --- a/Audio/Plugin.h +++ b/Audio/Plugin.h @@ -17,6 +17,7 @@ @protocol CogContainer + (NSArray *)fileTypes; //mp3, ogg, etc + (NSArray *)mimeTypes; ++ (float)priority; + (NSArray *)urlsForContainerURL:(NSURL *)url; @end @@ -48,6 +49,7 @@ @protocol CogMetadataReader + (NSArray *)fileTypes; + (NSArray *)mimeTypes; ++ (float)priority; + (NSDictionary *)metadataForURL:(NSURL *)url; @end @@ -60,6 +62,7 @@ @protocol CogPropertiesReader + (NSArray *)fileTypes; + (NSArray *)mimeTypes; ++ (float)priority; + (NSDictionary *)propertiesForSource:(id)source; @end diff --git a/Audio/PluginController.h b/Audio/PluginController.h index 0a69f09a9..1727c5b46 100644 --- a/Audio/PluginController.h +++ b/Audio/PluginController.h @@ -16,7 +16,7 @@ NSMutableDictionary *decodersByExtension; NSMutableDictionary *decodersByMimeType; - + BOOL configured; } diff --git a/Audio/PluginController.m b/Audio/PluginController.m index 86e7c624d..45d4df13f 100644 --- a/Audio/PluginController.m +++ b/Audio/PluginController.m @@ -1,6 +1,6 @@ #import "PluginController.h" #import "Plugin.h" -#import "CogDecoderMulti.h" +#import "CogPluginMulti.h" #import "Logging.h" @@ -45,7 +45,7 @@ static PluginController *sharedPluginController = nil; self.decodersByExtension = [[[NSMutableDictionary alloc] init] autorelease]; self.decodersByMimeType = [[[NSMutableDictionary alloc] init] autorelease]; - + [self setup]; } @@ -119,7 +119,16 @@ static PluginController *sharedPluginController = nil; if (container && [container respondsToSelector:@selector(fileTypes)]) { for (id fileType in [container fileTypes]) { - [containers setObject:className forKey:[fileType lowercaseString]]; + NSString *ext = [fileType lowercaseString]; + NSMutableArray *containerSet; + if (![containers objectForKey:ext]) + { + containerSet = [[[NSMutableArray alloc] init] autorelease]; + [containers setObject:containerSet forKey:ext]; + } + else + containerSet = [containers objectForKey:ext]; + [containerSet addObject:className]; } } } @@ -157,7 +166,16 @@ static PluginController *sharedPluginController = nil; if (metadataReader && [metadataReader respondsToSelector:@selector(fileTypes)]) { for (id fileType in [metadataReader fileTypes]) { - [metadataReaders setObject:className forKey:[fileType lowercaseString]]; + NSString *ext = [fileType lowercaseString]; + NSMutableArray *readers; + if (![metadataReaders objectForKey:ext]) + { + readers = [[[NSMutableArray alloc] init] autorelease]; + [metadataReaders setObject:readers forKey:ext]; + } + else + readers = [metadataReaders objectForKey:ext]; + [readers addObject:className]; } } } @@ -168,14 +186,23 @@ static PluginController *sharedPluginController = nil; if (propertiesReader && [propertiesReader respondsToSelector:@selector(fileTypes)]) { for (id fileType in [propertiesReader fileTypes]) { - [propertiesReadersByExtension setObject:className forKey:[fileType lowercaseString]]; + NSString *ext = [fileType lowercaseString]; + NSMutableArray *readers; + if (![propertiesReadersByExtension objectForKey:ext]) + { + readers = [[[NSMutableArray alloc] init] autorelease]; + [propertiesReadersByExtension setObject:readers forKey:ext]; + } + else + readers = [propertiesReadersByExtension objectForKey:ext]; + [readers addObject:className]; } } if (propertiesReader && [propertiesReader respondsToSelector:@selector(mimeTypes)]) { for (id mimeType in [propertiesReader mimeTypes]) { - [propertiesReadersByMimeType setObject:className forKey:[mimeType lowercaseString]]; + [propertiesReadersByMimeType setObject:className forKey:[mimeType lowercaseString]]; } } } @@ -216,8 +243,21 @@ static PluginController *sharedPluginController = nil; - (NSArray *) urlsForContainerURL:(NSURL *)url { NSString *ext = [[url path] pathExtension]; + NSArray *containerSet = [containers objectForKey:[ext lowercaseString]]; + NSString *classString; + if (containerSet) { + if ( [containerSet count] > 1 ) { + return [CogContainerMulti urlsForContainerURL:url containers:containerSet]; + } + else { + classString = [containerSet objectAtIndex:0]; + } + } + else { + return nil; + } - Class container = NSClassFromString([containers objectForKey:[ext lowercaseString]]); + Class container = NSClassFromString(classString); return [container urlsForContainerURL:url]; } @@ -248,11 +288,23 @@ static PluginController *sharedPluginController = nil; - (NSDictionary *)metadataForURL:(NSURL *)url { NSString *ext = [[url path] pathExtension]; + NSArray *readers = [metadataReaders objectForKey:[ext lowercaseString]]; + NSString *classString; + if (readers) { + if ( [readers count] > 1 ) { + return [CogMetadataReaderMulti metadataForURL:url readers:readers]; + } + else { + classString = [readers objectAtIndex:0]; + } + } + else { + return nil; + } - Class metadataReader = NSClassFromString([metadataReaders objectForKey:[ext lowercaseString]]); + Class metadataReader = NSClassFromString(classString); return [metadataReader metadataForURL:url]; - } @@ -264,11 +316,21 @@ static PluginController *sharedPluginController = nil; id source = [self audioSourceForURL:url]; if (![source open:url]) return nil; - - NSString *classString = [propertiesReadersByExtension objectForKey:[ext lowercaseString]]; - if (!classString) { - classString = [propertiesReadersByMimeType objectForKey:[[source mimeType] lowercaseString]]; - } + + NSArray *readers = [propertiesReadersByExtension objectForKey:[ext lowercaseString]]; + NSString *classString; + if (readers) + { + if ( [readers count] > 1 ) { + return [CogPropertiesReaderMulti propertiesForSource:source readers:readers]; + } + else { + classString = [readers objectAtIndex:0]; + } + } + else { + classString = [propertiesReadersByMimeType objectForKey:[[source mimeType] lowercaseString]]; + } if (classString) { diff --git a/Plugins/ArchiveSource/ArchiveSource/ArchiveContainer.m b/Plugins/ArchiveSource/ArchiveSource/ArchiveContainer.m index cd77b3c69..2aa5334f0 100644 --- a/Plugins/ArchiveSource/ArchiveSource/ArchiveContainer.m +++ b/Plugins/ArchiveSource/ArchiveSource/ArchiveContainer.m @@ -34,6 +34,11 @@ static NSString * g_make_unpack_path(NSString * archive, NSString * file, NSStri return [NSArray arrayWithObjects:@"application/zip", @"application/x-gzip", @"application/x-rar-compressed", @"application/x-7z-compressed", nil]; } ++ (float)priority +{ + return 1.0f; +} + + (void)initialize { fex_init(); diff --git a/Plugins/CueSheet/CueSheetContainer.m b/Plugins/CueSheet/CueSheetContainer.m index 5d00b7c3a..14e19bbd0 100644 --- a/Plugins/CueSheet/CueSheetContainer.m +++ b/Plugins/CueSheet/CueSheetContainer.m @@ -23,6 +23,11 @@ return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless } ++ (float)priority +{ + return 1.0f; +} + + (NSArray *)urlsForContainerURL:(NSURL *)url { if (![url isFileURL]) { diff --git a/Plugins/CueSheet/CueSheetMetadataReader.m b/Plugins/CueSheet/CueSheetMetadataReader.m index a7b43da9d..617b01182 100644 --- a/Plugins/CueSheet/CueSheetMetadataReader.m +++ b/Plugins/CueSheet/CueSheetMetadataReader.m @@ -24,6 +24,11 @@ return [CueSheetDecoder mimeTypes]; } ++ (float)priority +{ + return 1.0f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { if (![url isFileURL]) { diff --git a/Plugins/Dumb/DumbContainer.m b/Plugins/Dumb/DumbContainer.m index ba063188d..e6e3631cc 100755 --- a/Plugins/Dumb/DumbContainer.m +++ b/Plugins/Dumb/DumbContainer.m @@ -25,6 +25,11 @@ return nil; } ++ (float)priority +{ + return 1.0f; +} + struct callbackData { NSString * baseUrl; diff --git a/Plugins/Dumb/DumbMetadataReader.m b/Plugins/Dumb/DumbMetadataReader.m index 0e3fb723e..fe00c3381 100644 --- a/Plugins/Dumb/DumbMetadataReader.m +++ b/Plugins/Dumb/DumbMetadataReader.m @@ -25,6 +25,11 @@ return [DumbDecoder mimeTypes]; } ++ (float)priority +{ + return 1.0f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { id audioSourceClass = NSClassFromString(@"AudioSource"); diff --git a/Plugins/GME/GameContainer.m b/Plugins/GME/GameContainer.m index 9105a6d80..40d5d942b 100755 --- a/Plugins/GME/GameContainer.m +++ b/Plugins/GME/GameContainer.m @@ -26,6 +26,11 @@ return nil; } ++ (float)priority +{ + return 1.0f; +} + //This really should be source... + (NSArray *)urlsForContainerURL:(NSURL *)url { diff --git a/Plugins/GME/GameMetadataReader.m b/Plugins/GME/GameMetadataReader.m index 68de4e8f7..6469f39a8 100644 --- a/Plugins/GME/GameMetadataReader.m +++ b/Plugins/GME/GameMetadataReader.m @@ -26,6 +26,11 @@ return [GameDecoder mimeTypes]; } ++ (float)priority +{ + return 1.0f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { id audioSourceClass = NSClassFromString(@"AudioSource"); diff --git a/Plugins/Hively/Hively/HVLContainer.m b/Plugins/Hively/Hively/HVLContainer.m index 7f226d55c..8ee47cbc4 100755 --- a/Plugins/Hively/Hively/HVLContainer.m +++ b/Plugins/Hively/Hively/HVLContainer.m @@ -21,6 +21,11 @@ return nil; } ++ (float)priority +{ + return 1.0f; +} + + (NSArray *)urlsForContainerURL:(NSURL *)url { if ([url fragment]) { diff --git a/Plugins/Hively/Hively/HVLMetadataReader.m b/Plugins/Hively/Hively/HVLMetadataReader.m index 071fd5f1e..13e076e82 100644 --- a/Plugins/Hively/Hively/HVLMetadataReader.m +++ b/Plugins/Hively/Hively/HVLMetadataReader.m @@ -21,6 +21,11 @@ return [HVLDecoder mimeTypes]; } ++ (float)priority +{ + return 1.0f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { id audioSourceClass = NSClassFromString(@"AudioSource"); diff --git a/Plugins/M3u/M3uContainer.m b/Plugins/M3u/M3uContainer.m index dc2eeafa1..ebcfa9003 100644 --- a/Plugins/M3u/M3uContainer.m +++ b/Plugins/M3u/M3uContainer.m @@ -22,6 +22,11 @@ return [NSArray arrayWithObjects:@"audio/x-mpegurl", @"audio/mpegurl", nil]; } ++ (float)priority +{ + return 1.0f; +} + + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename { NSRange protocolRange = [path rangeOfString:@"://"]; diff --git a/Plugins/MIDI/MIDI/MIDIContainer.mm b/Plugins/MIDI/MIDI/MIDIContainer.mm index da64072db..0e791a768 100755 --- a/Plugins/MIDI/MIDI/MIDIContainer.mm +++ b/Plugins/MIDI/MIDI/MIDIContainer.mm @@ -23,6 +23,11 @@ return [MIDIDecoder mimeTypes]; } ++ (float) priority +{ + return 1.0f; +} + //This really should be source... + (NSArray *)urlsForContainerURL:(NSURL *)url { diff --git a/Plugins/MIDI/MIDI/MIDIMetadataReader.mm b/Plugins/MIDI/MIDI/MIDIMetadataReader.mm index 627cd95c8..f677593c9 100644 --- a/Plugins/MIDI/MIDI/MIDIMetadataReader.mm +++ b/Plugins/MIDI/MIDI/MIDIMetadataReader.mm @@ -24,6 +24,11 @@ return [MIDIDecoder mimeTypes]; } ++ (float)priority +{ + return 1.0f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { id audioSourceClass = NSClassFromString(@"AudioSource"); diff --git a/Plugins/Pls/PlsContainer.m b/Plugins/Pls/PlsContainer.m index 051600c79..54e126461 100644 --- a/Plugins/Pls/PlsContainer.m +++ b/Plugins/Pls/PlsContainer.m @@ -22,6 +22,11 @@ return [NSArray arrayWithObjects:@"audio/x-scpls", @"application/pls", nil]; } ++ (float)priority +{ + return 1.0f; +} + + (NSURL *)urlForPath:(NSString *)path relativeTo:(NSString *)baseFilename { NSRange protocolRange = [path rangeOfString:@"://"]; diff --git a/Plugins/TagLib/TagLibMetadataReader.m b/Plugins/TagLib/TagLibMetadataReader.m index cc6a6712a..30032d943 100644 --- a/Plugins/TagLib/TagLibMetadataReader.m +++ b/Plugins/TagLib/TagLibMetadataReader.m @@ -193,4 +193,9 @@ return [NSArray arrayWithObjects:@"audio/x-ape", @"audio/x-ms-wma", @"application/ogg", @"application/x-ogg", @"audio/x-vorbis+ogg", @"audio/x-musepack", @"audio/x-flac", @"audio/x-m4a", @"audio/mpeg", @"audio/x-mp3", @"audio/x-tak", @"audio/x-ac3", @"audio/x-apl", @"audio/x-dts", @"audio/x-dtshd", @"audio/x-tta", @"audio/wav", @"audio/aiff", nil]; } ++ (float)priority +{ + return 1.0f; +} + @end diff --git a/Plugins/sidplay/SidContainer.mm b/Plugins/sidplay/SidContainer.mm index 2f7e00405..a59c59c1d 100755 --- a/Plugins/sidplay/SidContainer.mm +++ b/Plugins/sidplay/SidContainer.mm @@ -23,6 +23,11 @@ return nil; } ++ (float)priority +{ + return 0.5f; +} + + (NSArray *)urlsForContainerURL:(NSURL *)url { if ([url fragment]) { diff --git a/Plugins/sidplay/SidMetadataReader.mm b/Plugins/sidplay/SidMetadataReader.mm index ef053bf17..fbce16337 100644 --- a/Plugins/sidplay/SidMetadataReader.mm +++ b/Plugins/sidplay/SidMetadataReader.mm @@ -23,6 +23,11 @@ return [SidDecoder mimeTypes]; } ++ (float)priority +{ + return 0.5f; +} + + (NSDictionary *)metadataForURL:(NSURL *)url { id audioSourceClass = NSClassFromString(@"AudioSource");