Notifications: Only send position notifications periodically
This commit is contained in:
parent
de193b70e2
commit
5c17dc9207
1 changed files with 6 additions and 8 deletions
|
@ -257,8 +257,6 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
[self setPosition:pos];
|
[self setPosition:pos];
|
||||||
|
|
||||||
[[playlistController currentEntry] setCurrentPosition:pos];
|
[[playlistController currentEntry] setCurrentPosition:pos];
|
||||||
|
|
||||||
[self sendMetaData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)seek:(id)sender
|
- (IBAction)seek:(id)sender
|
||||||
|
@ -272,8 +270,6 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
[self setPosition:time];
|
[self setPosition:time];
|
||||||
|
|
||||||
[[playlistController currentEntry] setCurrentPosition:time];
|
[[playlistController currentEntry] setCurrentPosition:time];
|
||||||
|
|
||||||
[self sendMetaData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)seek:(id)sender toTime:(NSTimeInterval)position
|
- (IBAction)seek:(id)sender toTime:(NSTimeInterval)position
|
||||||
|
@ -313,11 +309,10 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
lastPosition = -10;
|
||||||
[audioPlayer seekToTime:seekTo];
|
[audioPlayer seekToTime:seekTo];
|
||||||
[self setPosition:seekTo];
|
[self setPosition:seekTo];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self sendMetaData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)eventSeekBackward:(id)sender
|
- (IBAction)eventSeekBackward:(id)sender
|
||||||
|
@ -332,10 +327,10 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
if (seekTo < 0)
|
if (seekTo < 0)
|
||||||
seekTo = 0;
|
seekTo = 0;
|
||||||
|
|
||||||
|
lastPosition = -10;
|
||||||
|
|
||||||
[audioPlayer seekToTime:seekTo];
|
[audioPlayer seekToTime:seekTo];
|
||||||
[self setPosition:seekTo];
|
[self setPosition:seekTo];
|
||||||
|
|
||||||
[self sendMetaData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -856,6 +851,9 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe)
|
||||||
[[NSUserDefaults standardUserDefaults] setInteger:lastTrackPlaying forKey:@"lastTrackPlaying"];
|
[[NSUserDefaults standardUserDefaults] setInteger:lastTrackPlaying forKey:@"lastTrackPlaying"];
|
||||||
[[NSUserDefaults standardUserDefaults] setDouble:p forKey:@"lastTrackPosition"];
|
[[NSUserDefaults standardUserDefaults] setDouble:p forKey:@"lastTrackPosition"];
|
||||||
|
|
||||||
|
// If we handle this here, then it will send on all seek operations, which also reset lastPosition
|
||||||
|
[self sendMetaData];
|
||||||
|
|
||||||
lastPosition = p;
|
lastPosition = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue