-
- if ([defaults boolForKey:@"showTime"] && ( ([currentRemote currentSongElapsed] != nil) || ([currentRemote currentSongLength] != nil) )) {
- ITDebugLog(@"Add Track Elapsed (\"%@/%@\") menu item.", [currentRemote currentSongElapsed], [currentRemote currentSongLength]);
- [menu indentItem:[menu addItemWithTitle:[NSString stringWithFormat:@"%@/%@", [currentRemote currentSongElapsed], [currentRemote currentSongLength]] action:nil keyEquivalent:@""]];
- }
-
- if ([defaults boolForKey:@"showTrackRating"] && ( [currentRemote currentSongRating] != -1.0 )) {
- NSString *string = nil;
- switch ((int)([currentRemote currentSongRating] * 5)) {
- case 0:
- string = [NSString stringWithUTF8String:"☆☆☆☆☆"];
- break;
- case 1:
- string = [NSString stringWithUTF8String:"★☆☆☆☆"];
- break;
- case 2:
- string = [NSString stringWithUTF8String:"★★☆☆☆"];
- break;
- case 3:
- string = [NSString stringWithUTF8String:"★★★☆☆"];
- break;
- case 4:
- string = [NSString stringWithUTF8String:"★★★★☆"];
- break;
- case 5:
- string = [NSString stringWithUTF8String:"★★★★★"];
- break;
- }
- ITDebugLog(@"Add Track Rating (\"%@\") menu item.", string);
- [menu indentItem:[menu addItemWithTitle:string action:nil keyEquivalent:@""]];
+ }
+
+ NS_DURING
+ if ([defaults boolForKey:@"showTime"] && ( ([[[MainController sharedController] currentRemote] currentSongElapsed] != nil) || ([[[MainController sharedController] currentRemote] currentSongLength] != nil) )) {
+ ITDebugLog(@"Add Track Elapsed (\"%@/%@\") menu item.", [[[MainController sharedController] currentRemote] currentSongElapsed], [[[MainController sharedController] currentRemote] currentSongLength]);
+ [menu indentItem:[menu addItemWithTitle:[NSString stringWithFormat:@"%@/%@", [[[MainController sharedController] currentRemote] currentSongElapsed], [[[MainController sharedController] currentRemote] currentSongLength]] action:nil keyEquivalent:@""]];