Bumped to version 1.7.2. First freeware release.
[MenuTunes.git] / MainController.h
1 /*
2  *      MenuTunes
3  *  MainController
4  *    App Controller Class
5  *
6  *  Original Author : Matthew Judy <mjudy@ithinksw.com>
7  *   Responsibility : Matthew Judy <mjudy@ithinksw.com>
8  *
9  *  Copyright (c) 2002-2003 iThink Software.
10  *  All Rights Reserved
11  *
12  */
13
14
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
21 #define MT_CURRENT_VERSION 1720
22
23 @class StatusWindowController, MenuController, NetworkController;
24
25 @interface MainController : NSObject
26 {
27     ITStatusItem   *statusItem;
28     NSMutableArray *remoteArray;
29     ITMTRemote     *currentRemote;
30     
31     ITMTRemotePlayerRunningState  playerRunningState;
32     ITMTRemotePlayerPlaylistClass latestPlaylistClass;
33     
34     //Used in updating the menu automatically
35     NSTimer *refreshTimer;
36     NSString *_latestSongIdentifier, *_toolTip;
37         NSDictionary *_lastTrackInfo;
38
39     StatusWindowController *statusWindowController; //Shows status windows
40     MenuController *menuController;
41     NetworkController *networkController;
42     NSUserDefaults *df;
43     
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;
49 }
50 + (MainController *)sharedController;
51
52 - (void)menuClicked;
53
54 - (void)timerUpdate;
55
56 - (void)playPause;
57 - (void)nextSong;
58 - (void)prevSong;
59 - (void)fastForward;
60 - (void)rewind;
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;
66 - (void)showPlayer;
67 - (void)showPreferences;
68 - (void)showTestWindow;
69 - (void)quitMenuTunes;
70
71 //
72
73 - (void)setServerStatus:(BOOL)newStatus;
74 - (int)connectToServer;
75 - (BOOL)disconnectFromServer;
76 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
77 - (void)networkError:(NSException *)exception;
78
79 //
80
81 - (ITMTRemote *)currentRemote;
82 - (void)clearHotKeys;
83 - (void)setupHotKeys;
84 - (void)closePreferences;
85 - (MenuController *)menuController;
86
87 - (void)showCurrentAlbumArt;
88 - (void)showCurrentTrackInfo;
89
90 @end
91
92 @interface NSImage (SmoothAdditions)
93 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;
94 @end