sharedController = self;
remoteArray = [[NSMutableArray alloc] initWithCapacity:1];
- statusWindowController = [[StatusWindowController alloc] init];
+ statusWindowController = [StatusWindowController sharedController];
menuController = [[MenuController alloc] init];
df = [[NSUserDefaults standardUserDefaults] retain];
}
[statusItem setImage:[NSImage imageNamed:@"MenuNormal"]];
[statusItem setAlternateImage:[NSImage imageNamed:@"MenuInverted"]];
+
+ [NSApp deactivate];
}
- (ITMTRemote *)loadRemote
[menuController rebuildSubmenus];
if ( [df boolForKey:@"showSongInfoOnChange"] ) {
-// [self performSelector:@selector(showCurrentTrackInfo) withObject:nil afterDelay:0.0];
+ [self performSelector:@selector(showCurrentTrackInfo) withObject:nil afterDelay:0.0];
}
}
}
NSString *album = nil;
NSString *artist = nil;
NSString *time = nil;
- int trackNumber = 0;
- int trackTotal = 0;
+ NSString *track = nil;
int rating = -1;
+
ITDebugLog(@"Showing track info status window.");
+
if ( title ) {
if ( [df boolForKey:@"showAlbum"] ) {
}
if ( [df boolForKey:@"showTime"] ) {
- time = [currentRemote currentSongLength];
+ time = [NSString stringWithFormat:@"%@: %@ / %@",
+ @"Time",
+ [currentRemote currentSongElapsed],
+ [currentRemote currentSongLength]];
}
- if ( [df boolForKey:@"showNumber"] ) {
- trackNumber = [currentRemote currentSongTrack];
- trackTotal = [currentRemote currentAlbumTrackCount];
+ if ( [df boolForKey:@"showTrackNumber"] ) {
+ int trackNo = [currentRemote currentSongTrack];
+ int trackCount = [currentRemote currentAlbumTrackCount];
+
+ if ( (trackNo > 0) || (trackCount > 0) ) {
+ track = [NSString stringWithFormat:@"%@: %i %@ %i",
+ @"Track", trackNo, @"of", trackCount];
+ }
}
- if ( [df boolForKey:@"showRating"] ) {
+ if ( [df boolForKey:@"showTrackRating"] ) {
rating = ( [currentRemote currentSongRating] * 5 );
}
album:album
artist:artist
time:time
- trackNumber:trackNumber
- trackTotal:trackTotal
+ track:track
rating:rating];
}
- (void)toggleShuffle
{
- bool newShuffleEnabled = ![currentRemote shuffleEnabled];
+ BOOL newShuffleEnabled = ( ! [currentRemote shuffleEnabled] );
ITDebugLog(@"Toggling shuffle mode.");
[currentRemote setShuffleEnabled:newShuffleEnabled];
//Show shuffle status window
ITDebugLog(@"Setting shuffle mode to %i", newShuffleEnabled);
- [statusWindowController showRepeatWindowWithMode:newShuffleEnabled];
+ [statusWindowController showShuffleWindow:newShuffleEnabled];
}
/*************************************************************************/