Skip to content

Commit

Permalink
Playlist View: Replace Cell-based table with View-based table. It nee…
Browse files Browse the repository at this point in the history
…ds some work still, though.
  • Loading branch information
kode54 committed Jan 20, 2022
1 parent e8f4e5e commit 2b4de10
Show file tree
Hide file tree
Showing 6 changed files with 451 additions and 63 deletions.
285 changes: 270 additions & 15 deletions Base.lproj/MainMenu.xib

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions Cog.xcodeproj/project.pbxproj
Expand Up @@ -176,7 +176,6 @@
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
8E07AB790AAC930B00A4B32F /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E07AB770AAC930B00A4B32F /* PreferencesController.m */; };
8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E1296D90A2BA9CE00443124 /* PlaylistHeaderView.m */; };
8E6889240AAA403C00AD3950 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E6889230AAA403C00AD3950 /* Carbon.framework */; };
8E75757109F31D5A0080F1EE /* DNDArrayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75752C09F31D5A0080F1EE /* DNDArrayController.m */; };
8E75757209F31D5A0080F1EE /* PlaylistController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E75752E09F31D5A0080F1EE /* PlaylistController.m */; };
Expand Down Expand Up @@ -1013,8 +1012,6 @@
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8E07AB760AAC930B00A4B32F /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = Preferences/PreferencesController.h; sourceTree = "<group>"; };
8E07AB770AAC930B00A4B32F /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PreferencesController.m; path = Preferences/PreferencesController.m; sourceTree = "<group>"; };
8E1296D80A2BA9CE00443124 /* PlaylistHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlaylistHeaderView.h; sourceTree = "<group>"; };
8E1296D90A2BA9CE00443124 /* PlaylistHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PlaylistHeaderView.m; sourceTree = "<group>"; };
8E6889230AAA403C00AD3950 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
8E75752B09F31D5A0080F1EE /* DNDArrayController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNDArrayController.h; sourceTree = "<group>"; };
8E75752C09F31D5A0080F1EE /* DNDArrayController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DNDArrayController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1760,8 +1757,6 @@
8E75752E09F31D5A0080F1EE /* PlaylistController.m */,
8E75753109F31D5A0080F1EE /* PlaylistView.h */,
8E75753209F31D5A0080F1EE /* PlaylistView.m */,
8E1296D80A2BA9CE00443124 /* PlaylistHeaderView.h */,
8E1296D90A2BA9CE00443124 /* PlaylistHeaderView.m */,
1755E1F60BA0D2B600CA3560 /* PlaylistLoader.h */,
1755E1F70BA0D2B600CA3560 /* PlaylistLoader.m */,
8E75752B09F31D5A0080F1EE /* DNDArrayController.h */,
Expand Down Expand Up @@ -2442,7 +2437,6 @@
8E75757309F31D5A0080F1EE /* PlaylistEntry.m in Sources */,
8E75757409F31D5A0080F1EE /* PlaylistView.m in Sources */,
8E75757509F31D5A0080F1EE /* Shuffle.m in Sources */,
8E1296DB0A2BA9CE00443124 /* PlaylistHeaderView.m in Sources */,
8E07AB790AAC930B00A4B32F /* PreferencesController.m in Sources */,
177EBFA70B8BC2A70000BC8C /* ImageTextCell.m in Sources */,
177EC0270B8BC2CF0000BC8C /* TrackingCell.m in Sources */,
Expand Down
56 changes: 29 additions & 27 deletions Playlist/PlaylistController.h
Expand Up @@ -37,6 +37,8 @@ typedef NS_ENUM(NSInteger, URLOrigin) {
IBOutlet PlaylistLoader *playlistLoader;
IBOutlet SpotlightWindowController *spotlightWindowController;
IBOutlet PlaybackController *playbackController;

NSValueTransformer * statusImageTransformer;

NSMutableArray *shuffleList;
NSMutableArray *queueList;
Expand All @@ -48,45 +50,45 @@ typedef NS_ENUM(NSInteger, URLOrigin) {
NSUndoManager *undoManager;
}

@property(nonatomic, retain) PlaylistEntry *currentEntry;
@property(retain) NSString *totalTime;
@property(nonatomic, retain) PlaylistEntry * _Nullable currentEntry;
@property(retain) NSString * _Nullable totalTime;

// Private Methods
- (void)updateTotalTime;
- (void)updatePlaylistIndexes;
- (IBAction)stopAfterCurrent:(id)sender;
- (IBAction)stopAfterCurrent:(id _Nullable )sender;

// PUBLIC METHODS
- (void)setShuffle:(ShuffleMode)s;
- (ShuffleMode)shuffle;
- (void)setRepeat:(RepeatMode)r;
- (RepeatMode)repeat;
- (NSArray *)filterPlaylistOnAlbum:(NSString *)album;
- (NSArray * _Nullable)filterPlaylistOnAlbum:(NSString * _Nullable)album;

- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe;
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe;
- (PlaylistEntry * _Nullable)getNextEntry:(PlaylistEntry * _Nullable)pe;
- (PlaylistEntry * _Nullable)getPrevEntry:(PlaylistEntry * _Nullable)pe;

/* Methods for undoing various actions */
- (NSUndoManager *)undoManager;
- (NSUndoManager * _Nullable)undoManager;

- (IBAction)toggleShuffle:(id)sender;
- (IBAction)toggleShuffle:(id _Nullable)sender;

- (IBAction)toggleRepeat:(id)sender;
- (IBAction)toggleRepeat:(id _Nullable)sender;

- (IBAction)randomizeList:(id)sender;
- (IBAction)randomizeList:(id _Nullable)sender;

- (IBAction)removeDuplicates:(id)sender;
- (IBAction)removeDeadItems:(id)sender;
- (IBAction)removeDuplicates:(id _Nullable)sender;
- (IBAction)removeDeadItems:(id _Nullable)sender;

- (IBAction)showEntryInFinder:(id)sender;
- (IBAction)clearFilterPredicate:(id)sender;
- (IBAction)clear:(id)sender;
- (IBAction)showEntryInFinder:(id _Nullable)sender;
- (IBAction)clearFilterPredicate:(id _Nullable)sender;
- (IBAction)clear:(id _Nullable)sender;

//- (IBAction)showTagEditor:(id)sender;

// Spotlight
- (IBAction)searchByArtist:(id)sender;
- (IBAction)searchByAlbum:(id)sender;
- (IBAction)searchByArtist:(id _Nullable)sender;
- (IBAction)searchByAlbum:(id _Nullable)sender;

// FUN PLAYLIST MANAGEMENT STUFF!
- (BOOL)next;
Expand All @@ -96,25 +98,25 @@ typedef NS_ENUM(NSInteger, URLOrigin) {
- (void)addShuffledListToFront;
- (void)resetShuffleList;

- (PlaylistEntry *)shuffledEntryAtIndex:(NSInteger)i;
- (PlaylistEntry *)entryAtIndex:(NSInteger)i;
- (PlaylistEntry * _Nullable)shuffledEntryAtIndex:(NSInteger)i;
- (PlaylistEntry * _Nullable)entryAtIndex:(NSInteger)i;

// Event inlets:
- (void)willInsertURLs:(NSArray *)urls origin:(URLOrigin)origin;
- (void)didInsertURLs:(NSArray *)urls origin:(URLOrigin)origin;
- (void)willInsertURLs:(NSArray * _Nullable)urls origin:(URLOrigin)origin;
- (void)didInsertURLs:(NSArray * _Nullable)urls origin:(URLOrigin)origin;

// queue methods
- (IBAction)toggleQueued:(id)sender;
- (IBAction)emptyQueueList:(id)sender;
- (IBAction)toggleQueued:(id _Nullable)sender;
- (IBAction)emptyQueueList:(id _Nullable)sender;
- (void)emptyQueueListUnsynced;
- (NSMutableArray *)queueList;
- (NSMutableArray * _Nullable)queueList;

// reload metadata of selection
- (IBAction)reloadTags:(id)sender;
- (IBAction)reloadTags:(id _Nullable)sender;

- (void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet *)indexSet
- (void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet * _Nullable)indexSet
toIndex:(NSUInteger)insertIndex;

- (void)insertObjectsUnsynced:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indexes;
- (void)insertObjectsUnsynced:(NSArray * _Nullable)objects atArrangedObjectIndexes:(NSIndexSet * _Nullable)indexes;

@end

0 comments on commit 2b4de10

Please sign in to comment.