cog/Playlist/FilePlaylistEntry.m

34 lines
720 B
Matlab
Raw Normal View History

//
// FilePlaylistEntry.m
// Cog
//
// Created by Vincent Spader on 3/12/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "FilePlaylistEntry.h"
@implementation FilePlaylistEntry
@synthesize fragment;
- (void)setURL:(NSURL *)url
{
FSPathMakeRef((UInt8 *)[[url path] fileSystemRepresentation], &fileRef, NULL);
self.fragment = [url fragment];
}
- (NSURL *)URL
{
UInt8 path[PATH_MAX];
OSStatus status = FSRefMakePath(&fileRef, (UInt8*)path, sizeof(path));
if (status != noErr)
return nil;
return [NSURL URLWithString:[[[NSURL fileURLWithPath: [NSString stringWithUTF8String:(const char *)path]] absoluteString] stringByAppendingFormat:@"#%@", self.fragment]];
}
@end