2007-10-20 15:46:39 +00:00
|
|
|
//Plugins! HOORAY!
|
2007-02-24 20:36:27 +00:00
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
@protocol CogSource <NSObject>
|
|
|
|
+ (NSArray *)schemes; //http, file, etc
|
2007-02-24 20:36:27 +00:00
|
|
|
|
2007-03-04 04:36:10 +00:00
|
|
|
- (NSURL *)url;
|
2007-10-14 17:31:20 +00:00
|
|
|
- (NSString *)mimeType;
|
2007-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
- (BOOL)open:(NSURL *)url;
|
2007-03-02 01:36:52 +00:00
|
|
|
- (BOOL)seekable;
|
|
|
|
- (BOOL)seek:(long)position whence:(int)whence;
|
|
|
|
- (long)tell;
|
|
|
|
- (int)read:(void *)buffer amount:(int)amount; //reads UP TO amount, returns amount read.
|
|
|
|
- (void)close;
|
|
|
|
@end
|
|
|
|
|
2007-10-09 01:20:46 +00:00
|
|
|
@protocol CogContainer <NSObject>
|
|
|
|
+ (NSArray *)fileTypes; //mp3, ogg, etc
|
2007-10-14 18:56:23 +00:00
|
|
|
+ (NSArray *)mimeTypes;
|
2007-10-09 01:20:46 +00:00
|
|
|
|
|
|
|
+ (NSArray *)urlsForContainerURL:(NSURL *)url;
|
|
|
|
@end
|
|
|
|
|
2007-03-03 17:19:37 +00:00
|
|
|
@protocol CogDecoder <NSObject>
|
2007-11-24 20:16:27 +00:00
|
|
|
@required
|
2007-10-14 17:31:20 +00:00
|
|
|
+ (NSArray *)mimeTypes;
|
2007-03-02 01:36:52 +00:00
|
|
|
+ (NSArray *)fileTypes; //mp3, ogg, etc
|
|
|
|
|
2007-03-03 17:19:37 +00:00
|
|
|
//For KVO
|
|
|
|
//- (void)setProperties:(NSDictionary *)p;
|
2007-02-24 20:36:27 +00:00
|
|
|
- (NSDictionary *)properties;
|
2007-03-03 17:19:37 +00:00
|
|
|
|
2007-11-24 20:16:27 +00:00
|
|
|
- (int)readAudio:(void *)buffer frames:(UInt32)frames;
|
|
|
|
|
2007-03-03 17:19:37 +00:00
|
|
|
- (BOOL)open:(id<CogSource>)source;
|
2007-11-24 20:16:27 +00:00
|
|
|
- (long)seek:(long)frame;
|
2007-02-24 20:36:27 +00:00
|
|
|
- (void)close;
|
2007-11-24 20:16:27 +00:00
|
|
|
|
|
|
|
@optional
|
|
|
|
- (BOOL)setTrack:(NSURL *)track;
|
|
|
|
|
|
|
|
//These are in NSObject, so as long as you are a subclass of that, you are ok.
|
|
|
|
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(void *)context;
|
|
|
|
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
@protocol CogMetadataReader <NSObject>
|
2007-02-24 20:36:27 +00:00
|
|
|
+ (NSArray *)fileTypes;
|
2007-10-14 18:56:23 +00:00
|
|
|
+ (NSArray *)mimeTypes;
|
2007-10-09 01:20:46 +00:00
|
|
|
+ (NSDictionary *)metadataForURL:(NSURL *)url;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
@protocol CogPropertiesReader <NSObject>
|
2007-02-24 20:36:27 +00:00
|
|
|
+ (NSArray *)fileTypes;
|
2007-10-14 17:31:20 +00:00
|
|
|
+ (NSArray *)mimeTypes;
|
2007-03-02 01:36:52 +00:00
|
|
|
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
2007-10-09 01:20:46 +00:00
|
|
|
@protocol CogPluginController <NSObject>
|
2007-10-20 15:53:52 +00:00
|
|
|
+ (id<CogPluginController>)sharedPluginController;
|
|
|
|
|
2007-10-20 15:46:39 +00:00
|
|
|
- (NSDictionary *)sources;
|
|
|
|
- (NSDictionary *)containers;
|
|
|
|
- (NSDictionary *)metadataReaders;
|
|
|
|
|
|
|
|
- (NSDictionary *)propertiesReadersByExtension;
|
|
|
|
- (NSDictionary *)propertiesReadersByMimeType;
|
|
|
|
|
|
|
|
- (NSDictionary *)decodersByExtension;
|
|
|
|
- (NSDictionary *)decodersByMimeType;
|
|
|
|
|
2007-10-09 01:20:46 +00:00
|
|
|
- (id<CogSource>) audioSourceForURL:(NSURL *)url;
|
|
|
|
- (NSArray *) urlsForContainerURL:(NSURL *)url;
|
|
|
|
- (NSDictionary *) metadataForURL:(NSURL *)url;
|
|
|
|
- (NSDictionary *) propertiesForURL:(NSURL *)url;
|
2007-10-14 18:12:15 +00:00
|
|
|
- (id<CogDecoder>) audioDecoderForSource:(id<CogSource>)source;
|
2007-10-09 01:20:46 +00:00
|
|
|
@end
|
|
|
|
|
2007-02-24 20:36:27 +00:00
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
|