cog/Playlist/PlaylistView.m

73 lines
1.1 KiB
Matlab
Raw Normal View History

2005-06-02 18:16:43 +00:00
//
// PlaylistView.m
// Cog
//
// Created by Vincent Spader on 3/20/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 "PlaylistView.h"
2006-01-20 15:22:03 +00:00
#import "PlaybackController.h"
2005-06-02 18:16:43 +00:00
#import "PlaylistController.h"
@implementation PlaylistView
- (BOOL)acceptsFirstResponder
{
return YES;
}
- (BOOL)resignFirstResponder
{
return YES;
}
2005-06-30 17:46:07 +00:00
- (BOOL)acceptsFirstMouse:(NSEvent *)mouseDownEvent
{
return NO;
}
2005-06-02 18:16:43 +00:00
- (void)mouseDown:(NSEvent *)e
{
// DBLog(@"MOUSE DOWN");
if ([e type] == NSLeftMouseDown && [e clickCount] == 2)
{
2006-01-20 15:22:03 +00:00
[playbackController play:self];
2005-06-02 18:16:43 +00:00
}
else
{
// DBLog(@"Super");
[super mouseDown:e];
}
}
- (void)keyDown:(NSEvent *)e
{
NSString *s;
unichar c;
s = [e charactersIgnoringModifiers];
if ([s length] != 1)
return;
c = [s characterAtIndex:0];
if (c == NSDeleteCharacter)
{
[playlistController remove:self];
}
else if (c == ' ')
{
2006-01-20 15:22:03 +00:00
[playbackController playPauseResume:self];
2005-06-02 18:16:43 +00:00
}
else if (c == NSEnterCharacter || c == NSCarriageReturnCharacter)
{
2006-01-20 15:22:03 +00:00
[playbackController play:self];
2005-06-02 18:16:43 +00:00
}
else
{
[super keyDown:e];
}
}
@end