Shorten Framework currently has no callback mechanisms. Until then, did a workaround for the source system.

CQTexperiment
vspader 2007-03-04 18:46:44 +00:00
parent 53e4ef0c7b
commit 657d6a2860
2 changed files with 13 additions and 3 deletions

View File

@ -10,8 +10,14 @@
@implementation ShortenDecoder
- (BOOL)open:(NSURL *)url
- (BOOL)open:(id<CogSource>)source
{
NSURL *url = [source url];
if (![[url scheme] isEqualToString:@"file"])
return NO;
[source close];
decoder = new shn_reader;
if (!decoder)
@ -124,6 +130,10 @@
shn_unload(handle);*/
}
- (BOOL)seekable
{
return YES;
}
- (NSDictionary *)properties
{

View File

@ -11,13 +11,13 @@
@implementation ShortenPropertiesReader
- (NSDictionary *)propertiesForURL:(NSURL *)url
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source
{
NSDictionary *properties;
ShortenDecoder *decoder;
decoder = [[ShortenDecoder alloc] init];
if (![decoder open:url])
if (![decoder open:source])
{
return nil;
}