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>
21 #define MT_CURRENT_VERSION 1720
23 @class StatusWindowController, MenuController, NetworkController;
25 @interface MainController : NSObject
27 ITStatusItem *statusItem;
28 NSMutableArray *remoteArray;
29 ITMTRemote *currentRemote;
31 ITMTRemotePlayerRunningState playerRunningState;
32 ITMTRemotePlayerPlaylistClass latestPlaylistClass;
34 //Used in updating the menu automatically
35 NSTimer *refreshTimer;
36 NSString *_latestSongIdentifier, *_toolTip;
37 NSDictionary *_lastTrackInfo;
39 StatusWindowController *statusWindowController; //Shows status windows
40 MenuController *menuController;
41 NetworkController *networkController;
44 NSTimer *_statusWindowUpdateTimer, *_audioscrobblerTimer;
45 BOOL timerUpdating, _checkingForServer, _popped, _open, _needsPolling;
46 int _timeUpdateCount; //Keeps track of how many times the time has been updated in the info status window
47 int _audioscrobblerInterval;
48 NSLock *_serverCheckLock;
50 + (MainController *)sharedController;
61 - (void)selectPlaylistAtIndex:(int)index;
62 - (void)selectSongAtIndex:(int)index;
63 - (void)selectSongRating:(int)rating;
64 - (void)selectEQPresetAtIndex:(int)index;
65 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
67 - (void)showPreferences;
68 - (void)showTestWindow;
69 - (void)quitMenuTunes;
73 - (void)setServerStatus:(BOOL)newStatus;
74 - (int)connectToServer;
75 - (BOOL)disconnectFromServer;
76 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
77 - (void)networkError:(NSException *)exception;
81 - (ITMTRemote *)currentRemote;
84 - (void)closePreferences;
85 - (MenuController *)menuController;
87 - (void)showCurrentAlbumArt;
88 - (void)showCurrentTrackInfo;
92 @interface NSImage (SmoothAdditions)
93 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;