2005-06-02 14:16:43 -04:00
|
|
|
//
|
|
|
|
// PlaylistController.h
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Vincent Spader on 3/18/05.
|
2005-07-02 17:02:06 -04:00
|
|
|
// Copyright 2005 Vincent Spader All rights reserved.
|
2005-06-02 14:16:43 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
2008-02-10 13:16:45 -03:00
|
|
|
#import <Foundation/NSUndoManager.h>
|
2005-06-02 14:16:43 -04:00
|
|
|
#import "DNDArrayController.h"
|
2007-03-08 22:16:06 -03:00
|
|
|
|
|
|
|
@class PlaylistLoader;
|
|
|
|
@class PlaylistEntry;
|
2008-02-10 19:46:12 -03:00
|
|
|
@class EntriesController;
|
2008-02-16 13:13:21 -03:00
|
|
|
@class SpotlightWindowController;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2008-02-19 00:39:43 -03:00
|
|
|
typedef enum {
|
|
|
|
RepeatNone = 0,
|
|
|
|
RepeatOne,
|
2008-02-19 01:02:05 -03:00
|
|
|
RepeatAlbum,
|
2008-02-19 00:39:43 -03:00
|
|
|
RepeatAll
|
|
|
|
} RepeatMode;
|
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
@interface PlaylistController : DNDArrayController {
|
2007-03-08 22:16:06 -03:00
|
|
|
IBOutlet PlaylistLoader *playlistLoader;
|
2008-02-10 19:46:12 -03:00
|
|
|
IBOutlet EntriesController *entriesController;
|
2008-02-16 13:13:21 -03:00
|
|
|
IBOutlet SpotlightWindowController *spotlightWindowController;
|
2007-03-08 22:16:06 -03:00
|
|
|
|
2006-04-13 14:40:23 -04:00
|
|
|
NSString *totalTimeDisplay;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
|
|
|
NSMutableArray *shuffleList;
|
2008-02-21 04:30:28 -03:00
|
|
|
NSMutableArray *queueList;
|
2008-02-10 13:16:45 -03:00
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
PlaylistEntry *currentEntry;
|
|
|
|
|
|
|
|
BOOL shuffle;
|
2008-02-19 00:39:43 -03:00
|
|
|
RepeatMode repeat;
|
2006-05-23 11:12:24 -04:00
|
|
|
|
|
|
|
int selectedRow;
|
2005-06-02 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2006-01-20 12:22:03 -03:00
|
|
|
//Private Methods
|
|
|
|
- (void)updateIndexesFromRow:(int) row;
|
2006-04-13 14:40:23 -04:00
|
|
|
- (void)updateTotalTime;
|
|
|
|
|
2006-01-20 12:22:03 -03:00
|
|
|
|
|
|
|
//PUBLIC METHODS
|
2005-06-02 14:16:43 -04:00
|
|
|
- (void)setShuffle:(BOOL)s;
|
|
|
|
- (BOOL)shuffle;
|
2008-02-19 00:39:43 -03:00
|
|
|
- (void)setRepeat:(RepeatMode)r;
|
|
|
|
- (RepeatMode)repeat;
|
2008-02-21 16:14:20 -03:00
|
|
|
- (NSArray *)filterPlaylistOnAlbum:(NSString *)album;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2008-02-14 20:09:51 -03:00
|
|
|
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe;
|
|
|
|
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe;
|
|
|
|
|
2008-02-10 13:16:45 -03:00
|
|
|
/* Methods for undoing various actions */
|
|
|
|
- (NSUndoManager *)undoManager;
|
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
- (IBAction)takeShuffleFromObject:(id)sender;
|
2008-02-19 01:02:05 -03:00
|
|
|
|
2008-02-19 00:39:43 -03:00
|
|
|
- (IBAction)toggleRepeat:(id)sender;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2007-03-08 22:16:06 -03:00
|
|
|
- (IBAction)sortByPath;
|
|
|
|
- (IBAction)randomizeList;
|
|
|
|
|
|
|
|
- (IBAction)showEntryInFinder:(id)sender;
|
2007-05-26 10:09:03 -04:00
|
|
|
- (IBAction)clearFilterPredicate:(id)sender;
|
|
|
|
- (IBAction)clear:(id)sender;
|
2007-02-18 19:27:55 -03:00
|
|
|
|
2008-02-16 13:13:21 -03:00
|
|
|
// Spotlight
|
|
|
|
- (IBAction)searchByArtist:(id)sender;
|
|
|
|
- (IBAction)searchByAlbum:(id)sender;
|
|
|
|
|
2006-04-13 14:40:23 -04:00
|
|
|
- (void)setTotalTimeDisplay:(NSString *)ttd;
|
|
|
|
- (NSString *)totalTimeDisplay;
|
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
//FUN PLAYLIST MANAGEMENT STUFF!
|
|
|
|
- (id)currentEntry;
|
2006-01-20 12:22:03 -03:00
|
|
|
- (void)setCurrentEntry:(PlaylistEntry *)pe;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2006-01-29 11:57:48 -03:00
|
|
|
- (BOOL)next;
|
|
|
|
- (BOOL)prev;
|
2006-01-20 12:22:03 -03:00
|
|
|
|
|
|
|
- (void)addShuffledListToBack;
|
|
|
|
- (void)addShuffledListToFront;
|
|
|
|
- (void)resetShuffleList;
|
2005-06-02 14:16:43 -04:00
|
|
|
|
2008-02-19 16:59:35 -03:00
|
|
|
- (PlaylistEntry *)shuffledEntryAtIndex:(int)i;
|
2007-03-13 22:28:30 -04:00
|
|
|
- (PlaylistEntry *)entryAtIndex:(int)i;
|
2007-03-08 22:16:06 -03:00
|
|
|
|
2008-02-21 04:30:28 -03:00
|
|
|
// queue methods
|
|
|
|
- (IBAction)addToQueue:(id)sender;
|
|
|
|
- (IBAction)emptyQueueList:(id)sender;
|
|
|
|
- (NSMutableArray *)queueList;
|
|
|
|
|
2005-06-02 14:16:43 -04:00
|
|
|
@end
|