Eliminated a small warning.
[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, *_audioscrobblerTimer;
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         int _audioscrobblerInterval;
51     NSLock *_serverCheckLock;
52 }
53 + (MainController *)sharedController;
54
55 - (void)menuClicked;
56
57 //Methods called from MenuController by menu items
58 - (NSDate*)getBlingTime;
59 - (void)blingTime;
60 - (void)blingNow;
61 - (BOOL)blingBling;
62
63 - (void)timerUpdate;
64
65 - (void)playPause;
66 - (void)nextSong;
67 - (void)prevSong;
68 - (void)fastForward;
69 - (void)rewind;
70 - (void)selectPlaylistAtIndex:(int)index;
71 - (void)selectSongAtIndex:(int)index;
72 - (void)selectSongRating:(int)rating;
73 - (void)selectEQPresetAtIndex:(int)index;
74 - (void)makePlaylistWithTerm:(NSString *)term ofType:(int)type;
75 - (void)showPlayer;
76 - (void)showPreferences;
77 - (void)showTestWindow;
78 - (void)quitMenuTunes;
79
80 //
81
82 - (void)setServerStatus:(BOOL)newStatus;
83 - (int)connectToServer;
84 - (BOOL)disconnectFromServer;
85 - (void)checkForRemoteServerAndConnectImmediately:(BOOL)connectImmediately;
86 - (void)networkError:(NSException *)exception;
87
88 //
89
90 - (ITMTRemote *)currentRemote;
91 - (void)clearHotKeys;
92 - (void)setupHotKeys;
93 - (void)closePreferences;
94 - (MenuController *)menuController;
95
96 - (void)showCurrentTrackInfo;
97
98 @end
99
100 @interface NSImage (SmoothAdditions)
101 - (NSImage *)imageScaledSmoothlyToSize:(NSSize)scaledSize;
102 @end