+- (void)updateTime:(NSTimer *)timer
+{
+ StatusWindow *sw = [StatusWindow sharedWindow];
+ _timeUpdateCount++;
+ if (_timeUpdateCount < (int)[sw exitDelay] + (int)[[sw exitEffect] effectTime] + (int)[[sw entryEffect] effectTime]) {
+ NSString *time = nil, *length;
+ NS_DURING
+ length = [[self currentRemote] currentSongLength];
+ if (length) {
+ time = [NSString stringWithFormat:@"%@: %@ / %@",
+ NSLocalizedString(@"time", @"Time"),
+ [[self currentRemote] currentSongElapsed],
+ length];
+ [[StatusWindowController sharedController] updateTime:time];
+ }
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
+ } else {
+ [self invalidateStatusWindowUpdateTimer];
+ }
+}
+
+- (void)invalidateStatusWindowUpdateTimer
+{
+ if (_statusWindowUpdateTimer) {
+ [_statusWindowUpdateTimer invalidate];
+ _statusWindowUpdateTimer = nil;
+ }
+}
+