cog/Playlist/PlaylistController.h

96 lines
2.0 KiB
C
Raw Normal View History

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 <Foundation/NSUndoManager.h>
2005-06-02 18:16:43 +00:00
#import "DNDArrayController.h"
@class PlaylistLoader;
@class PlaylistEntry;
@class EntriesController;
@class SpotlightWindowController;
2005-06-02 18:16:43 +00:00
typedef enum {
RepeatNone = 0,
RepeatOne,
RepeatAlbum,
RepeatAll
} RepeatMode;
2005-06-02 18:16:43 +00:00
@interface PlaylistController : DNDArrayController {
IBOutlet PlaylistLoader *playlistLoader;
IBOutlet EntriesController *entriesController;
IBOutlet SpotlightWindowController *spotlightWindowController;
2005-06-02 18:16:43 +00:00
NSMutableArray *shuffleList;
NSMutableArray *queueList;
NSString *totalTime;
2005-06-02 18:16:43 +00:00
PlaylistEntry *currentEntry;
BOOL shuffle;
RepeatMode repeat;
2005-06-02 18:16:43 +00:00
}
2008-02-23 19:46:23 +00:00
@property(retain) PlaylistEntry *currentEntry;
@property(retain) NSString *totalTime;
2008-02-23 19:46:23 +00:00
2006-01-20 15:22:03 +00:00
//Private Methods
2006-04-13 18:40:23 +00:00
- (void)updateTotalTime;
- (void)updatePlaylistIndexes;
- (IBAction)stopAfterCurrent:(id)sender;
2006-04-13 18:40:23 +00:00
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:(RepeatMode)r;
- (RepeatMode)repeat;
- (NSArray *)filterPlaylistOnAlbum:(NSString *)album;
2005-06-02 18:16:43 +00:00
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe;
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe;
/* Methods for undoing various actions */
- (NSUndoManager *)undoManager;
2005-06-02 18:16:43 +00:00
- (IBAction)takeShuffleFromObject:(id)sender;
- (IBAction)toggleRepeat:(id)sender;
2005-06-02 18:16:43 +00:00
- (IBAction)sortByPath;
- (IBAction)randomizeList;
- (IBAction)showEntryInFinder:(id)sender;
- (IBAction)clearFilterPredicate:(id)sender;
- (IBAction)clear:(id)sender;
// Spotlight
- (IBAction)searchByArtist:(id)sender;
- (IBAction)searchByAlbum:(id)sender;
2005-06-02 18:16:43 +00:00
//FUN PLAYLIST MANAGEMENT STUFF!
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
- (PlaylistEntry *)shuffledEntryAtIndex:(int)i;
- (PlaylistEntry *)entryAtIndex:(int)i;
// queue methods
- (IBAction)addToQueue:(id)sender;
- (IBAction)removeFromQueue:(id)sender;
- (IBAction)emptyQueueList:(id)sender;
- (NSMutableArray *)queueList;
2005-06-02 18:16:43 +00:00
@end