<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>4 45 356 240 0 0 1152 746 </string>
+ <string>4 4 356 240 0 0 1056 770 </string>
<key>IBFramework Version</key>
- <string>291.0</string>
+ <string>286.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>0</key>
[self setLatestSongIdentifier:[currentRemote playerStateUniqueIdentifier]];
latestPlaylistClass = [currentRemote currentPlaylistClass];
[menuController rebuildSubmenus];
-
+
if ( [df boolForKey:@"showSongInfoOnChange"] ) {
[self showCurrentTrackInfo];
}
NSString *title = [currentRemote currentSongTitle];
if ( title ) {
- NSString *album = nil;
- NSString *artist = nil;
- NSString *time = nil;
- int trackNumber = 0;
- int trackTotal = 0;
- int rating = 0;
+ NSString *album = nil;
+ NSString *artist = nil;
+ NSString *time = nil;
+ int trackNumber = 0;
+ int trackTotal = 0;
+ int rating = 0;
+ ITMTRemotePlayerSource source = [currentRemote currentSource];
if ( [df boolForKey:@"showAlbum"] ) {
album = [currentRemote currentSongAlbum];
time:time
trackNumber:trackNumber
trackTotal:trackTotal
- rating:rating];
+ rating:rating
+ source:source];
} else {
title = NSLocalizedString(@"noSongPlaying", @"No song is playing.");
[statusWindowController showSongWindowWithTitle:title
time:nil
trackNumber:0
trackTotal:0
- rating:0];
+ rating:0
+ source:[currentRemote currentSource]];
}
}
#import "PreferencesController.h"
#import "MainController.h"
+#import "StatusWindow.h"
+
#import <ITKit/ITHotKeyCenter.h>
#import <ITKit/ITKeyCombo.h>
#import <ITKit/ITWindowPositioning.h>
#import <ITKit/ITKeyBroadcaster.h>
+#import <ITKit/ITCutWindowEffect.h>
+#import <ITKit/ITDissolveWindowEffect.h>
+#import <ITKit/ITSlideHorizontallyWindowEffect.h>
+#import <ITKit/ITSlideVerticallyWindowEffect.h>
+#import <ITKit/ITPivotWindowEffect.h>
+
+
#define SENDER_STATE (([sender state] == NSOnState) ? YES : NO)
/*************************************************************************/
[launchPlayerAtLaunchCheckbox setTitle:[NSString stringWithFormat:@"Launch %@ when MenuTunes launches", [[controller currentRemote] playerSimpleName]]]; //This isn't localized...
}
- [window setLevel:NSStatusWindowLevel];
+// [window setLevel:NSStatusWindowLevel];
[window center];
- [window makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
+ [window makeKeyAndOrderFront:self];
}
- (IBAction)changeGeneralSetting:(id)sender
} else if ( [sender tag] == 1090) {
[df setBool:SENDER_STATE forKey:@"showTrackRating"];
}
+
[df synchronize];
}
- (IBAction)changeStatusWindowSetting:(id)sender
{
+ StatusWindow *sw = [StatusWindow sharedWindow];
+
if ( [sender tag] == 2010) {
[df setInteger:[sender selectedRow] forKey:@"statusWindowVerticalPosition"];
[df setInteger:[sender selectedColumn] forKey:@"statusWindowHorizontalPosition"];
} else if ( [sender tag] == 2020) {
// update screen selection
} else if ( [sender tag] == 2030) {
- // Update appearance effect
+ int effectTag = [[sender selectedItem] tag];
+ float time = ([df floatForKey:@"statusWindowAppearanceSpeed"] ? [df floatForKey:@"statusWindowAppearanceSpeed"] : 0.8);
+ [df setInteger:effectTag forKey:@"statusWindowAppearanceEffect"];
+
+ if ( effectTag == 2100 ) {
+ [sw setEntryEffect:[[[ITCutWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2101 ) {
+ [sw setEntryEffect:[[[ITDissolveWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2102 ) {
+ [sw setEntryEffect:[[[ITSlideVerticallyWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2103 ) {
+ [sw setEntryEffect:[[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2104 ) {
+ NSLog(@"dflhgldf");
+ [sw setEntryEffect:[[[ITPivotWindowEffect alloc] initWithWindow:sw] autorelease]];
+ }
+
+ [[sw entryEffect] setEffectTime:time];
+
} else if ( [sender tag] == 2040) {
- // Update Vanish Effect
+ int effectTag = [[sender selectedItem] tag];
+ float time = ([df floatForKey:@"statusWindowVanishSpeed"] ? [df floatForKey:@"statusWindowVanishSpeed"] : 0.8);
+
+ [df setInteger:[[sender selectedItem] tag] forKey:@"statusWindowVanishEffect"];
+
+ if ( effectTag == 2100 ) {
+ [sw setExitEffect:[[[ITCutWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2101 ) {
+ [sw setExitEffect:[[[ITDissolveWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2102 ) {
+ [sw setExitEffect:[[[ITSlideVerticallyWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2103 ) {
+ [sw setExitEffect:[[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:sw] autorelease]];
+ } else if ( effectTag == 2104 ) {
+ [sw setExitEffect:[[[ITPivotWindowEffect alloc] initWithWindow:sw] autorelease]];
+ }
+
+ [[sw exitEffect] setEffectTime:time];
+
} else if ( [sender tag] == 2050) {
- // Update appearance speed
+ float newTime = (-([sender floatValue]));
+ [df setFloat:newTime forKey:@"statusWindowAppearanceSpeed"];
+ [[sw entryEffect] setEffectTime:newTime];
} else if ( [sender tag] == 2060) {
- // Update vanish speed
+ float newTime = (-([sender floatValue]));
+ [df setFloat:newTime forKey:@"statusWindowVanishSpeed"];
+ [[sw exitEffect] setEffectTime:newTime];
} else if ( [sender tag] == 2070) {
- // Update vanish delay
+ [df setFloat:[sender floatValue] forKey:@"statusWindowVanishDelay"];
+ [sw setExitDelay:[sender floatValue]];
} else if ( [sender tag] == 2080) {
- // Update "Song Info window when song changes" setting.
[df setBool:SENDER_STATE forKey:@"showSongInfoOnChange"];
}
+
+ [df synchronize];
}
- (IBAction)changeHotKey:(id)sender
#import <Cocoa/Cocoa.h>
+#import "ITMTRemote.h"
@class StatusWindow;
@interface StatusWindowController : NSObject {
StatusWindow *_window;
+ NSUserDefaults *df;
}
-- (void)showSongWindowWithTitle:(NSString *)title
- album:(NSString *)album
- artist:(NSString *)artist
- time:(NSString *)time // FLOW: Should probably be NSDate or something.
- trackNumber: (int)trackNumber
- trackTotal: (int)trackTotal
- rating: (int)rating;
+- (void)showSongWindowWithTitle: (NSString *)title
+ album: (NSString *)album
+ artist: (NSString *)artist
+ time: (NSString *)time // FLOW: Should probably be NSDate or something.
+ trackNumber: (int)trackNumber
+ trackTotal: (int)trackTotal
+ rating: (int)rating
+ source:(ITMTRemotePlayerSource)source;
- (void)showUpcomingSongsWithTitles:(NSArray *)titleStrings;
//
#import "StatusWindowController.h"
+#import "StatusWindow.h"
+#import <ITKit/ITWindowEffect.h>
+#import <ITKit/ITCutWindowEffect.h>
+#import <ITKit/ITDissolveWindowEffect.h>
+#import <ITKit/ITSlideHorizontallyWindowEffect.h>
+#import <ITKit/ITSlideVerticallyWindowEffect.h>
+#import <ITKit/ITPivotWindowEffect.h>
@implementation StatusWindowController
-- (void)showSongWindowWithTitle:(NSString *)title
- album:(NSString *)album
- artist:(NSString *)artist
- time:(NSString *)time // FLOW: Should probably be NSDate or something.
- trackNumber: (int)trackNumber
- trackTotal: (int)trackTotal
- rating: (int)rating
+- (id)init
{
+ if ( ( self = [super init] ) ) {
+
+ float exitDelay;
+ int entryTag;
+ int exitTag;
+ float entrySpeed;
+ float exitSpeed;
+
+ ITWindowEffect *entryEffect;
+ ITWindowEffect *exitEffect;
+
+ _window = [[StatusWindow sharedWindow] retain];
+ df = [[NSUserDefaults standardUserDefaults] retain];
+
+ exitDelay = [df floatForKey:@"statusWindowVanishDelay"];
+ entryTag = [df integerForKey:@"statusWindowAppearanceEffect"];
+ exitTag = [df integerForKey:@"statusWindowVanishEffect"];
+ entrySpeed = [df floatForKey:@"statusWindowAppearanceSpeed"];
+ exitSpeed = [df floatForKey:@"statusWindowVanishSpeed"];
+
+ [_window setExitMode:ITTransientStatusWindowExitAfterDelay];
+ [_window setExitDelay:(exitDelay ? exitDelay : 4.0)];
+
+ if ( entryTag == 2101 ) {
+ entryEffect = [[[ITDissolveWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( entryTag == 2102 ) {
+ entryEffect = [[[ITSlideVerticallyWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( entryTag == 2103 ) {
+ entryEffect = [[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( entryTag == 2104 ) {
+ entryEffect = [[[ITPivotWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else {
+ entryEffect = [[[ITCutWindowEffect alloc] initWithWindow:_window] autorelease];
+ }
+
+ [_window setEntryEffect:entryEffect];
+
+ if ( exitTag == 2100 ) {
+ exitEffect = [[[ITCutWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( exitTag == 2102 ) {
+ exitEffect = [[[ITSlideVerticallyWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( exitTag == 2103 ) {
+ exitEffect = [[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else if ( exitTag == 2104 ) {
+ exitEffect = [[[ITPivotWindowEffect alloc] initWithWindow:_window] autorelease];
+ } else {
+ exitEffect = [[[ITDissolveWindowEffect alloc] initWithWindow:_window] autorelease];
+ }
+
+ [_window setExitEffect:exitEffect];
+
+ [[_window entryEffect] setEffectTime:(entrySpeed ? entrySpeed : 0.8)];
+ [[_window exitEffect] setEffectTime:(exitSpeed ? exitSpeed : 0.8)];
+ }
+
+ return self;
+}
+- (void)dealloc
+{
+ [_window release];
+ [super dealloc];
+}
+
+- (void)showSongWindowWithTitle: (NSString *)title
+ album: (NSString *)album
+ artist: (NSString *)artist
+ time: (NSString *)time // FLOW: Should probably be NSDate or something.
+ trackNumber: (int)trackNumber
+ trackTotal: (int)trackTotal
+ rating: (int)rating
+ source:(ITMTRemotePlayerSource)source
+{
+ [_window setImage:[NSImage imageNamed:@"Library"]];
+ [_window setText:title];
+ [_window appear:self];
}
- (void)showUpcomingSongsWithTitles:(NSArray *)titleStrings