- (void)updateTime:(NSTimer *)timer
{
+ StatusWindow *sw = [StatusWindow sharedWindow];
_timeUpdateCount++;
- if (_timeUpdateCount > (int)[df floatForKey:@"statusWindowVanishDelay"] - 1) {
+ if (_timeUpdateCount < (int)[sw exitDelay] + (int)[[sw exitEffect] effectTime] + (int)[[sw entryEffect] effectTime]) {
NSString *time = nil;
NS_DURING
time = [NSString stringWithFormat:@"%@: %@ / %@",
NS_HANDLER
[self networkError:localException];
NS_ENDHANDLER
+ } else {
+ [timer invalidate];
}
}
- (void)toggleSongShufflable
{
- NS_DURING
- BOOL flag = ![[self currentRemote] currentSongShufflable];
- ITDebugLog(@"Toggling shufflability.");
- [[self currentRemote] setCurrentSongShufflable:flag];
- //Show song shufflability status window
- //[statusWindowController showSongShuffabilityWindow:flag];
- NS_HANDLER
- [self networkError:localException];
- NS_ENDHANDLER
+ if ([self songIsPlaying]) {
+ NS_DURING
+ BOOL flag = ![[self currentRemote] currentSongShufflable];
+ ITDebugLog(@"Toggling shufflability.");
+ [[self currentRemote] setCurrentSongShufflable:flag];
+ //Show song shufflability status window
+ [statusWindowController showSongShufflabilityWindow:flag];
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
+ }
}
- (void)registerNowOK