Added Remove from Queue right click menu item, still lacks validation. Updated KnownIssues.

CQTexperiment
areff 2008-02-22 15:26:46 +00:00
parent 85b830f76b
commit e3216e0ef1
9 changed files with 2578 additions and 2435 deletions

File diff suppressed because it is too large Load Diff

View File

@ -14,4 +14,8 @@ Repeat Album isn't implemented.
Menu items do not transform into "Hide Spotlight Panel" and
"Hide File Drawer" when they are active.
I anticipate that status should be flag based so statuses are not mutually exclusive.
I anticipate that status should be flag based so statuses are not mutually exclusive.
Right click menu item should gray out when not applicable.
Issues with queueing the same song multiple times

View File

@ -92,6 +92,7 @@ typedef enum {
// queue methods
- (IBAction)addToQueue:(id)sender;
- (IBAction)removeFromQueue:(id)sender;
- (IBAction)emptyQueueList:(id)sender;
- (NSMutableArray *)queueList;

View File

@ -399,7 +399,8 @@
for (i = 0; i < [queueList count]; i++)
{
PlaylistEntry *queueItem = [queueList objectAtIndex:i];
[queueItem setStatusMessage:[NSString stringWithFormat:@"Queued: %i", i+1]];
[queueItem setQueuePosition: i+1];
[queueItem setStatusMessage:[NSString stringWithFormat:@"Queued: %i", queueItem.queuePosition]];
}
return pe;
@ -431,7 +432,7 @@
if ([pe album] == nil)
i--;
else
i = [(PlaylistEntry *)[[filtered objectAtIndex:0] index] intValue];
i = [(NSNumber *)[[filtered objectAtIndex:0] index] intValue];
}
}
@ -649,6 +650,7 @@
{
[queueItem setStatus:[NSNumber numberWithInteger:kCogEntryNormal]];
[queueItem setStatusMessage:nil];
[queueItem setQueuePosition:-1];
}
[queueList removeAllObjects];
@ -660,10 +662,27 @@
for (PlaylistEntry *queueItem in [self selectedObjects])
{
[queueItem setStatus: [NSNumber numberWithInteger:kCogEntryQueued]];
[queueItem setStatusMessage: [NSString stringWithFormat:@"Queued: %i", [queueList count] + 1]];
[queueItem setQueuePosition: [queueList count]+1];
[queueItem setStatusMessage: [NSString stringWithFormat:@"Queued: %i", queueItem.queuePosition]];
[queueList addObject:queueItem];
}
}
- (IBAction)removeFromQueue:(id)sender
{
for (PlaylistEntry *queueItem in [self selectedObjects])
{
// temporary hack until Remove from Queue menu item gets validation.
if (queueItem.queuePosition < 0)
break;
[queueItem setStatus:[NSNumber numberWithInteger:kCogEntryNormal]];
[queueItem setStatusMessage:nil];
[queueList removeObjectAtIndex:queueItem.queuePosition - 1];
}
}
@end

View File

@ -21,6 +21,7 @@ typedef enum {
NSNumber *shuffleIndex;
NSNumber *status;
NSString *statusMessage;
int queuePosition;
NSURL *URL;
@ -53,8 +54,8 @@ typedef enum {
@property(retain) NSNumber *index;
@property(retain) NSNumber *shuffleIndex;
@property(retain) NSNumber *status;
@property(retain) NSString *statusMessage;;
@property(retain) NSString *statusMessage;
@property int queuePosition;
@property(retain) NSURL *URL;
@property(retain) NSString *artist;

View File

@ -16,6 +16,7 @@
@synthesize shuffleIndex;
@synthesize status;
@synthesize statusMessage;
@synthesize queuePosition;
@synthesize URL;

View File

@ -252,7 +252,7 @@
[pe setURL:url];
[pe setIndex:[NSNumber numberWithInt:(index+i)]];
[pe setTitle:[[url path] lastPathComponent]];
[pe setQueuePosition:-1];
[entries addObject:pe];
[pe release];

View File

@ -20,7 +20,8 @@
- (IBAction)sortByPath:(id)sender;
- (IBAction)shufflePlaylist:(id)sender;
- (BOOL)validateMenuItem:(NSMenuItem *)item;
- (IBAction)toggleColumn:(id)sender;
- (IBAction)scrollToCurrentEntry:(id)sender;

View File

@ -216,6 +216,18 @@
[queueMenuItem release];
addedItems++;
NSMenuItem *queueRemoveMenuItem = [NSMenuItem alloc];
NSString *retitle = [NSString
stringWithFormat:@"Remove from Queue"];
[queueRemoveMenuItem initWithTitle:retitle
action:@selector(removeFromQueue:)
keyEquivalent:@""];
queueRemoveMenuItem.target = playlistController;
[tableViewMenu insertItem:queueRemoveMenuItem atIndex:1];
[queueRemoveMenuItem release];
addedItems++;
if(addedItems)
{
// add a separator in the right place
@ -226,7 +238,6 @@
return [tableViewMenu autorelease];
}
- (void)keyDown:(NSEvent *)e
{
unsigned int modifiers = [e modifierFlags] & (NSCommandKeyMask | NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask);