3 ¥ Radio mode makes things act oddly
4 ¥ Make preferences window pretty
6 - hot keys can't be set when NSBGOnly is on. The window is not key,
7 so the KeyBroadcaster does not pick up key combos
8 - going to need a different way of defining key combos
10 ¥ Apple Events! Apple Events! Apple Events!
11 ¥ Upcoming songs menu items are disabled after launching iTunes and playing
15 // #import "MenuTunesView.h"
16 #import "PreferencesController.h"
17 #import "HotKeyCenter.h"
18 #import "StatusWindowController.h"
20 @interface MenuTunes(Private)
21 - (void)registerDefaultsIfNeeded;
23 - (void)rebuildUpcomingSongsMenu;
24 - (void)rebuildPlaylistMenu;
25 - (void)rebuildEQPresetsMenu;
27 - (NSString *)runScriptAndReturnResult:(NSString *)script;
29 - (void)sendAEWithEventClass:(AEEventClass)eventClass andEventID:(AEEventID)eventID;
33 @implementation MenuTunes
35 /*************************************************************************/
37 #pragma mark INITIALIZATION METHODS
38 /*************************************************************************/
40 - (void)applicationDidFinishLaunching:(NSNotification *)note
42 asComponent = OpenDefaultComponent(kOSAComponentType, kAppleScriptSubtype);
44 [self registerDefaultsIfNeeded];
46 menu = [[NSMenu alloc] initWithTitle:@""];
47 iTunesPSN = [self iTunesPSN]; //Get PSN of iTunes if it's running
49 if (!((iTunesPSN.highLongOfPSN == kNoProcess) && (iTunesPSN.lowLongOfPSN == 0)))
52 refreshTimer = [NSTimer scheduledTimerWithTimeInterval:3.5
54 selector:@selector(timerUpdate)
60 menu = [[NSMenu alloc] initWithTitle:@""];
61 [[menu addItemWithTitle:@"Open iTunes" action:@selector(openiTunes:) keyEquivalent:@""] setTarget:self];
62 [[menu addItemWithTitle:@"Preferences" action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
63 [[menu addItemWithTitle:@"Quit" action:@selector(quitMenuTunes:) keyEquivalent:@""] setTarget:self];
64 [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(iTunesLaunched:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];
68 statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
69 [[[statusItem _button] cell] setType:NSNullCellType];
70 [statusItem setImage:[NSImage imageNamed:@"menu"]];
71 [[statusItem _button] setAlternateImage:[NSImage imageNamed:@"selected_image"]];
72 [statusItem setHighlightMode:YES];
73 [statusItem setMenu:menu];
75 // view = [[MenuTunesView alloc] initWithFrame:[[statusItem view] frame]];
76 // [statusItem setView:view];
80 /*************************************************************************/
82 #pragma mark INSTANCE METHODS
83 /*************************************************************************/
85 - (void)registerDefaultsIfNeeded
87 if (![[NSUserDefaults standardUserDefaults] objectForKey:@"menu"]) {
88 [[NSUserDefaults standardUserDefaults] setObject:
89 [NSArray arrayWithObjects:
102 @"Current Track Info",
103 nil] forKey:@"menu"];
107 //Recreate the status item menu
110 NSArray *myMenu = [[NSUserDefaults standardUserDefaults] arrayForKey:@"menu"];
114 didHaveAlbumName = ([[self runScriptAndReturnResult:@"return album of current track"] length] > 0);
116 while ([menu numberOfItems] > 0) {
117 [menu removeItemAtIndex:0];
120 playPauseMenuItem = nil;
121 upcomingSongsItem = nil;
123 [playlistMenu release];
129 for (i = 0; i < [myMenu count]; i++) {
130 NSString *item = [myMenu objectAtIndex:i];
131 if ([item isEqualToString:@"Play/Pause"]) {
132 playPauseMenuItem = [menu addItemWithTitle:@"Play"
133 action:@selector(playPause:)
135 [playPauseMenuItem setTarget:self];
136 } else if ([item isEqualToString:@"Next Track"]) {
137 [[menu addItemWithTitle:@"Next Track"
138 action:@selector(nextSong:)
139 keyEquivalent:@""] setTarget:self];
140 } else if ([item isEqualToString:@"Previous Track"]) {
141 [[menu addItemWithTitle:@"Previous Track"
142 action:@selector(prevSong:)
143 keyEquivalent:@""] setTarget:self];
144 } else if ([item isEqualToString:@"Fast Forward"]) {
145 [[menu addItemWithTitle:@"Fast Forward"
146 action:@selector(fastForward:)
147 keyEquivalent:@""] setTarget:self];
148 } else if ([item isEqualToString:@"Rewind"]) {
149 [[menu addItemWithTitle:@"Rewind"
150 action:@selector(rewind:)
151 keyEquivalent:@""] setTarget:self];
152 } else if ([item isEqualToString:@"Upcoming Songs"]) {
153 upcomingSongsItem = [menu addItemWithTitle:@"Upcoming Songs"
156 } else if ([item isEqualToString:@"Playlists"]) {
157 playlistItem = [menu addItemWithTitle:@"Playlists"
160 } else if ([item isEqualToString:@"EQ Presets"]) {
161 eqItem = [menu addItemWithTitle:@"EQ Presets"
164 } else if ([item isEqualToString:@"PreferencesÉ"]) {
165 [[menu addItemWithTitle:@"PreferencesÉ"
166 action:@selector(showPreferences:)
167 keyEquivalent:@""] setTarget:self];
168 } else if ([item isEqualToString:@"Quit"]) {
169 [[menu addItemWithTitle:@"Quit"
170 action:@selector(quitMenuTunes:)
171 keyEquivalent:@""] setTarget:self];
172 } else if ([item isEqualToString:@"Current Track Info"]) {
173 trackInfoIndex = [menu numberOfItems];
174 [menu addItemWithTitle:@"No Song"
177 } else if ([item isEqualToString:@"<separator>"]) {
178 [menu addItem:[NSMenuItem separatorItem]];
182 curTrackIndex = -1; //Force update of everything
183 [self timerUpdate]; //Updates dynamic info in the menu
189 //Updates the menu with current player state, song, and upcoming songs
192 NSString *curAlbumName = [self runScriptAndReturnResult:@"return album of current track"];
193 NSMenuItem *menuItem;
195 if ((iTunesPSN.highLongOfPSN == kNoProcess) && (iTunesPSN.lowLongOfPSN == 0)) {
199 if (upcomingSongsItem) {
200 [self rebuildUpcomingSongsMenu];
203 [self rebuildPlaylistMenu];
206 [self rebuildEQPresetsMenu];
209 if (trackInfoIndex > -1)
211 NSString *curSongName;
212 curSongName = [self runScriptAndReturnResult:@"return name of current track"];
213 if ([curSongName length] > 0) {
214 int index = [menu indexOfItemWithTitle:@"Now Playing"];
217 [menu removeItemAtIndex:index + 1];
219 if (didHaveAlbumName) {
220 [menu removeItemAtIndex:index + 1];
224 if ([curAlbumName length] > 0) {
225 menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", curAlbumName]
228 [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
232 menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@" %@", curSongName]
235 [menu insertItem:menuItem atIndex:trackInfoIndex + 1];
239 menuItem = [[NSMenuItem alloc] initWithTitle:@"Now Playing" action:nil keyEquivalent:@""];
240 [menu removeItemAtIndex:[menu indexOfItemWithTitle:@"No Song"]];
241 [menu insertItem:menuItem atIndex:trackInfoIndex];
245 } else if ([menu indexOfItemWithTitle:@"No Song"] == -1) {
246 [menu removeItemAtIndex:trackInfoIndex];
247 [menu removeItemAtIndex:trackInfoIndex];
249 if (didHaveAlbumName) {
250 [menu removeItemAtIndex:trackInfoIndex];
253 menuItem = [[NSMenuItem alloc] initWithTitle:@"No Song" action:nil keyEquivalent:@""];
254 [menu insertItem:menuItem atIndex:trackInfoIndex];
258 didHaveAlbumName = (([curAlbumName length] > 0) ? YES : NO);
261 //Rebuild the upcoming songs submenu. Can be improved a lot.
262 - (void)rebuildUpcomingSongsMenu
264 int numSongs = [[self runScriptAndReturnResult:@"return number of tracks in current playlist"] intValue];
265 int numSongsInAdvance = [[NSUserDefaults standardUserDefaults] integerForKey:@"SongsInAdvance"];
268 int curTrack = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
271 [upcomingSongsMenu release];
272 upcomingSongsMenu = [[NSMenu alloc] initWithTitle:@""];
274 for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
276 NSString *curSong = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of track %i of current playlist", i]];
277 NSMenuItem *songItem;
278 songItem = [[NSMenuItem alloc] initWithTitle:curSong action:@selector(playTrack:) keyEquivalent:@""];
279 [songItem setTarget:self];
280 [songItem setRepresentedObject:[NSNumber numberWithInt:i]];
281 [upcomingSongsMenu addItem:songItem];
284 [upcomingSongsMenu addItemWithTitle:@"End of playlist." action:nil keyEquivalent:@""];
288 [upcomingSongsItem setSubmenu:upcomingSongsMenu];
289 [upcomingSongsItem setEnabled:YES];
293 - (void)rebuildPlaylistMenu
295 int numPlaylists = [[self runScriptAndReturnResult:@"return number of playlists"] intValue];
296 int i, curPlaylist = [[self runScriptAndReturnResult:@"return index of current playlist"] intValue];
298 if (playlistMenu && (numPlaylists == [playlistMenu numberOfItems]))
301 [playlistMenu release];
302 playlistMenu = [[NSMenu alloc] initWithTitle:@""];
304 for (i = 1; i <= numPlaylists; i++) {
305 NSString *playlistName = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of playlist %i", i]];
306 NSMenuItem *tempItem;
307 tempItem = [[NSMenuItem alloc] initWithTitle:playlistName action:@selector(selectPlaylist:) keyEquivalent:@""];
308 [tempItem setTarget:self];
309 [tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
310 [playlistMenu addItem:tempItem];
313 [playlistItem setSubmenu:playlistMenu];
316 [[playlistMenu itemAtIndex:curPlaylist - 1] setState:NSOnState];
320 //Build a menu with the list of all available EQ presets
321 - (void)rebuildEQPresetsMenu
323 int numSets = [[self runScriptAndReturnResult:@"return number of EQ presets"] intValue];
326 if (eqMenu && (numSets == [eqMenu numberOfItems]))
330 eqMenu = [[NSMenu alloc] initWithTitle:@""];
332 for (i = 1; i <= numSets; i++) {
333 NSString *setName = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of EQ preset %i", i]];
334 NSMenuItem *tempItem;
335 tempItem = [[NSMenuItem alloc] initWithTitle:setName action:@selector(selectEQPreset:) keyEquivalent:@""];
336 [tempItem setTarget:self];
337 [tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
338 [eqMenu addItem:tempItem];
341 [eqItem setSubmenu:eqMenu];
343 [[eqMenu itemAtIndex:[[self runScriptAndReturnResult:@"return index of current EQ preset"] intValue] - 1] setState:NSOnState];
348 [[HotKeyCenter sharedCenter] removeHotKey:@"PlayPause"];
349 [[HotKeyCenter sharedCenter] removeHotKey:@"NextTrack"];
350 [[HotKeyCenter sharedCenter] removeHotKey:@"PrevTrack"];
351 [[HotKeyCenter sharedCenter] removeHotKey:@"TrackInfo"];
352 [[HotKeyCenter sharedCenter] removeHotKey:@"UpcomingSongs"];
357 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
359 if ([defaults objectForKey:@"PlayPause"] != nil) {
360 [[HotKeyCenter sharedCenter] addHotKey:@"PlayPause"
361 combo:[defaults keyComboForKey:@"PlayPause"]
362 target:self action:@selector(playPause:)];
365 if ([defaults objectForKey:@"NextTrack"] != nil) {
366 [[HotKeyCenter sharedCenter] addHotKey:@"NextTrack"
367 combo:[defaults keyComboForKey:@"NextTrack"]
368 target:self action:@selector(nextSong:)];
371 if ([defaults objectForKey:@"PrevTrack"] != nil) {
372 [[HotKeyCenter sharedCenter] addHotKey:@"PrevTrack"
373 combo:[defaults keyComboForKey:@"PrevTrack"]
374 target:self action:@selector(prevSong:)];
377 if ([defaults objectForKey:@"TrackInfo"] != nil) {
378 [[HotKeyCenter sharedCenter] addHotKey:@"TrackInfo"
379 combo:[defaults keyComboForKey:@"TrackInfo"]
380 target:self action:@selector(showCurrentTrackInfo)];
383 if ([defaults objectForKey:@"UpcomingSongs"] != nil) {
384 [[HotKeyCenter sharedCenter] addHotKey:@"UpcomingSongs"
385 combo:[defaults keyComboForKey:@"UpcomingSongs"]
386 target:self action:@selector(showUpcomingSongs)];
390 //Runs an AppleScript and returns the result as an NSString after stripping quotes, if needed. It takes in script and automatically adds the tell iTunes and end tell statements.
391 - (NSString *)runScriptAndReturnResult:(NSString *)script
393 AEDesc scriptDesc, resultDesc;
398 script = [NSString stringWithFormat:@"tell application \"iTunes\"\n%@\nend tell", script];
400 AECreateDesc(typeChar, [script cString], [script cStringLength],
403 OSADoScript(asComponent, &scriptDesc, kOSANullScript, typeChar, kOSAModeCanInteract, &resultDesc);
405 length = AEGetDescDataSize(&resultDesc);
406 buffer = malloc(length);
408 AEGetDescData(&resultDesc, buffer, length);
409 AEDisposeDesc(&scriptDesc);
410 AEDisposeDesc(&resultDesc);
411 result = [NSString stringWithCString:buffer length:length];
412 if ( (! [result isEqualToString:@""]) &&
413 ([result characterAtIndex:0] == '\"') &&
414 ([result characterAtIndex:[result length] - 1] == '\"') ) {
415 result = [result substringWithRange:NSMakeRange(1, [result length] - 2)];
422 //Called when the timer fires.
427 if (GetProcessPID(&iTunesPSN, &pid) == noErr) {
428 int trackPlayingIndex = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
430 if (trackPlayingIndex != curTrackIndex) {
432 curTrackIndex = trackPlayingIndex;
435 //Update Play/Pause menu item
436 if (playPauseMenuItem){
437 if ([[self runScriptAndReturnResult:@"return player state"] isEqualToString:@"playing"]) {
438 [playPauseMenuItem setTitle:@"Pause"];
440 [playPauseMenuItem setTitle:@"Play"];
445 menu = [[NSMenu alloc] initWithTitle:@""];
446 [[menu addItemWithTitle:@"Open iTunes" action:@selector(openiTunes:) keyEquivalent:@""] setTarget:self];
447 [[menu addItemWithTitle:@"Preferences" action:@selector(showPreferences:) keyEquivalent:@""] setTarget:self];
448 [[menu addItemWithTitle:@"Quit" action:@selector(quitMenuTunes:) keyEquivalent:@""] setTarget:self];
449 [statusItem setMenu:menu];
451 [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(iTunesLaunched:) name:NSWorkspaceDidLaunchApplicationNotification object:nil];
452 [refreshTimer invalidate];
458 - (void)iTunesLaunched:(NSNotification *)note
460 NSDictionary *info = [note userInfo];
462 iTunesPSN.highLongOfPSN = [[info objectForKey:@"NSApplicationProcessSerialNumberHigh"] longValue];
463 iTunesPSN.lowLongOfPSN = [[info objectForKey:@"NSApplicationProcessSerialNumberLow"] longValue];
466 refreshTimer = [NSTimer scheduledTimerWithTimeInterval:3.5 target:self selector:@selector(timerUpdate) userInfo:nil repeats:YES];
468 [self rebuildMenu]; //Rebuild the menu since no songs will be playing
469 [statusItem setMenu:menu]; //Set the menu back to the main one
470 [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
473 //Return the PSN of iTunes, if it's running
474 - (ProcessSerialNumber)iTunesPSN
476 ProcessSerialNumber procNum;
477 procNum.highLongOfPSN = kNoProcess;
478 procNum.lowLongOfPSN = 0;
480 while ( (GetNextProcess(&procNum) == noErr) ) {
481 CFStringRef procName;
482 if ( (CopyProcessName(&procNum, &procName) == noErr) ) {
483 if ([(NSString *)procName isEqualToString:@"iTunes"]) {
486 [(NSString *)procName release];
492 //Send an AppleEvent with a given event ID
493 - (void)sendAEWithEventClass:(AEEventClass)eventClass
494 andEventID:(AEEventID)eventID
496 OSType iTunesType = 'hook';
497 AppleEvent event, reply;
499 AEBuildAppleEvent(eventClass, eventID, typeApplSignature, &iTunesType, sizeof(iTunesType), kAutoGenerateReturnID, kAnyTransactionID, &event, nil, "");
501 AESend(&event, &reply, kAENoReply, kAENormalPriority, kAEDefaultTimeout, nil, nil);
502 AEDisposeDesc(&event);
503 AEDisposeDesc(&reply);
507 // Selectors - called from status item menu
510 - (void)playTrack:(id)sender
512 [self runScriptAndReturnResult:[NSString stringWithFormat:@"play track %i of current playlist", [[sender representedObject] intValue]]];
516 - (void)selectPlaylist:(id)sender
518 int playlist = [[sender representedObject] intValue];
519 int curPlaylist = [[self runScriptAndReturnResult:@"return index of current playlist"] intValue];
520 [[playlistMenu itemAtIndex:curPlaylist - 1] setState:NSOffState];
521 [self runScriptAndReturnResult:[NSString stringWithFormat:@"play playlist %i", playlist]];
522 [[playlistMenu itemAtIndex:playlist - 1] setState:NSOnState];
526 - (void)selectEQPreset:(id)sender
528 int curSet = [[self runScriptAndReturnResult:@"return index of current EQ preset"] intValue];
529 int item = [[sender representedObject] intValue];
530 [self runScriptAndReturnResult:[NSString stringWithFormat:@"set current EQ preset to EQ preset %i", item]];
531 [self runScriptAndReturnResult:@"set EQ enabled to 1"];
532 [[eqMenu itemAtIndex:curSet - 1] setState:NSOffState];
533 [[eqMenu itemAtIndex:item - 1] setState:NSOnState];
536 - (void)playPause:(id)sender
538 NSString *state = [self runScriptAndReturnResult:@"return player state"];
539 if ([state isEqualToString:@"playing"]) {
540 [self sendAEWithEventClass:'hook' andEventID:'Paus'];
541 [playPauseMenuItem setTitle:@"Play"];
542 } else if ([state isEqualToString:@"fast forwarding"] || [state
543 isEqualToString:@"rewinding"]) {
544 [self sendAEWithEventClass:'hook' andEventID:'Paus'];
545 [self sendAEWithEventClass:'hook' andEventID:'Play'];
547 [self sendAEWithEventClass:'hook' andEventID:'Play'];
548 [playPauseMenuItem setTitle:@"Pause"];
552 - (void)nextSong:(id)sender
554 [self sendAEWithEventClass:'hook' andEventID:'Next'];
557 - (void)prevSong:(id)sender
559 [self sendAEWithEventClass:'hook' andEventID:'Prev'];
562 - (void)fastForward:(id)sender
564 [self sendAEWithEventClass:'hook' andEventID:'Fast'];
567 - (void)rewind:(id)sender
569 [self sendAEWithEventClass:'hook' andEventID:'Rwnd'];
572 - (void)quitMenuTunes:(id)sender
574 [NSApp terminate:self];
577 - (void)openiTunes:(id)sender
579 [[NSWorkspace sharedWorkspace] launchApplication:@"iTunes"];
582 - (void)showPreferences:(id)sender
584 if (!prefsController) {
585 prefsController = [[PreferencesController alloc] initWithMenuTunes:self];
591 - (void)closePreferences
593 if (!((iTunesPSN.highLongOfPSN == kNoProcess) && (iTunesPSN.lowLongOfPSN == 0))) {
596 [prefsController release];
597 prefsController = nil;
602 // Show Current Track Info And Show Upcoming Songs Floaters
606 - (void)showCurrentTrackInfo
608 NSString *trackName = [self runScriptAndReturnResult:@"return name of current track"];
609 if (!statusController && [trackName length]) {
610 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
611 NSString *stringToShow = @"";
614 if ([defaults boolForKey:@"showName"]) {
615 if ([defaults boolForKey:@"showArtist"]) {
616 NSString *trackArtist = [self runScriptAndReturnResult:@"return artist of current track"];
617 trackName = [NSString stringWithFormat:@"%@ - %@", trackArtist, trackName];
619 stringToShow = [stringToShow stringByAppendingString:trackName];
620 stringToShow = [stringToShow stringByAppendingString:@"\n"];
621 if ([trackName length] > 38) {
627 if ([defaults boolForKey:@"showAlbum"]) {
628 NSString *trackAlbum = [self runScriptAndReturnResult:@"return album of current track"];
629 if ([trackAlbum length]) {
630 stringToShow = [stringToShow stringByAppendingString:trackAlbum];
631 stringToShow = [stringToShow stringByAppendingString:@"\n"];
636 if ([defaults boolForKey:@"showTime"]) {
637 NSString *trackTime = [self runScriptAndReturnResult:@"return time of current track"];
638 if ([trackTime length]) {
639 stringToShow = [NSString stringWithFormat:@"%@Total Time: %@\n", stringToShow, trackTime];
645 int trackTimeLeft = [[self runScriptAndReturnResult:@"return (duration of current track) - player position"] intValue];
646 int minutes = trackTimeLeft / 60, seconds = trackTimeLeft % 60;
648 stringToShow = [stringToShow stringByAppendingString:
649 [NSString stringWithFormat:@"Time Remaining: %i:0%i", minutes, seconds]];
651 stringToShow = [stringToShow stringByAppendingString:
652 [NSString stringWithFormat:@"Time Remaining: %i:%i", minutes, seconds]];
656 statusController = [[StatusWindowController alloc] init];
657 [statusController setTrackInfo:stringToShow lines:lines];
658 [NSTimer scheduledTimerWithTimeInterval:3.0
660 selector:@selector(fadeAndCloseStatusWindow)
666 - (void)showUpcomingSongs
668 if (!statusController) {
669 int numSongs = [[self runScriptAndReturnResult:@"return number of tracks in current playlist"] intValue];
672 int numSongsInAdvance = [[NSUserDefaults standardUserDefaults] integerForKey:@"SongsInAdvance"];
673 int curTrack = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
675 NSString *songs = @"";
677 statusController = [[StatusWindowController alloc] init];
678 for (i = curTrack + 1; i <= curTrack + numSongsInAdvance; i++) {
680 NSString *curSong = [self runScriptAndReturnResult:
681 [NSString stringWithFormat:@"return name of track %i of current playlist", i]];
682 songs = [songs stringByAppendingString:curSong];
683 songs = [songs stringByAppendingString:@"\n"];
686 [statusController setUpcomingSongs:songs numSongs:numSongsInAdvance];
687 [NSTimer scheduledTimerWithTimeInterval:3.0
689 selector:@selector(fadeAndCloseStatusWindow)
696 - (void)fadeAndCloseStatusWindow
698 [statusController fadeWindowOut];
699 [statusController release];
700 statusController = nil;
703 /*************************************************************************/
705 #pragma mark NSApplication DELEGATE METHODS
706 /*************************************************************************/
708 - (void)applicationWillTerminate:(NSNotification *)note
711 [[NSStatusBar systemStatusBar] removeStatusItem:statusItem];
715 /*************************************************************************/
717 #pragma mark DEALLOCATION METHODS
718 /*************************************************************************/
723 [refreshTimer invalidate];
726 CloseComponent(asComponent);
727 [statusItem release];