+- (NSMenu *)artistsMenu
+{
+ NSMenu *artistsMenu = [[NSMenu alloc] initWithTitle:@""];
+ NSEnumerator *artistsEnumerator;
+ NSString *nextArtist;
+ id <NSMenuItem> tempItem;
+ ITDebugLog(@"Building \"Artists\" menu.");
+ NS_DURING
+ artistsEnumerator = [[[[MainController sharedController] currentRemote] artists] objectEnumerator];
+ while ( (nextArtist = [artistsEnumerator nextObject]) ) {
+ tempItem = [artistsMenu addItemWithTitle:nextArtist action:@selector(performBrowseMenuAction:) keyEquivalent:@""];
+ [tempItem setRepresentedObject:nextArtist];
+ [tempItem setTag:1];
+ [tempItem setTarget:self];
+ }
+ NS_HANDLER
+ [[MainController sharedController] networkError:localException];
+ NS_ENDHANDLER
+ ITDebugLog(@"Done Building \"Artists\" menu");
+ return artistsMenu;
+}
+
+- (NSMenu *)albumsMenu
+{
+ NSMenu *albumsMenu = [[NSMenu alloc] initWithTitle:@""];
+ NSEnumerator *albumsEnumerator;
+ NSString *nextAlbum;
+ id <NSMenuItem> tempItem;
+ ITDebugLog(@"Building \"Albums\" menu.");
+ NS_DURING
+ albumsEnumerator = [[[[MainController sharedController] currentRemote] albums] objectEnumerator];
+ while ( (nextAlbum = [albumsEnumerator nextObject]) ) {
+ tempItem = [albumsMenu addItemWithTitle:nextAlbum action:@selector(performBrowseMenuAction:) keyEquivalent:@""];
+ [tempItem setRepresentedObject:nextAlbum];
+ [tempItem setTag:2];
+ [tempItem setTarget:self];
+ }
+ NS_HANDLER
+ [[MainController sharedController] networkError:localException];
+ NS_ENDHANDLER
+ ITDebugLog(@"Done Building \"Albums\" menu");
+ return albumsMenu;
+}
+