2007-10-09 02:25:40 +00:00
|
|
|
//
|
|
|
|
// CueSheetContainer.m
|
|
|
|
// CueSheet
|
|
|
|
//
|
|
|
|
// Created by Zaphod Beeblebrox on 10/8/07.
|
|
|
|
// Copyright 2007 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "CueSheetContainer.h"
|
|
|
|
|
|
|
|
#import "CueSheet.h"
|
|
|
|
#import "CueSheetTrack.h"
|
|
|
|
|
|
|
|
@implementation CueSheetContainer
|
|
|
|
|
|
|
|
+ (NSArray *)fileTypes
|
|
|
|
{
|
|
|
|
return [NSArray arrayWithObject:@"cue"];
|
|
|
|
}
|
|
|
|
|
2007-10-14 18:56:23 +00:00
|
|
|
+ (NSArray *)mimeTypes
|
|
|
|
{
|
|
|
|
return [NSArray arrayWithObjects:@"application/x-cue", nil]; //This is basically useless
|
|
|
|
}
|
|
|
|
|
2015-04-13 07:39:24 +00:00
|
|
|
+ (float)priority
|
|
|
|
{
|
|
|
|
return 1.0f;
|
|
|
|
}
|
|
|
|
|
2007-10-10 01:59:25 +00:00
|
|
|
+ (NSArray *)urlsForContainerURL:(NSURL *)url
|
|
|
|
{
|
2007-10-09 02:25:40 +00:00
|
|
|
if (![url isFileURL]) {
|
|
|
|
return [NSArray array];
|
|
|
|
}
|
|
|
|
|
2013-10-11 12:41:36 +00:00
|
|
|
if ([url fragment]) {
|
|
|
|
// input url already has fragment defined - no need to expand further
|
|
|
|
return [NSMutableArray arrayWithObject:url];
|
|
|
|
}
|
|
|
|
|
2007-10-09 02:25:40 +00:00
|
|
|
NSMutableArray *tracks = [NSMutableArray array];
|
2007-10-10 01:59:25 +00:00
|
|
|
|
|
|
|
CueSheet *cuesheet = [CueSheet cueSheetWithFile:[url path]];
|
|
|
|
|
2013-10-10 08:44:45 +00:00
|
|
|
for (CueSheetTrack *track in [cuesheet tracks]) {
|
2007-10-09 02:25:40 +00:00
|
|
|
[tracks addObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingFormat:@"#%@", [track track]]]];
|
|
|
|
}
|
|
|
|
|
|
|
|
return tracks;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|