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
|
||||
|
||||
- (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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue