Bug Fix: Disable seeking hotkeys when unseekable
Disable the seek forward and backward actions when the current track doesn't support seeking. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
60ef6c873c
commit
b34e1b5c6d
1 changed files with 21 additions and 17 deletions
|
@ -418,6 +418,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
}
|
||||
|
||||
- (void)seekForward:(double)amount {
|
||||
if([self seekable]) {
|
||||
double seekTo = [audioPlayer amountPlayed] + amount;
|
||||
|
||||
if(seekTo > [[[playlistController currentEntry] length] doubleValue]) {
|
||||
|
@ -427,6 +428,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
[audioPlayer performSelectorOnMainThread:@selector(seekToTimeBG:) withObjects:@(seekTo), nil];
|
||||
[self setPosition:seekTo];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)eventSeekBackward:(id)sender {
|
||||
|
@ -434,6 +436,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
}
|
||||
|
||||
- (void)seekBackward:(double)amount {
|
||||
if([self seekable]) {
|
||||
double seekTo = [audioPlayer amountPlayed] - amount;
|
||||
|
||||
if(seekTo < 0)
|
||||
|
@ -443,6 +446,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
|
||||
[audioPlayer performSelectorOnMainThread:@selector(seekToTimeBG:) withObjects:@(seekTo), nil];
|
||||
[self setPosition:seekTo];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue