2007-03-07 01:26:50 +00:00
|
|
|
//
|
|
|
|
// PlaylistLoader.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/05/07.
|
|
|
|
// Copyright 2007 Vincent Spader All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2008-05-09 21:24:49 +00:00
|
|
|
#import "PlaylistController.h"
|
2007-03-07 01:26:50 +00:00
|
|
|
|
|
|
|
@class PlaylistController;
|
2008-05-03 15:15:45 +00:00
|
|
|
@class PlaybackController;
|
2008-03-01 18:29:14 +00:00
|
|
|
@class PlaylistEntry;
|
2007-03-07 01:26:50 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
kPlaylistM3u,
|
|
|
|
kPlaylistPls,
|
|
|
|
} PlaylistType;
|
|
|
|
|
|
|
|
@interface PlaylistLoader : NSObject {
|
2007-03-09 01:16:06 +00:00
|
|
|
IBOutlet PlaylistController *playlistController;
|
2009-03-06 04:37:44 +00:00
|
|
|
|
|
|
|
NSOperationQueue *queue;
|
2007-03-07 01:26:50 +00:00
|
|
|
}
|
|
|
|
|
2009-08-16 16:49:34 +00:00
|
|
|
- (void)initDefaults;
|
|
|
|
|
|
|
|
// Clear playlist
|
|
|
|
- (void)clear:(id)sender;
|
|
|
|
|
2009-03-06 04:37:44 +00:00
|
|
|
// Load arrays of urls...
|
2008-05-09 21:24:49 +00:00
|
|
|
- (NSArray*)addURLs:(NSArray *)urls sort:(BOOL)sort;
|
|
|
|
- (NSArray*)addURL:(NSURL *)url;
|
|
|
|
- (NSArray*)insertURLs:(NSArray *)urls atIndex:(int)index sort:(BOOL)sort;
|
2008-02-10 22:46:12 +00:00
|
|
|
|
2009-03-06 04:37:44 +00:00
|
|
|
// Save playlist, auto-determines type based on extension. Uses m3u if it cannot be determined.
|
2007-03-07 01:26:50 +00:00
|
|
|
- (BOOL)save:(NSString *)filename;
|
|
|
|
- (BOOL)save:(NSString *)filename asType:(PlaylistType)type;
|
|
|
|
- (BOOL)saveM3u:(NSString *)filename;
|
|
|
|
- (BOOL)savePls:(NSString *)filename;
|
|
|
|
|
2009-03-06 04:37:44 +00:00
|
|
|
// Read info for a playlist entry
|
2008-03-01 18:29:14 +00:00
|
|
|
- (NSDictionary *)readEntryInfo:(PlaylistEntry *)pe;
|
|
|
|
|
2008-05-09 21:24:49 +00:00
|
|
|
- (void)loadInfoForEntries:(NSArray *)entries;
|
|
|
|
|
2007-03-09 01:16:06 +00:00
|
|
|
- (NSArray *)acceptableFileTypes;
|
2007-10-13 04:53:48 +00:00
|
|
|
- (NSArray *)acceptablePlaylistTypes; //Only m3u and pls saving
|
2007-10-09 01:20:46 +00:00
|
|
|
- (NSArray *)acceptableContainerTypes;
|
2007-03-07 01:26:50 +00:00
|
|
|
|
2009-03-06 04:37:44 +00:00
|
|
|
// Events (passed to playlist controler):
|
2009-02-28 22:22:33 +00:00
|
|
|
- (void)willInsertURLs:(NSArray*)urls origin:(URLOrigin)origin;
|
|
|
|
- (void)didInsertURLs:(NSArray*)entries origin:(URLOrigin)origin;
|
2008-05-09 21:24:49 +00:00
|
|
|
|
2007-03-07 01:26:50 +00:00
|
|
|
@end
|