cog/Playlist/PlaylistController.h

115 lines
2.8 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 SpotlightWindowController;
@class PlaybackController;
2005-06-02 18:16:43 +00:00
typedef NS_ENUM(NSInteger, RepeatMode) {
RepeatModeNoRepeat = 0,
RepeatModeRepeatOne,
RepeatModeRepeatAlbum,
RepeatModeRepeatAll
};
static inline BOOL IsRepeatOneSet() {
return [[NSUserDefaults standardUserDefaults] integerForKey:@"repeat"] == RepeatModeRepeatOne;
}
typedef enum { ShuffleOff = 0, ShuffleAlbums, ShuffleAll } ShuffleMode;
typedef NS_ENUM(NSInteger, URLOrigin) {
URLOriginInternal = 0,
URLOriginExternal
};
@interface PlaylistController : DNDArrayController <NSTableViewDelegate> {
IBOutlet PlaylistLoader *playlistLoader;
IBOutlet SpotlightWindowController *spotlightWindowController;
IBOutlet PlaybackController *playbackController;
NSMutableArray *shuffleList;
NSMutableArray *queueList;
NSString *totalTime;
PlaylistEntry *currentEntry;
NSUndoManager *undoManager;
2005-06-02 18:16:43 +00:00
}
2013-09-30 00:27:55 +00:00
@property(nonatomic, retain) PlaylistEntry *currentEntry;
@property(retain) NSString *totalTime;
2008-02-23 19:46:23 +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
// PUBLIC METHODS
- (void)setShuffle:(ShuffleMode)s;
- (ShuffleMode)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;
2009-02-28 06:40:50 +00:00
- (IBAction)toggleShuffle:(id)sender;
- (IBAction)toggleRepeat:(id)sender;
2005-06-02 18:16:43 +00:00
- (IBAction)randomizeList:(id)sender;
2013-10-18 07:13:27 +00:00
- (IBAction)removeDuplicates:(id)sender;
2013-10-18 07:14:53 +00:00
- (IBAction)removeDeadItems:(id)sender;
2013-10-18 07:13:27 +00:00
- (IBAction)showEntryInFinder:(id)sender;
- (IBAction)clearFilterPredicate:(id)sender;
- (IBAction)clear:(id)sender;
//- (IBAction)showTagEditor:(id)sender;
// Spotlight
- (IBAction)searchByArtist:(id)sender;
- (IBAction)searchByAlbum:(id)sender;
// 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:(NSInteger)i;
- (PlaylistEntry *)entryAtIndex:(NSInteger)i;
// Event inlets:
- (void)willInsertURLs:(NSArray *)urls origin:(URLOrigin)origin;
- (void)didInsertURLs:(NSArray *)urls origin:(URLOrigin)origin;
// queue methods
2008-03-08 23:57:54 +00:00
- (IBAction)toggleQueued:(id)sender;
- (IBAction)emptyQueueList:(id)sender;
- (NSMutableArray *)queueList;
- (void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet *)indexSet
toIndex:(NSUInteger)insertIndex;
2005-06-02 18:16:43 +00:00
@end