Um, yeah. Started working on this and did some work getting everything on the same...
[MenuTunes.git] / StatusWindowController.m
1 #import "StatusWindowController.h"
2 #import "StatusWindow.h"
3
4 @implementation StatusWindowController
5
6 - (id)init
7 {
8     if ( (self = [super init]) ) {
9         [NSBundle loadNibNamed:@"StatusWindow" owner:self];
10         [statusWindow center];
11     }
12     return self;
13 }
14
15 - (void)setUpcomingSongs:(NSString *)string numSongs:(int)songs
16 {
17     [statusField setStringValue:string];
18     [statusWindow setFrame:NSMakeRect(0, 0, 300, 40 + (songs * 17)) display:NO];
19     [statusWindow center];
20     [statusWindow makeKeyAndOrderFront:nil];
21 }
22
23 - (void)setTrackInfo:(NSString *)string lines:(int)lines
24 {
25     [statusField setStringValue:string];
26     [statusWindow setFrame:NSMakeRect(0, 0, 316, 40 + (lines * 17)) display:NO];
27     [statusWindow center];
28     [statusWindow makeKeyAndOrderFront:nil];
29 }
30
31 - (void)fadeWindowOut
32 {
33     [NSThread detachNewThreadSelector:@selector(fadeOutAux) toTarget:self withObject:nil];
34 }
35
36 - (void)fadeOutAux
37 {
38     NSAutoreleasePool *p00l = [[NSAutoreleasePool alloc] init];
39     float i;
40     for (i = 1.0; i > 0; i -= .003) {
41         [statusWindow setAlphaValue:i];
42     }
43     [statusWindow close];
44     [p00l release];
45 }
46
47 @end