2 // StatusWindowController.m
5 // Created by Matthew L. Judy on Thu Apr 17 2003.
6 // Copyright (c) 2003 NibFile.com. All rights reserved.
9 #import "StatusWindowController.h"
10 #import "StatusWindow.h"
12 #import <ITKit/ITWindowEffect.h>
13 #import <ITKit/ITCutWindowEffect.h>
14 #import <ITKit/ITDissolveWindowEffect.h>
15 #import <ITKit/ITSlideHorizontallyWindowEffect.h>
16 #import <ITKit/ITSlideVerticallyWindowEffect.h>
17 #import <ITKit/ITPivotWindowEffect.h>
19 @implementation StatusWindowController
24 if ( ( self = [super init] ) ) {
32 ITWindowEffect *entryEffect;
33 ITWindowEffect *exitEffect;
35 _window = [[StatusWindow sharedWindow] retain];
36 df = [[NSUserDefaults standardUserDefaults] retain];
38 exitDelay = [df floatForKey:@"statusWindowVanishDelay"];
39 entryTag = [df integerForKey:@"statusWindowAppearanceEffect"];
40 exitTag = [df integerForKey:@"statusWindowVanishEffect"];
41 entrySpeed = [df floatForKey:@"statusWindowAppearanceSpeed"];
42 exitSpeed = [df floatForKey:@"statusWindowVanishSpeed"];
44 [_window setExitMode:ITTransientStatusWindowExitAfterDelay];
45 [_window setExitDelay:(exitDelay ? exitDelay : 4.0)];
47 if ( entryTag == 2101 ) {
48 entryEffect = [[[ITDissolveWindowEffect alloc] initWithWindow:_window] autorelease];
49 } else if ( entryTag == 2102 ) {
50 entryEffect = [[[ITSlideVerticallyWindowEffect alloc] initWithWindow:_window] autorelease];
51 } else if ( entryTag == 2103 ) {
52 entryEffect = [[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:_window] autorelease];
53 } else if ( entryTag == 2104 ) {
54 entryEffect = [[[ITPivotWindowEffect alloc] initWithWindow:_window] autorelease];
56 entryEffect = [[[ITCutWindowEffect alloc] initWithWindow:_window] autorelease];
59 [_window setEntryEffect:entryEffect];
61 if ( exitTag == 2100 ) {
62 exitEffect = [[[ITCutWindowEffect alloc] initWithWindow:_window] autorelease];
63 } else if ( exitTag == 2102 ) {
64 exitEffect = [[[ITSlideVerticallyWindowEffect alloc] initWithWindow:_window] autorelease];
65 } else if ( exitTag == 2103 ) {
66 exitEffect = [[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:_window] autorelease];
67 } else if ( exitTag == 2104 ) {
68 exitEffect = [[[ITPivotWindowEffect alloc] initWithWindow:_window] autorelease];
70 exitEffect = [[[ITDissolveWindowEffect alloc] initWithWindow:_window] autorelease];
73 [_window setExitEffect:exitEffect];
75 [[_window entryEffect] setEffectTime:(entrySpeed ? entrySpeed : 0.8)];
76 [[_window exitEffect] setEffectTime:(exitSpeed ? exitSpeed : 0.8)];
88 - (void)showSongWindowWithTitle: (NSString *)title
89 album: (NSString *)album
90 artist: (NSString *)artist
91 time: (NSString *)time // FLOW: Should probably be NSDate or something.
92 trackNumber: (int)trackNumber
93 trackTotal: (int)trackTotal
95 source:(ITMTRemotePlayerSource)source
97 [_window setImage:[NSImage imageNamed:@"Library"]];
98 [_window setText:title];
99 [_window appear:self];
102 - (void)showUpcomingSongsWithTitles:(NSArray *)titleStrings
107 - (void)showVolumeWindowWithLevel:(float)level
109 [_window setImage:[NSImage imageNamed:@"Volume"]];
110 [_window setVolume:level];
111 [_window appear:self];
114 - (void)showRatingWindowWithLevel:(int)level
119 - (void)showShuffleWindowWithMode:(MTStatusWindowShuffleMode)mode
124 - (void)showLoopWindowWithMode:(MTStatusWindowLoopMode)mode