Skip to content

Commit

Permalink
Also doesn't help that even though we get the right current play posi…
Browse files Browse the repository at this point in the history
…tion from iTunes now (instead of just 3), we were hiding progress unless we had no progress info.
  • Loading branch information
uliwitness committed Apr 27, 2015
1 parent 7081973 commit 6ede0b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iTunesCantComplainView.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (void)drawRect: (NSRect)rect
[currTrackAlbum drawAtPoint: NSMakePoint(desiredBox.origin.x,desiredBox.origin.y + (340.0f * scaleFactor)) withAttributes: tinyAttrs];

// Indicate playback progress:
if( self.currTrackPercentage < 0 )
if( self.currTrackPercentage >= 0 )
{
NSRect progressBox = NSMakeRect(NSMinX(desiredBox), NSMinY(desiredBox) -(24.0 * scaleFactor), desiredBox.size.width, (12.0 *scaleFactor));
[[NSColor colorWithCalibratedWhite: 1.0 alpha: 0.3] set];
Expand Down Expand Up @@ -211,7 +211,7 @@ -(void) iTunesTrackChanged: (NSNotification*)notif
// Determine where in the song we are:
float duration = [currTrack duration];
float percentage = [itunes playerPosition] / duration;
[self setCurrTrackPercentage: (duration > 0) ? percentage : -1];
[self setCurrTrackPercentage: (duration > 0) ? percentage : -1.0];
NSLog(@"duration: %f pos: %ld percentage: %f", [currTrack duration], (long)[itunes playerPosition], percentage);

// If we don't have a regular track, but a stream, Album will be NIL.
Expand Down

0 comments on commit 6ede0b9

Please sign in to comment.