Added patch from Andre Reffhaug for ctrl+left/right seeking.
parent
aced029a97
commit
be9387d30d
|
@ -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;
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue