6 * Original Author : Matthew Judy <mjudy@ithinksw.com>
7 * Responsibility : Matthew Judy <mjudy@ithinksw.com>
9 * Copyright (c) 2002-2003 iThink Software.
15 #import <Cocoa/Cocoa.h>
16 #import <Carbon/Carbon.h>
17 #import <ITKit/ITKit.h>
18 #import <ITFoundation/ITFoundation.h>
19 #import <ITMTRemote/ITMTRemote.h>
20 #import "MTBlingController.h"
22 #define MT_CURRENT_VERSION 1400
24 @class StatusWindowController, MenuController, NetworkController;
26 @interface MainController : NSObject
28 ITStatusItem *statusItem;
29 NSMutableArray *remoteArray;
30 ITMTRemote *currentRemote;
32 ITMTRemotePlayerRunningState playerRunningState;
33 ITMTRemotePlayerPlaylistClass latestPlaylistClass;
35 //Used in updating the menu automatically
36 NSTimer *refreshTimer;
37 NSString *_latestSongIdentifier, *_toolTip;
38 NSDictionary *_lastTrackInfo;
40 StatusWindowController *statusWindowController; //Shows status windows
41 MenuController *menuController;
42 NetworkController *networkController;
45 MTBlingController *bling;
46 NSTimer *registerTimer;
47 BOOL timerUpdating, _checkingForServer, _popped, _open;
49 NSLock *_serverCheckLock;
51 + (MainController *)sharedController;
55 //Methods called from MenuController by menu items
56 - (NSDate*)getBlingTime;
68 - (void)selectPlaylistAtIndex:(int)index;
69 - (void)selectSongAtIndex:(int)index;
70 - (void)selectSongRating:(int)rating;
71 - (void)selectEQPresetAtIndex:(int)index;
72 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
74 - (void)showPreferences;
75 - (void)showTestWindow;
76 - (void)quitMenuTunes;
80 - (void)setServerStatus:(BOOL)newStatus;
81 - (int)connectToServer;
82 - (BOOL)disconnectFromServer;
83 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
84 - (void)networkError:(NSException *)exception;
88 - (ITMTRemote *)currentRemote;
91 - (void)closePreferences;
92 - (MenuController *)menuController;
94 - (void)showCurrentTrackInfo;
98 @interface NSImage (SmoothAdditions)
99 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;