diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib index 1be2d504e..1ccb753ed 100644 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -129,6 +129,8 @@ }, { ACTIONS = { + clear = id; + clearFilterPredicate = id; showEntryInFinder = id; takeRepeatFromObject = id; takeShuffleFromObject = id; @@ -146,7 +148,12 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {shufflePlaylist = id; sortByPath = id; toggleColumn = id; }; + ACTIONS = { + scrollToCurrentEntry = id; + shufflePlaylist = id; + sortByPath = id; + toggleColumn = id; + }; CLASS = PlaylistView; LANGUAGE = ObjC; OUTLETS = { diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib index d0efa14e9..7172d9880 100644 --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -34,12 +34,12 @@ 4 IBOpenObjects - 513 - 29 - 21 - 1156 1307 1324 + 29 + 513 + 21 + 1156 463 1063 diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 2a01fc082..f9205b7ce 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/Playlist/PlaylistController.h b/Playlist/PlaylistController.h index b8b2ad72f..2316c8145 100644 --- a/Playlist/PlaylistController.h +++ b/Playlist/PlaylistController.h @@ -45,6 +45,8 @@ - (IBAction)randomizeList; - (IBAction)showEntryInFinder:(id)sender; +- (IBAction)clearFilterPredicate:(id)sender; +- (IBAction)clear:(id)sender; - (void)setTotalTimeDisplay:(NSString *)ttd; - (NSString *)totalTimeDisplay; diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 381300248..ffcca86f6 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -430,6 +430,16 @@ return repeat; } +- (IBAction)clear:(id)sender +{ + [self removeObjects:[self content]]; +} + +- (IBAction)clearFilterPredicate:(id)sender +{ + [self setFilterPredicate:nil]; +} + - (void)setFilterPredicate:(NSPredicate *)filterPredicate { [super setFilterPredicate:filterPredicate]; diff --git a/Playlist/PlaylistView.h b/Playlist/PlaylistView.h index 9a1880181..a30b53890 100644 --- a/Playlist/PlaylistView.h +++ b/Playlist/PlaylistView.h @@ -25,5 +25,7 @@ - (IBAction)toggleColumn:(id)sender; +- (IBAction)scrollToCurrentEntry:(id)sender; + @end diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index 7bac221b8..d0dad756c 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -175,33 +175,45 @@ - (void)keyDown:(NSEvent *)e { - NSString *s; + unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask); + NSString *characters = [e characters]; unichar c; + NSLog(@"DOWN!"); + if ([characters length] != 1) { + [super keyDown:e]; - s = [e charactersIgnoringModifiers]; - if ([s length] != 1) return; - - c = [s characterAtIndex:0]; - - if (c == NSDeleteCharacter || c == NSBackspaceCharacter || c == NSDeleteFunctionKey) + } + + c = [characters characterAtIndex:0]; + NSLog(@"Modifiers: %i", modifiers); + if (modifiers == 0 && (c == NSDeleteCharacter || c == NSBackspaceCharacter || c == NSDeleteFunctionKey)) { [playlistController remove:self]; } - else if (c == ' ') + else if (modifiers == 0 && c == ' ') { [playbackController playPauseResume:self]; } - else if (c == NSEnterCharacter || c == NSCarriageReturnCharacter) + else if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter)) { [playbackController play:self]; } + else if (modifiers == 0 && c == 0x1b) { //Escape + NSLog(@"ESCAPE!"); + [playlistController clearFilterPredicate:self]; + } else { [super keyDown:e]; } } +- (IBAction)scrollToCurrentEntry:(id)sender +{ + [self scrollRowToVisible:[(NSNumber *)[[playlistController currentEntry] index] intValue]]; +} + - (IBAction)sortByPath:(id)sender { [self setSortDescriptors:nil]; diff --git a/TODO b/TODO index e04ad6bfc..99ee9a1f5 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,7 @@ Bug fixes: Broken MP3: http://sbooth.org/forums/viewtopic.php?t=1103 - Windows M3U paths: http://sbooth.org/forums/viewtopic.php?t=1209 ? Playlist display: http://sbooth.org/forums/viewtopic.php?t=1050 - Fix playlist logic. http://sbooth.org/forums/viewtopic.php?t=762&highlight=document+based+playlist + Fix playlist logic. http://sbooth.org/forums/viewtopic.php?t=762 Note: Never load duplicates in a group of files. Ex: If you load an m3u containing a bunch of files AND the files themselves, only load them once! However, if you load the m3u, THEN load the group of files, they should appear twice! Hook up various menu items. Add missing functions and generally fix the menu. Problems with 3rd party devices. http://sbooth.org/forums/viewtopic.php?t=255