STATUS WINDOWS NOW EXIST IN MENUTUNES. Some work left to do on them, then positioni...
authorMatthew Judy <mjudy@ithinksw.com>
Fri, 12 Sep 2003 22:12:01 +0000 (22:12 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Fri, 12 Sep 2003 22:12:01 +0000 (22:12 +0000)
English.lproj/Preferences.nib/info.nib
English.lproj/Preferences.nib/keyedobjects.nib
MainController.m
PreferencesController.m
StatusWindowController.h
StatusWindowController.m

index 4b7fcb4..2aff2c8 100755 (executable)
@@ -3,9 +3,9 @@
 <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>
index 5d1895e..62f97d5 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index f6838d9..681da56 100755 (executable)
@@ -177,7 +177,7 @@ static MainController *sharedController;
         [self setLatestSongIdentifier:[currentRemote playerStateUniqueIdentifier]];
         latestPlaylistClass = [currentRemote currentPlaylistClass];
         [menuController rebuildSubmenus];
-        
+
         if ( [df boolForKey:@"showSongInfoOnChange"] ) {
             [self showCurrentTrackInfo];
         }
@@ -424,12 +424,13 @@ static MainController *sharedController;
     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];
@@ -458,7 +459,8 @@ static MainController *sharedController;
                                                    time:time
                                             trackNumber:trackNumber
                                              trackTotal:trackTotal
-                                                 rating:rating];
+                                                 rating:rating
+                                                 source:source];
     } else {
         title = NSLocalizedString(@"noSongPlaying", @"No song is playing.");
         [statusWindowController showSongWindowWithTitle:title
@@ -467,7 +469,8 @@ static MainController *sharedController;
                                                    time:nil
                                             trackNumber:0
                                              trackTotal:0
-                                                 rating:0];
+                                                 rating:0
+                                                 source:[currentRemote currentSource]];
     }
 }
 
index 9526d8f..1cc9355 100755 (executable)
@@ -1,10 +1,19 @@
 #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)
 
 /*************************************************************************/
@@ -93,10 +102,10 @@ static PreferencesController *prefs = nil;
         [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
@@ -122,11 +131,14 @@ static PreferencesController *prefs = nil;
     } 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"];
@@ -134,19 +146,61 @@ static PreferencesController *prefs = nil;
     } 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
index 9f474b5..804c090 100755 (executable)
@@ -13,6 +13,7 @@
 
 
 #import <Cocoa/Cocoa.h>
+#import "ITMTRemote.h"
 
 
 @class StatusWindow;
@@ -32,15 +33,17 @@ typedef enum {
 
 @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;
 
index c22e2a5..146c1a8 100755 (executable)
@@ -7,20 +7,96 @@
 //
 
 #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