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)showSongInfoWindowWithSource:(ITMTRemotePlayerSource)source
89 title: (NSString *)title
90 album: (NSString *)album
91 artist: (NSString *)artist
92 time: (NSString *)time // FLOW: Should probably be NSDate or something.
93 trackNumber: (int)trackNumber
94 trackTotal: (int)trackTotal
97 [_window setImage:[NSImage imageNamed:@"Library"]];
98 [_window buildTextWindowWithString:title];
99 [_window appear:self];
102 - (void)showUpcomingSongsWindowWithTitles:(NSArray *)titleStrings
107 - (void)showVolumeWindowWithLevel:(float)level
109 [_window setImage:[NSImage imageNamed:@"Volume"]];
110 [_window buildMeterWindowWithCharacter:[NSString stringWithUTF8String:"▊"]
112 active:( ceil(level * 100) / 10 )];
113 [_window appear:self];
116 - (void)showRatingWindowWithRating:(int)rating
121 - (void)showShuffleWindow:(BOOL)shuffle
126 - (void)showRepeatWindowWithMode:(StatusWindowRepeatMode)mode
131 - (void)showSetupQueryWindow