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
|
|
|
|
|
2008-03-15 04:45:37 +00:00
|
|
|
@synthesize fragment;
|
|
|
|
|
2008-03-13 01:43:33 +00:00
|
|
|
- (void)setURL:(NSURL *)url
|
|
|
|
{
|
|
|
|
FSPathMakeRef((UInt8 *)[[url path] fileSystemRepresentation], &fileRef, NULL);
|
2008-03-15 04:45:37 +00:00
|
|
|
self.fragment = [url fragment];
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSURL *)URL
|
|
|
|
{
|
|
|
|
UInt8 path[PATH_MAX];
|
|
|
|
|
|
|
|
OSStatus status = FSRefMakePath(&fileRef, (UInt8*)path, sizeof(path));
|
|
|
|
if (status != noErr)
|
|
|
|
return nil;
|
|
|
|
|
2008-03-15 04:45:37 +00:00
|
|
|
return [NSURL URLWithString:[[[NSURL fileURLWithPath: [NSString stringWithUTF8String:(const char *)path]] absoluteString] stringByAppendingFormat:@"#%@", self.fragment]];
|
2008-03-13 01:43:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|