+
+ if (curPlaylist)
+ {
+ [[playlistMenu itemAtIndex:curPlaylist - 1] setState:NSOnState];
+ }
+}
+
+//Build a menu with the list of all available EQ presets
+- (void)rebuildEQPresetsMenu
+{
+ int numSets = [[self runScriptAndReturnResult:@"return number of EQ presets"] intValue];
+ int i;
+
+ if (eqMenu && (numSets == [eqMenu numberOfItems]))
+ return;
+
+ [eqMenu release];
+ eqMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ for (i = 1; i <= numSets; i++)
+ {
+ NSString *setName = [self runScriptAndReturnResult:[NSString stringWithFormat:@"return name of EQ preset %i", i]];
+ NSMenuItem *tempItem;
+ tempItem = [[NSMenuItem alloc] initWithTitle:setName action:@selector(selectEQPreset:) keyEquivalent:@""];
+ [tempItem setTarget:self];
+ [tempItem setRepresentedObject:[NSNumber numberWithInt:i]];
+ [eqMenu addItem:tempItem];
+ [tempItem release];
+ }
+ [eqItem setSubmenu:eqMenu];
+
+ [[eqMenu itemAtIndex:[[self runScriptAndReturnResult:@"return index of current EQ preset"] intValue] - 1] setState:NSOnState];