+ NSImage *image = nil;
+ NSString *text = title;
+
+ if ( art != nil ) {
+ NSImageRep *artRep = [art bestRepresentationForDevice:nil];
+ image = [[NSImage alloc] initWithSize:NSMakeSize(110, 110)];
+ [image lockFocus];
+ {
+ [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
+ [[NSGraphicsContext currentContext] setShouldAntialias:YES];
+ [artRep drawInRect:NSMakeRect(3, 3, 104, 104)];
+ }
+ [image unlockFocus];
+ [image autorelease];
+ } else if ( source == ITMTRemoteLibrarySource ) {
+ image = [NSImage imageNamed:@"Library"];
+ } else if ( source == ITMTRemoteCDSource ) {
+ image = [NSImage imageNamed:@"CD"];
+ } else if ( source == ITMTRemoteRadioSource ) {
+ image = [NSImage imageNamed:@"Radio"];
+ } else if ( source == ITMTRemoteiPodSource ) {
+ image = [NSImage imageNamed:@"iPod"];
+ } else if ( source == ITMTRemoteGenericDeviceSource ) {
+ image = [NSImage imageNamed:@"MP3Player"];
+ } else if ( source == ITMTRemoteSharedLibrarySource ) {
+ image = [NSImage imageNamed:@"Library"];
+ }
+
+ [_window setImage:image];
+
+ if ( album ) {
+ text = [text stringByAppendingString:[@"\n" stringByAppendingString:album]];
+ }
+ if ( artist ) {
+ text = [text stringByAppendingString:[@"\n" stringByAppendingString:artist]];
+ }
+ if ( time ) {
+ text = [text stringByAppendingString:[@"\n" stringByAppendingString:time]];
+ }
+ if ( track ) {
+ text = [text stringByAppendingString:[@"\n" stringByAppendingString:track]];
+ }
+ if ( rating > -1 ) {
+
+ NSString *ratingString = [NSString string];
+ NSString *emptyChar = [NSString stringWithUTF8String:"☆"];
+ NSString *fullChar = [NSString stringWithUTF8String:"★"];
+ int i;
+
+ for ( i = 1; i < 6; i++ ) {
+
+ if ( rating >= i ) {
+ ratingString = [ratingString stringByAppendingString:fullChar];
+ } else {
+ ratingString = [ratingString stringByAppendingString:emptyChar];
+ }
+ }
+
+ text = [text stringByAppendingString:[@"\n" stringByAppendingString:ratingString]];
+ }
+
+
+ [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
+ [_window buildTextWindowWithString:text];
+ [_window appear:self];
+}
+
+- (void)showUpcomingSongsWindowWithTitles:(NSArray *)titleStrings
+{
+// NSString *bull = [NSString stringWithUTF8String:"‣ "];
+ NSString *bull = [NSString stringWithUTF8String:"♪ "];
+ NSString *end = [@"\n" stringByAppendingString:bull];
+ [_window setImage:[NSImage imageNamed:@"Upcoming"]];
+ [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
+ [_window buildTextWindowWithString:[bull stringByAppendingString:[titleStrings componentsJoinedByString:end]]];
+ [_window appear:self];
+}
+
+- (void)showVolumeWindowWithLevel:(float)level
+{
+ [_window setImage:[NSImage imageNamed:@"Volume"]];
+ [_window setSizing:(ITTransientStatusWindowSizing)[df integerForKey:@"statusWindowSizing"]];
+ [_window buildMeterWindowWithCharacter:[NSString stringWithUTF8String:"▊"]
+ size:18
+ count:10
+ active:( ceil(level * 100) / 10 )];