X-Git-Url: http://git.ithinksw.org/MenuTunes.git/blobdiff_plain/f4376dfea2c137a58b9648b2ddaa28ff2194c0e7..86cf83625b2bd9c7abe182ce1f2da11d33cb1482:/OldMainController.m?ds=inline diff --git a/OldMainController.m b/OldMainController.m index b290b3a..dab1899 100755 --- a/OldMainController.m +++ b/OldMainController.m @@ -146,7 +146,7 @@ [notRunningMenu addItemWithTitle:[NSString stringWithFormat:@"Open %@", [currentRemote playerSimpleName]] action:@selector(showPlayer:) keyEquivalent:@""]; [notRunningMenu addItem:[NSMenuItem separatorItem]]; [notRunningMenu addItemWithTitle:@"Preferences..." action:@selector(showPreferences:) keyEquivalent:@""]; - [notRunningMenu addItemWithTitle:@"Quit" action:@selector(quitMenuTunes:) keyEquivalent:@""]; + [[notRunningMenu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@""] setTarget:NSApp]; [statusItem setMenu:[notRunningMenu autorelease]]; [currentRemote halt]; @@ -294,14 +294,14 @@ eqItem = [menu addItemWithTitle:@"EQ Presets" action:nil keyEquivalent:@""]; - } else if ([item isEqualToString:@"PreferencesÉ"]) { - [menu addItemWithTitle:@"PreferencesÉ" + } else if ([item isEqualToString:@"Preferences…"]) { + [menu addItemWithTitle:@"Preferences…" action:@selector(showPreferences:) keyEquivalent:@""]; } else if ([item isEqualToString:@"Quit"]) { - [menu addItemWithTitle:@"Quit" - action:@selector(quitMenuTunes:) - keyEquivalent:@""]; + [[menu addItemWithTitle:@"Quit" + action:@selector(terminate:) + keyEquivalent:@""] setTarget:NSApp]; } else if ([item isEqualToString:@"Current Track Info"]) { trackInfoIndex = [menu numberOfItems]; [menu addItemWithTitle:@"No Song" @@ -513,7 +513,7 @@ // // // If we want to show the new track floater, do it here! - //[self showCurrentTrackInfo]; + //[self showCurrentTrackInfoStatusWindow]; // // [self rebuildMenu]; @@ -612,10 +612,6 @@ // // -- (void)quitMenuTunes:(id)sender -{ - [NSApp terminate:self]; -} - (void)showPlayer:(id)sender { @@ -657,6 +653,7 @@ [[HotKeyCenter sharedCenter] removeHotKey:@"PlayPause"]; [[HotKeyCenter sharedCenter] removeHotKey:@"NextTrack"]; [[HotKeyCenter sharedCenter] removeHotKey:@"PrevTrack"]; + [[HotKeyCenter sharedCenter] removeHotKey:@"ToggleVisualizer"]; [[HotKeyCenter sharedCenter] removeHotKey:@"TrackInfo"]; [[HotKeyCenter sharedCenter] removeHotKey:@"UpcomingSongs"]; [[HotKeyCenter sharedCenter] removeHotKey:@"ToggleLoop"]; @@ -689,16 +686,22 @@ target:self action:@selector(prevSong:)]; } + if ([defaults objectForKey:@"ToggleVisualizer"] != nil) { + [[HotKeyCenter sharedCenter] addHotKey:@"ToggleVisualizer" + combo:[defaults keyComboForKey:@"ToggleVisualizer"] + target:self action:@selector(toggleVisualizer)]; + } + if ([defaults objectForKey:@"TrackInfo"] != nil) { [[HotKeyCenter sharedCenter] addHotKey:@"TrackInfo" combo:[defaults keyComboForKey:@"TrackInfo"] - target:self action:@selector(showCurrentTrackInfo)]; + target:self action:@selector(showCurrentTrackInfoStatusWindow)]; } if ([defaults objectForKey:@"UpcomingSongs"] != nil) { [[HotKeyCenter sharedCenter] addHotKey:@"UpcomingSongs" combo:[defaults keyComboForKey:@"UpcomingSongs"] - target:self action:@selector(showUpcomingSongs)]; + target:self action:@selector(showUpcomingSongsStatusWindow)]; } if ([defaults objectForKey:@"ToggleLoop"] != nil) { @@ -744,7 +747,7 @@ // // -- (void)showCurrentTrackInfo +- (void)showCurrentTrackInfoStatusWindow { NSString *trackName = [currentRemote currentSongTitle]; if (!statusWindow && [trackName length]) { @@ -800,7 +803,7 @@ } } -- (void)showUpcomingSongs +- (void)showUpcomingSongsStatusWindow { int curPlaylist = [currentRemote currentPlaylistIndex]; if (!statusWindow) { @@ -858,6 +861,11 @@ { } +- (void)toggleVisualizer +{ + NSLog(@"Visualizer On/Off"); +} + - (void)fadeAndCloseStatusWindow { [statusWindow orderOut:self]; @@ -898,17 +906,11 @@ //Space -- ARGH! case 49: { - // Haven't tested this, though it should work. - //Doesn't work :( - unichar buffer; - [[NSString stringWithString:@"Space"] getCharacters:&buffer]; - charcode = buffer; /*MenuRef menuRef = _NSGetCarbonMenu([item menu]); - NSLog(@"%@", menuRef); - SetMenuItemCommandKey(menuRef, 0, NO, 49); - SetMenuItemModifiers(menuRef, 0, kMenuNoCommandModifier); - SetMenuItemKeyGlyph(menuRef, 0, kMenuBlankGlyph); - charcode = 'b';*/ + SetMenuItemCommandKey(menuRef, 1, NO, 49); + SetMenuItemModifiers(menuRef, 1, kMenuNoCommandModifier); + SetMenuItemKeyGlyph(menuRef, 1, kMenuBlankGlyph);*/ + charcode = 'b'; } break;