1 #import "StatusWindowController.h"
2 #import "StatusWindow.h"
4 @implementation StatusWindowController
8 if ( (self = [super init]) ) {
9 [NSBundle loadNibNamed:@"StatusWindow" owner:self];
10 [statusWindow center];
15 - (void)setUpcomingSongs:(NSString *)string
18 NSArray *lines = [string componentsSeparatedByString:@"\n"];
20 for (i = 0; i < [lines count]; i++) {
21 int temp = [[lines objectAtIndex:i] sizeWithAttributes:[NSDictionary dictionaryWithObject:[NSFont fontWithName:@"Lucida Grande" size:12] forKey:NSFontAttributeName]].width;
32 [statusField setStringValue:string];
33 [statusWindow setFrame:NSMakeRect(0, 0, size + 45, 40 + ([lines count] * 15)) display:NO];
34 [statusWindow center];
35 [statusWindow makeKeyAndOrderFront:nil];
38 - (void)setTrackInfo:(NSString *)string
41 NSArray *lines = [string componentsSeparatedByString:@"\n"];
43 for (i = 0; i < [lines count]; i++) {
44 int temp = [[lines objectAtIndex:i] sizeWithAttributes:[NSDictionary dictionaryWithObject:[NSFont fontWithName:@"Lucida Grande" size:12] forKey:NSFontAttributeName]].width;
55 [statusField setStringValue:string];
56 [statusWindow setFrame:NSMakeRect(0, 0, size + 45, 40 + ([lines count] * 16)) display:NO];
57 [statusWindow center];
58 [statusWindow makeKeyAndOrderFront:nil];
63 [NSThread detachNewThreadSelector:@selector(fadeOutAux) toTarget:self withObject:nil];
68 NSAutoreleasePool *p00l = [[NSAutoreleasePool alloc] init];
70 for (i = 1.0; i > 0; i -= .003) {
71 [statusWindow setAlphaValue:i];