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