sharedController = self;
remoteArray = [[NSMutableArray alloc] initWithCapacity:1];
+ [[PreferencesController sharedPrefs] setController:self];
statusWindowController = [StatusWindowController sharedController];
menuController = [[MenuController alloc] init];
df = [[NSUserDefaults standardUserDefaults] retain];
- [[PreferencesController sharedPrefs] setController:self];
timerUpdating = NO;
blinged = NO;
}
- (BOOL)songIsPlaying
{
- NSString *identifier;
+ NSString *identifier = nil;
NS_DURING
identifier = [[self currentRemote] playerStateUniqueIdentifier];
NS_HANDLER
- (BOOL)radioIsPlaying
{
- ITMTRemotePlayerPlaylistClass class;
+ ITMTRemotePlayerPlaylistClass class = nil;
NS_DURING
class = [[self currentRemote] currentPlaylistClass];
NS_HANDLER
- (BOOL)songChanged
{
- NSString *identifier;
+ NSString *identifier = nil;
NS_DURING
identifier = [[self currentRemote] playerStateUniqueIdentifier];
NS_HANDLER
[[PreferencesController sharedPrefs] showPrefsWindow:self];
}
+- (void)showTestWindow
+{
+ [self showCurrentTrackInfo];
+}
+
- (void)quitMenuTunes
{
ITDebugLog(@"Quitting MenuTunes.");
- (void)showCurrentTrackInfo
{
- ITMTRemotePlayerSource source;
- NSString *title;
+ ITMTRemotePlayerSource source = 0;
+ NSString *title = nil;
NSString *album = nil;
NSString *artist = nil;
NSString *time = nil;
}
if ( [df boolForKey:@"showTrackNumber"] ) {
- int trackNo;
- int trackCount;
+ int trackNo = 0;
+ int trackCount = 0;
NS_DURING
trackNo = [[self currentRemote] currentSongTrack];
}
if ( [df boolForKey:@"showTrackRating"] ) {
- float currentRating;
+ float currentRating = 0;
NS_DURING
currentRating = [[self currentRemote] currentSongRating];
- (void)showUpcomingSongs
{
- int numSongs;
+ int numSongs = 0;
NS_DURING
numSongs = [[self currentRemote] numberOfSongsInPlaylistAtIndex:[[self currentRemote] currentPlaylistIndex]];
NS_HANDLER
refreshTimer = nil;
[self clearHotKeys];
playerRunningState = ITMTRemotePlayerNotRunning;
+
+ if ([df objectForKey:@"ShowPlayer"] != nil) {
+ ITHotKey *hotKey;
+ ITDebugLog(@"Setting up show player hot key.");
+ hotKey = [[ITHotKey alloc] init];
+ [hotKey setName:@"ShowPlayer"];
+ [hotKey setKeyCombo:[ITKeyCombo keyComboWithPlistRepresentation:[df objectForKey:@"ShowPlayer"]]];
+ [hotKey setTarget:self];
+ [hotKey setAction:@selector(showPlayer)];
+ [[ITHotKeyCenter sharedCenter] registerHotKey:[hotKey autorelease]];
+ }
}
NS_HANDLER
[self networkError:localException];