X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/5e4dec969868a410da088273791f228def3b36a7..8cd402b5d3e43c95046af7ac0e4cb3cde2d622bc:/MainController.m diff --git a/MainController.m b/MainController.m index 7b008dd..9a8b493 100755 --- a/MainController.m +++ b/MainController.m @@ -1080,6 +1080,8 @@ static MainController *sharedController; NS_HANDLER [self networkError:localException]; NS_ENDHANDLER + _timeUpdateCount = 0; + [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateTime:) userInfo:nil repeats:YES]; } if ( [df boolForKey:@"showTrackNumber"] ) { @@ -1136,6 +1138,23 @@ static MainController *sharedController; image:art]; } +- (void)updateTime:(NSTimer *)timer +{ + _timeUpdateCount++; + if (_timeUpdateCount > (int)[df floatForKey:@"statusWindowVanishDelay"] - 1) { + NSString *time = nil; + NS_DURING + time = [NSString stringWithFormat:@"%@: %@ / %@", + NSLocalizedString(@"time", @"Time"), + [[self currentRemote] currentSongElapsed], + [[self currentRemote] currentSongLength]]; + [[StatusWindowController sharedController] updateTime:time]; + NS_HANDLER + [self networkError:localException]; + NS_ENDHANDLER + } +} + - (void)showUpcomingSongs { int numSongs = 0;