5 * App Controller Class.
7 * Copyright (c) 2002-2003 iThink Software
11 #import <Cocoa/Cocoa.h>
12 #import <Carbon/Carbon.h>
13 #import <ITKit/ITKit.h>
14 #import <ITFoundation/ITFoundation.h>
15 #import <ITMTRemote/ITMTRemote.h>
17 #define MT_CURRENT_VERSION 1720
19 @class StatusWindowController, MenuController, NetworkController;
21 @interface MainController : NSObject
23 ITStatusItem *statusItem;
24 NSMutableArray *remoteArray;
25 ITMTRemote *currentRemote;
27 ITMTRemotePlayerRunningState playerRunningState;
28 ITMTRemotePlayerPlaylistClass latestPlaylistClass;
30 //Used in updating the menu automatically
31 NSTimer *refreshTimer;
32 NSString *_latestSongIdentifier, *_toolTip;
33 NSDictionary *_lastTrackInfo;
35 StatusWindowController *statusWindowController; //Shows status windows
36 MenuController *menuController;
37 NetworkController *networkController;
40 NSTimer *_statusWindowUpdateTimer, *_audioscrobblerTimer;
41 BOOL timerUpdating, _checkingForServer, _popped, _open, _needsPolling;
42 int _timeUpdateCount; //Keeps track of how many times the time has been updated in the info status window
43 int _audioscrobblerInterval;
44 NSLock *_serverCheckLock;
46 + (MainController *)sharedController;
57 - (void)selectPlaylistAtIndex:(int)index;
58 - (void)selectSongAtIndex:(int)index;
59 - (void)selectSongRating:(int)rating;
60 - (void)selectEQPresetAtIndex:(int)index;
61 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
63 - (void)showPreferences;
64 - (void)showTestWindow;
65 - (void)quitMenuTunes;
69 - (void)setServerStatus:(BOOL)newStatus;
70 - (int)connectToServer;
71 - (BOOL)disconnectFromServer;
72 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
73 - (void)networkError:(NSException *)exception;
77 - (ITMTRemote *)currentRemote;
80 - (void)closePreferences;
81 - (MenuController *)menuController;
83 - (void)showCurrentAlbumArt;
84 - (void)showCurrentTrackInfo;
88 @interface NSImage (SmoothAdditions)
89 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;