[menu addItem:[NSMenuItem separatorItem]];
}
}
+
curTrackIndex = -1; //Force update of everything
[self timerUpdate]; //Updates dynamic info in the menu
{
result = [result substringWithRange:NSMakeRange(1, [result length] - 2)];
}
- [script release];
free(buffer);
buffer = NULL;
return result;
- (void)timerUpdate
{
int pid;
+
if (GetProcessPID(&iTunesPSN, &pid) == noErr)
{
int trackPlayingIndex = [[self runScriptAndReturnResult:@"return index of current track"] intValue];
+
if (trackPlayingIndex != curTrackIndex)
{
[self updateMenu];
curTrackIndex = trackPlayingIndex;
}
-
+
//Update Play/Pause menu item
if (playPauseMenuItem)
{