+- (NSMenu *)artistsMenu
+{
+ NSMenu *artistsMenu = [[NSMenu alloc] initWithTitle:@"Artists"];
+ 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 setTarget:self];
+ }
+ NS_HANDLER
+ [[MainController sharedController] networkError:localException];
+ NS_ENDHANDLER
+ ITDebugLog(@"Done Building \"Artists\" menu");
+ return artistsMenu;
+}
+
+- (NSMenu *)albumsMenu
+{
+ NSMenu *albumsMenu = [[NSMenu alloc] initWithTitle:@"Albums"];
+ 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 setTarget:self];
+ }
+ NS_HANDLER
+ [[MainController sharedController] networkError:localException];
+ NS_ENDHANDLER
+ ITDebugLog(@"Done Building \"Albums\" menu");
+ return albumsMenu;
+}
+