2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
// PlaylistController.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/18/05.
|
2005-07-02 21:02:06 +00:00
|
|
|
// Copyright 2005 Vincent Spader All rights reserved.
|
2005-06-02 18:16:43 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#import "DNDArrayController.h"
|
|
|
|
#import "PlaylistEntry.h"
|
|
|
|
|
|
|
|
@interface PlaylistController : DNDArrayController {
|
|
|
|
NSArray *acceptableFileTypes;
|
|
|
|
NSArray *acceptablePlaylistTypes;
|
|
|
|
|
|
|
|
NSString *playlistFilename;
|
2006-04-13 18:40:23 +00:00
|
|
|
NSString *totalTimeDisplay;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
NSMutableArray *shuffleList;
|
|
|
|
|
|
|
|
PlaylistEntry *currentEntry;
|
|
|
|
|
|
|
|
BOOL shuffle;
|
|
|
|
BOOL repeat;
|
2006-05-23 15:12:24 +00:00
|
|
|
|
|
|
|
int selectedRow;
|
2005-06-02 18:16:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//All these return the number of things actually added
|
2006-01-20 15:22:03 +00:00
|
|
|
//Private Methods
|
2006-05-12 14:34:59 +00:00
|
|
|
//- (int)addPath:(NSString *)path;
|
|
|
|
//- (int)insertPath:(NSString *)path atIndex:(int)index;
|
|
|
|
//- (int)insertFile:(NSString *)filename atIndex:(int)index;
|
|
|
|
//- (int)addFile:(NSString *)filename;
|
2006-01-20 15:22:03 +00:00
|
|
|
- (void)updateIndexesFromRow:(int) row;
|
2006-04-13 18:40:23 +00:00
|
|
|
- (void)updateTotalTime;
|
|
|
|
|
2006-01-20 15:22:03 +00:00
|
|
|
|
|
|
|
//PUBLIC METHODS
|
2006-05-12 14:34:59 +00:00
|
|
|
- (void)addPaths:(NSArray *)paths sort:(BOOL)sort;
|
|
|
|
- (void)insertPaths:(NSArray *)paths atIndex:(int)index sort:(BOOL)sort;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
- (NSArray *)acceptableFileTypes;
|
|
|
|
|
|
|
|
- (void)setShuffle:(BOOL)s;
|
|
|
|
- (BOOL)shuffle;
|
|
|
|
- (void)setRepeat:(BOOL)r;
|
|
|
|
- (BOOL)repeat;
|
|
|
|
|
|
|
|
- (IBAction)takeShuffleFromObject:(id)sender;
|
|
|
|
- (IBAction)takeRepeatFromObject:(id)sender;
|
|
|
|
|
2006-04-13 18:40:23 +00:00
|
|
|
- (void)setTotalTimeDisplay:(NSString *)ttd;
|
|
|
|
- (NSString *)totalTimeDisplay;
|
|
|
|
|
2005-06-02 18:16:43 +00:00
|
|
|
//FUN PLAYLIST MANAGEMENT STUFF!
|
|
|
|
- (id)currentEntry;
|
2006-01-20 15:22:03 +00:00
|
|
|
- (void)setCurrentEntry:(PlaylistEntry *)pe;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
2006-01-29 14:57:48 +00:00
|
|
|
- (BOOL)next;
|
|
|
|
- (BOOL)prev;
|
2006-01-20 15:22:03 +00:00
|
|
|
|
2006-04-14 17:28:20 +00:00
|
|
|
- (PlaylistEntry *)entryAtIndex:(int)i;
|
|
|
|
|
2006-01-20 15:22:03 +00:00
|
|
|
- (void)addShuffledListToBack;
|
|
|
|
- (void)addShuffledListToFront;
|
|
|
|
- (void)resetShuffleList;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
//load/save playlist
|
|
|
|
- (void)loadPlaylist:(NSString *)filename;
|
|
|
|
- (void)savePlaylist:(NSString *)filename;
|
|
|
|
|
|
|
|
- (NSString *)playlistFilename;
|
|
|
|
- (void)setPlaylistFilename:(NSString *)pf;
|
|
|
|
- (NSArray *)acceptablePlaylistTypes;
|
|
|
|
|
2006-05-23 15:12:24 +00:00
|
|
|
- (IBAction)showFileInFinder:(id)sender;
|
2006-05-24 18:09:44 +00:00
|
|
|
|
2006-05-29 22:23:56 +00:00
|
|
|
- (void)handlePlaylistViewHeaderNotification:(NSNotification*)notif;
|
2005-06-02 18:16:43 +00:00
|
|
|
@end
|