Added patch from Andre Reffhaug for ctrl+left/right seeking.

CQTexperiment
vspader 2008-02-07 23:57:21 +00:00
parent aced029a97
commit be9387d30d
3 changed files with 44 additions and 0 deletions

View File

@ -56,6 +56,8 @@
- (IBAction)next:(id)sender;
- (IBAction)prev:(id)sender;
- (IBAction)seek:(id)sender;
- (IBAction)seekForward:(id)sender;
- (IBAction)seekBackward:(id)sender;
- (void)initDefaults;

View File

@ -194,6 +194,40 @@
[self updateTimeField:time];
}
- (IBAction)seekForward:(id)sender
{
double time;
time = [audioPlayer amountPlayed];
if ((time + 10) > (int)[positionSlider maxValue])
{
[self next:self];
}
else
{
[audioPlayer seekToTime:time + 10];
[self updateTimeField:time + 10];
}
}
- (IBAction)seekBackward:(id)sender
{
double time;
time = [audioPlayer amountPlayed];
if ((time - 10) < 0)
{
[audioPlayer seekToTime:0];
[self updateTimeField:0];
}
else
{
[audioPlayer seekToTime:time - 10];
[self updateTimeField:time - 10];
}
}
- (void)changePlayButtonImage:(NSString *)name
{
NSImage *img = [NSImage imageNamed:name];

View File

@ -197,6 +197,14 @@
else if (modifiers == 0 && c == 0x1b) { //Escape
[playlistController clearFilterPredicate:self];
}
else if (modifiers == NSControlKeyMask && c == 0xf703) // right arrow
{
[playbackController seekForward:self];
}
else if (modifiers == NSControlKeyMask && c == 0xf702) // left arrow
{
[playbackController seekBackward:self];
}
else
{
[super keyDown:e];