Submissions work now. Committing before I break something by adding queues.
[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 1600
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         NSDictionary *_lastTrackInfo;
39
40     StatusWindowController *statusWindowController; //Shows status windows
41     MenuController *menuController;
42     NetworkController *networkController;
43     NSUserDefaults *df;
44     
45     MTBlingController *bling;
46     NSTimer *registerTimer, *_statusWindowUpdateTimer;
47     BOOL timerUpdating, _checkingForServer, _popped, _open, _needsPolling;
48     BOOL blinged;
49         int _timeUpdateCount; //Keeps track of how many times the time has been updated in the info status window
50     NSLock *_serverCheckLock;
51 }
52 + (MainController *)sharedController;
53
54 - (void)menuClicked;
55
56 //Methods called from MenuController by menu items
57 - (NSDate*)getBlingTime;
58 - (void)blingTime;
59 - (void)blingNow;
60 - (BOOL)blingBling;
61
62 - (void)timerUpdate;
63
64 - (void)playPause;
65 - (void)nextSong;
66 - (void)prevSong;
67 - (void)fastForward;
68 - (void)rewind;
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;
74 - (void)showPlayer;
75 - (void)showPreferences;
76 - (void)showTestWindow;
77 - (void)quitMenuTunes;
78
79 //
80
81 - (void)setServerStatus:(BOOL)newStatus;
82 - (int)connectToServer;
83 - (BOOL)disconnectFromServer;
84 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
85 - (void)networkError:(NSException *)exception;
86
87 //
88
89 - (ITMTRemote *)currentRemote;
90 - (void)clearHotKeys;
91 - (void)setupHotKeys;
92 - (void)closePreferences;
93 - (MenuController *)menuController;
94
95 - (void)showCurrentTrackInfo;
96
97 @end
98
99 @interface NSImage (SmoothAdditions)
100 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;
101 @end