2007-03-02 01:36:52 +00:00
|
|
|
/*
|
|
|
|
Are defines really appropriate for this?
|
|
|
|
We want something easily insertable into a dictionary.
|
|
|
|
Maybe should extern these, and shove the instances in PluginController.m, but will that cause linking problems?
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define kCogSource @"CogSource"
|
|
|
|
#define kCogDecoder @"CogDecoder"
|
|
|
|
#define kCogMetadataReader @"CogMetadataReader"
|
|
|
|
#define kCogPropertiesReader @"CogPropertiesReader"
|
|
|
|
|
|
|
|
@protocol CogPlugin <NSObject>
|
|
|
|
//Dictionary containing classname/plugintype pairs. ex: @"VorbisDecoder": kCogDecoder, @"VorbisPropertiesRaeder": kCogPropertiesReader
|
|
|
|
+ (NSDictionary *)pluginInfo;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
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-02-24 20:36:27 +00:00
|
|
|
|
|
|
|
- (BOOL)open:(NSURL *)url;
|
2007-03-02 01:36:52 +00:00
|
|
|
- (NSDictionary *)properties; //Perhaps contains header info for HTTP stream, or path for a regular file.
|
|
|
|
- (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-03-03 17:19:37 +00:00
|
|
|
@protocol CogDecoder <NSObject>
|
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
|
|
|
|
|
|
|
- (BOOL)open:(id<CogSource>)source;
|
2007-03-02 01:36:52 +00:00
|
|
|
- (BOOL)seekable;
|
|
|
|
- (double)seekToTime:(double)time; //time is in milleseconds, should return the time actually seeked to.
|
2007-02-24 20:36:27 +00:00
|
|
|
- (int)fillBuffer:(void *)buf ofSize:(UInt32)size;
|
|
|
|
- (void)close;
|
|
|
|
@end
|
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
@protocol CogMetadataReader <NSObject>
|
2007-02-24 20:36:27 +00:00
|
|
|
+ (NSArray *)fileTypes;
|
2007-03-02 01:36:52 +00:00
|
|
|
+ (NSDictionary *)metadataForURL;
|
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-03-02 01:36:52 +00:00
|
|
|
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source;
|
2007-02-24 20:36:27 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
2007-03-02 01:36:52 +00:00
|
|
|
|