#import "NewMainController.h"
+#import "MenuController.h"
#import "PreferencesController.h"
#import "HotKeyCenter.h"
#import "StatusWindowController.h"
+#import "StatusItemHack.h"
@interface MainController(Private)
- (ITMTRemote *)loadRemote;
remoteArray = [[NSMutableArray alloc] initWithCapacity:1];
statusWindowController = [[StatusWindowController alloc] init];
+ menuController = [[MenuController alloc] init];
df = [[NSUserDefaults standardUserDefaults] retain];
[self setLatestSongIdentifier:@"0-0"];
}
[[PreferencesController sharedPrefs] registerDefaults];
}
+ [StatusItemHack install];
statusItem = [[ITStatusItem alloc]
initWithStatusBar:[NSStatusBar systemStatusBar]
withLength:NSSquareStatusItemLength];
if ( ( [self songChanged] ) ||
( ([self radioIsPlaying]) && (latestPlaylistClass != ITMTRemotePlayerRadioPlaylist) ) ||
( (! [self radioIsPlaying]) && (latestPlaylistClass == ITMTRemotePlayerRadioPlaylist) ) ) {
- //[statusItem setMenu:[self menu]];
[self setLatestSongIdentifier:[currentRemote currentSongUniqueIdentifier]];
latestPlaylistClass = [currentRemote currentPlaylistClass];
[self showCurrentTrackInfo];
}
}
-/*
- //Update Play/Pause menu item
- if (playPauseItem){
- if ([currentRemote playerPlayingState] == ITMTRemotePlayerPlaying) {
- [playPauseItem setTitle:@"Pause"];
- } else {
- [playPauseItem setTitle:@"Play"];
- }
+}
+
+- (void)menuClicked
+{
+ if ([currentRemote playerRunningState] == ITMTRemotePlayerRunning) {
+ [statusItem setMenu:[menuController menu]];
+ } else {
+ [statusItem setMenu:[menuController menuForNoPlayer]];
}
-*/
}
//
refreshTimer = nil;
[self clearHotKeys];
playerRunningState = ITMTRemotePlayerNotRunning;
-
- [statusItem setMenu:[self menuForNoPlayer]];
}
}
[currentRemote halt];
[statusItem release];
[statusWindowController release];
+ [menuController release];
[super dealloc];
}
-@end
+@end
\ No newline at end of file