Finally fixed all the memory leaks, I hope. Fixed iTunesRemote to not
[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 #import "MTBlingController.h"
21
22 #define MT_CURRENT_VERSION 1300
23
24 @class StatusWindowController, MenuController, NetworkController;
25
26 @interface MainController : NSObject
27 {
28     ITStatusItem   *statusItem;
29     NSMutableArray *remoteArray;
30     ITMTRemote     *currentRemote;
31     
32     ITMTRemotePlayerRunningState  playerRunningState;
33     ITMTRemotePlayerPlaylistClass latestPlaylistClass;
34     
35     //Used in updating the menu automatically
36     NSTimer *refreshTimer;
37     NSString *_latestSongIdentifier, *_toolTip;
38
39     StatusWindowController *statusWindowController; //Shows status windows
40     MenuController *menuController;
41     NetworkController *networkController;
42     NSUserDefaults *df;
43     
44     MTBlingController *bling;
45     NSTimer *registerTimer;
46     BOOL timerUpdating, _checkingForServer, _popped;
47     BOOL blinged;
48     NSLock *_serverCheckLock;
49 }
50 + (MainController *)sharedController;
51
52 - (void)menuClicked;
53
54 //Methods called from MenuController by menu items
55 - (NSDate*)getBlingTime;
56 - (void)blingTime;
57 - (void)blingNow;
58 - (BOOL)blingBling;
59
60 - (void)timerUpdate;
61
62 - (void)playPause;
63 - (void)nextSong;
64 - (void)prevSong;
65 - (void)fastForward;
66 - (void)rewind;
67 - (void)selectPlaylistAtIndex:(int)index;
68 - (void)selectSongAtIndex:(int)index;
69 - (void)selectSongRating:(int)rating;
70 - (void)selectEQPresetAtIndex:(int)index;
71 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
72 - (void)showPlayer;
73 - (void)showPreferences;
74 - (void)showTestWindow;
75 - (void)quitMenuTunes;
76
77 //
78
79 - (void)setServerStatus:(BOOL)newStatus;
80 - (int)connectToServer;
81 - (BOOL)disconnectFromServer;
82 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
83 - (void)networkError:(NSException *)exception;
84
85 //
86
87 - (ITMTRemote *)currentRemote;
88 - (void)clearHotKeys;
89 - (void)setupHotKeys;
90 - (void)closePreferences;
91 - (MenuController *)menuController;
92
93 - (void)showCurrentTrackInfo;
94
95 @end
96
97 @interface NSImage (SmoothAdditions)
98 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;
99 @end