2008-03-13 01:43:33 +00:00
|
|
|
//
|
|
|
|
// FilePlaylistEntry.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/12/08.
|
|
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "FilePlaylistEntry.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation FilePlaylistEntry
|
|
|
|
|
|
|
|
- (void)setURL:(NSURL *)url
|
|
|
|
{
|
|
|
|
FSPathMakeRef((UInt8 *)[[url path] fileSystemRepresentation], &fileRef, NULL);
|
2008-05-21 11:27:01 +00:00
|
|
|
|
|
|
|
[super setURL:url];
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSURL *)URL
|
|
|
|
{
|
|
|
|
UInt8 path[PATH_MAX];
|
|
|
|
|
|
|
|
OSStatus status = FSRefMakePath(&fileRef, (UInt8*)path, sizeof(path));
|
2008-05-21 11:27:01 +00:00
|
|
|
if (status == noErr)
|
|
|
|
{
|
|
|
|
NSString *after = @"";
|
|
|
|
if ([URL fragment] != nil) {
|
|
|
|
after = [@"#" stringByAppendingString:[URL fragment]];
|
|
|
|
}
|
2008-03-13 01:43:33 +00:00
|
|
|
|
2008-05-21 11:27:01 +00:00
|
|
|
[super setURL:[NSURL URLWithString:[[[NSURL fileURLWithPath: [NSString stringWithUTF8String:(const char *)path]] absoluteString] stringByAppendingString:after]]];
|
2008-03-24 12:31:55 +00:00
|
|
|
}
|
2008-05-21 11:27:01 +00:00
|
|
|
|
|
|
|
return URL;
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|