Merge branch 'master' of git://github.com/ksuther/MenuTunes
[MenuTunes.git] / MainController.h
1 /*
2  *      MenuTunes
3  *      MainController.h
4  *
5  *      App Controller Class.
6  *
7  *      Copyright (c) 2002-2003 iThink Software
8  *
9  */
10
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>
16
17 #define MT_CURRENT_VERSION 1720
18
19 @class StatusWindowController, MenuController, NetworkController;
20
21 @interface MainController : NSObject
22 {
23     ITStatusItem   *statusItem;
24     NSMutableArray *remoteArray;
25     ITMTRemote     *currentRemote;
26     
27     ITMTRemotePlayerRunningState  playerRunningState;
28     ITMTRemotePlayerPlaylistClass latestPlaylistClass;
29     
30     //Used in updating the menu automatically
31     NSTimer *refreshTimer;
32     NSString *_latestSongIdentifier, *_toolTip;
33         NSDictionary *_lastTrackInfo;
34
35     StatusWindowController *statusWindowController; //Shows status windows
36     MenuController *menuController;
37     NetworkController *networkController;
38     NSUserDefaults *df;
39     
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;
45 }
46 + (MainController *)sharedController;
47
48 - (void)menuClicked;
49
50 - (void)timerUpdate;
51
52 - (void)playPause;
53 - (void)nextSong;
54 - (void)prevSong;
55 - (void)fastForward;
56 - (void)rewind;
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;
62 - (void)showPlayer;
63 - (void)showPreferences;
64 - (void)showTestWindow;
65 - (void)quitMenuTunes;
66
67 //
68
69 - (void)setServerStatus:(BOOL)newStatus;
70 - (int)connectToServer;
71 - (BOOL)disconnectFromServer;
72 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
73 - (void)networkError:(NSException *)exception;
74
75 //
76
77 - (ITMTRemote *)currentRemote;
78 - (void)clearHotKeys;
79 - (void)setupHotKeys;
80 - (void)closePreferences;
81 - (MenuController *)menuController;
82
83 - (void)showCurrentAlbumArt;
84 - (void)showCurrentTrackInfo;
85
86 @end
87
88 @interface NSImage (SmoothAdditions)
89 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;
90 @end