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>
|
|
|
|
|
|
|
|
@class PlaylistController;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
kPlaylistM3u,
|
|
|
|
kPlaylistPls,
|
|
|
|
} PlaylistType;
|
|
|
|
|
|
|
|
@interface PlaylistLoader : NSObject {
|
2007-03-09 01:16:06 +00:00
|
|
|
IBOutlet PlaylistController *playlistController;
|
2007-03-07 01:26:50 +00:00
|
|
|
|
|
|
|
PlaylistType currentType; //m3u or pls
|
|
|
|
NSString *currentFile;
|
|
|
|
}
|
|
|
|
|
2007-03-09 01:16:06 +00:00
|
|
|
//load arrays of urls...
|
|
|
|
- (void)addURLs:(NSArray *)urls sort:(BOOL)sort;
|
|
|
|
- (void)insertURLs:(NSArray *)urls atIndex:(int)index sort:(BOOL)sort;
|
2007-03-07 01:26:50 +00:00
|
|
|
|
|
|
|
//load playlist auto-determines type to be either pls or m3u.
|
|
|
|
- (BOOL)load:(NSString *)filename;
|
|
|
|
- (BOOL)loadM3u:(NSString *)filename;
|
|
|
|
- (BOOL)loadPls:(NSString *)filename;
|
|
|
|
|
|
|
|
//save playlist, uses current info, will fail if there is no current info.
|
|
|
|
- (BOOL)save;
|
|
|
|
//save playlist, auto-determines type based on extension. Uses m3u if it cannot be determined.
|
|
|
|
- (BOOL)save:(NSString *)filename;
|
|
|
|
- (BOOL)save:(NSString *)filename asType:(PlaylistType)type;
|
|
|
|
- (BOOL)saveM3u:(NSString *)filename;
|
|
|
|
- (BOOL)savePls:(NSString *)filename;
|
|
|
|
|
2007-03-09 01:16:06 +00:00
|
|
|
- (NSArray *)acceptableFileTypes;
|
2007-03-07 01:26:50 +00:00
|
|
|
- (NSArray *)acceptablePlaylistTypes;
|
|
|
|
|
|
|
|
- (PlaylistType)currentType;
|
|
|
|
- (void)setCurrentType:(PlaylistType)type;
|
|
|
|
|
|
|
|
- (NSString *)currentFile;
|
|
|
|
- (void)setCurrentFile:(NSString *)currentFile;
|
|
|
|
|
|
|
|
@end
|