[Play Counts] Track play counts of correct track
Track play counts for the correct track, even on short tracks. Also correctly track the play count of the last played item in the play queue which stops with bufferChain set to nil, so the previous iteration was not tracking it. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
ae019409c5
commit
2ed78a0639
|
@ -39,6 +39,8 @@ using std::atomic_bool;
|
||||||
id nextStreamUserInfo;
|
id nextStreamUserInfo;
|
||||||
NSDictionary *nextStreamRGInfo;
|
NSDictionary *nextStreamRGInfo;
|
||||||
|
|
||||||
|
id previousUserInfo; // Track currently last heard track for play counts
|
||||||
|
|
||||||
id delegate;
|
id delegate;
|
||||||
|
|
||||||
BOOL outputLaunched;
|
BOOL outputLaunched;
|
||||||
|
|
|
@ -113,6 +113,7 @@
|
||||||
outputLaunched = NO;
|
outputLaunched = NO;
|
||||||
startedPaused = paused;
|
startedPaused = paused;
|
||||||
initialBufferFilled = NO;
|
initialBufferFilled = NO;
|
||||||
|
previousUserInfo = userInfo;
|
||||||
|
|
||||||
[bufferChain launchThreads];
|
[bufferChain launchThreads];
|
||||||
|
|
||||||
|
@ -296,6 +297,8 @@
|
||||||
|
|
||||||
- (BOOL)endOfInputReached:(BufferChain *)sender // Sender is a BufferChain
|
- (BOOL)endOfInputReached:(BufferChain *)sender // Sender is a BufferChain
|
||||||
{
|
{
|
||||||
|
previousUserInfo = [sender userInfo];
|
||||||
|
|
||||||
BufferChain *newChain = nil;
|
BufferChain *newChain = nil;
|
||||||
|
|
||||||
if(atomic_load_explicit(&resettingNow, memory_order_relaxed))
|
if(atomic_load_explicit(&resettingNow, memory_order_relaxed))
|
||||||
|
@ -424,9 +427,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reportPlayCount {
|
- (void)reportPlayCount {
|
||||||
if(bufferChain) {
|
[self reportPlayCountForTrack:previousUserInfo];
|
||||||
[self reportPlayCountForTrack:[bufferChain userInfo]];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)selectNextBuffer {
|
- (BOOL)selectNextBuffer {
|
||||||
|
|
Loading…
Reference in New Issue