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>
|
2008-02-10 16:16:45 +00:00
|
|
|
#import <Foundation/NSUndoManager.h>
|
2005-06-02 18:16:43 +00:00
|
|
|
#import "DNDArrayController.h"
|
2007-03-09 01:16:06 +00:00
|
|
|
|
|
|
|
@class PlaylistLoader;
|
|
|
|
@class PlaylistEntry;
|
2008-02-10 22:46:12 +00:00
|
|
|
@class EntriesController;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
@interface PlaylistController : DNDArrayController {
|
2007-03-09 01:16:06 +00:00
|
|
|
IBOutlet PlaylistLoader *playlistLoader;
|
2008-02-10 22:46:12 +00:00
|
|
|
IBOutlet EntriesController *entriesController;
|
2007-03-09 01:16:06 +00:00
|
|
|
|
2006-04-13 18:40:23 +00:00
|
|
|
NSString *totalTimeDisplay;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
|
|
|
NSMutableArray *shuffleList;
|
2008-02-10 16:16:45 +00:00
|
|
|
|
2005-06-02 18:16:43 +00:00
|
|
|
PlaylistEntry *currentEntry;
|
|
|
|
|
|
|
|
BOOL shuffle;
|
|
|
|
BOOL repeat;
|
2006-05-23 15:12:24 +00:00
|
|
|
|
|
|
|
int selectedRow;
|
2005-06-02 18:16:43 +00:00
|
|
|
}
|
|
|
|
|
2006-01-20 15:22:03 +00:00
|
|
|
//Private Methods
|
|
|
|
- (void)updateIndexesFromRow:(int) row;
|
2006-04-13 18:40:23 +00:00
|
|
|
- (void)updateTotalTime;
|
|
|
|
|
2006-01-20 15:22:03 +00:00
|
|
|
|
|
|
|
//PUBLIC METHODS
|
2005-06-02 18:16:43 +00:00
|
|
|
- (void)setShuffle:(BOOL)s;
|
|
|
|
- (BOOL)shuffle;
|
|
|
|
- (void)setRepeat:(BOOL)r;
|
|
|
|
- (BOOL)repeat;
|
|
|
|
|
2008-02-14 23:09:51 +00:00
|
|
|
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe;
|
|
|
|
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe;
|
|
|
|
|
2008-02-10 16:16:45 +00:00
|
|
|
/* Methods for undoing various actions */
|
|
|
|
- (NSUndoManager *)undoManager;
|
|
|
|
|
2005-06-02 18:16:43 +00:00
|
|
|
- (IBAction)takeShuffleFromObject:(id)sender;
|
|
|
|
- (IBAction)takeRepeatFromObject:(id)sender;
|
|
|
|
|
2007-03-09 01:16:06 +00:00
|
|
|
- (IBAction)sortByPath;
|
|
|
|
- (IBAction)randomizeList;
|
|
|
|
|
|
|
|
- (IBAction)showEntryInFinder:(id)sender;
|
2007-05-26 14:09:03 +00:00
|
|
|
- (IBAction)clearFilterPredicate:(id)sender;
|
|
|
|
- (IBAction)clear:(id)sender;
|
2007-02-18 22:27:55 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
- (void)addShuffledListToBack;
|
|
|
|
- (void)addShuffledListToFront;
|
|
|
|
- (void)resetShuffleList;
|
2005-06-02 18:16:43 +00:00
|
|
|
|
2007-03-14 02:28:30 +00:00
|
|
|
- (PlaylistEntry *)entryAtIndex:(int)i;
|
2007-03-09 01:16:06 +00:00
|
|
|
|
2005-06-02 18:16:43 +00:00
|
|
|
@end
|