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 1600
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, *_statusWindowUpdateTimer;
47 BOOL timerUpdating, _checkingForServer, _popped, _open, _needsPolling;
49 int _timeUpdateCount; //Keeps track of how many times the time has been updated in the info status window
50 NSLock *_serverCheckLock;
52 + (MainController *)sharedController;
56 //Methods called from MenuController by menu items
57 - (NSDate*)getBlingTime;
69 - (void)selectPlaylistAtIndex:(int)index;
70 - (void)selectSongAtIndex:(int)index;
71 - (void)selectSongRating:(int)rating;
72 - (void)selectEQPresetAtIndex:(int)index;
73 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
75 - (void)showPreferences;
76 - (void)showTestWindow;
77 - (void)quitMenuTunes;
81 - (void)setServerStatus:(BOOL)newStatus;
82 - (int)connectToServer;
83 - (BOOL)disconnectFromServer;
84 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
85 - (void)networkError:(NSException *)exception;
89 - (ITMTRemote *)currentRemote;
92 - (void)closePreferences;
93 - (MenuController *)menuController;
95 - (void)showCurrentTrackInfo;
99 @interface NSImage (SmoothAdditions)
100 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;