Shorten Framework currently has no callback mechanisms. Until then, did a workaround for the source system.
parent
53e4ef0c7b
commit
657d6a2860
|
@ -10,8 +10,14 @@
|
||||||
|
|
||||||
@implementation ShortenDecoder
|
@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;
|
decoder = new shn_reader;
|
||||||
|
|
||||||
if (!decoder)
|
if (!decoder)
|
||||||
|
@ -124,6 +130,10 @@
|
||||||
shn_unload(handle);*/
|
shn_unload(handle);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)seekable
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSDictionary *)properties
|
- (NSDictionary *)properties
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
|
|
||||||
@implementation ShortenPropertiesReader
|
@implementation ShortenPropertiesReader
|
||||||
|
|
||||||
- (NSDictionary *)propertiesForURL:(NSURL *)url
|
+ (NSDictionary *)propertiesForSource:(id<CogSource>)source
|
||||||
{
|
{
|
||||||
NSDictionary *properties;
|
NSDictionary *properties;
|
||||||
ShortenDecoder *decoder;
|
ShortenDecoder *decoder;
|
||||||
|
|
||||||
decoder = [[ShortenDecoder alloc] init];
|
decoder = [[ShortenDecoder alloc] init];
|
||||||
if (![decoder open:url])
|
if (![decoder open:source])
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue