--- interface/ncurs_c.c.old	Tue Mar 13 09:01:19 2001
+++ interface/ncurs_c.c	Wed Aug  1 22:21:27 2001
@@ -124,6 +124,7 @@
 #define GS_LCD_CLEAR_TIME 10.0
 #define GS_LCD_WIDTH 40
 
+char *lookup_instrument_name(int,char*);
 extern int set_extension_modes(char *flag);
 
 static struct
@@ -605,7 +606,8 @@
 			waddstr(dftwin, prog->name);
 		    }
 		    if(prog->comment != NULL)
-			wprintw(dftwin, "(%s)", prog->comment);
+			wprintw(dftwin, "(%s,%s)", prog->comment,
+				lookup_instrument_name(ChannelStatus[ch].prog + progbase,prog->name));
 		}
 		else if(type == INST_SF2)
 		{
@@ -3057,9 +3059,15 @@
 	    current_indicator_chan = first_ch;
 	}
 
-	snprintf(current_indicator_message, indicator_width, "%03d:%s   ",
+	snprintf(current_indicator_message, indicator_width, "%03d:%s(%s)   ",
 		 ChannelStatus[current_indicator_chan].prog,
-		 ChannelStatus[current_indicator_chan].comm);
+		 ChannelStatus[current_indicator_chan].comm,
+		 lookup_instrument_name(ChannelStatus[current_indicator_chan].prog,
+					ChannelStatus[current_indicator_chan].comm));
+//	snprintf(current_indicator_message, indicator_width, "%03d:%s   ",
+//		 ChannelStatus[current_indicator_chan].prog,
+//		 ChannelStatus[current_indicator_chan].comm
+//		 );
 	indicator_msgptr = current_indicator_message;
     }
 
@@ -3697,4 +3705,28 @@
 ControlMode *interface_n_loader(void)
 {
     return &ctl;
 }
+
+char *lookup_instrument_name(int id,char *shortname)
+{
+  static char name[1024];
+  char buf[1024];
+  FILE *fp=fopen("/usr/local/share/timidity/instrumentlist","r");
+  name[0]=0;
+  if(!fp) return name;
+  while(fgets(buf,1024,fp)) {
+    int a,where;
+    char b[1024],c[1024];
+    if(buf[strlen(buf)-1]=='\n')
+      buf[strlen(buf)-1]=0;
+    if(sscanf(buf,"%d %s %n",&a,b,&where)<2)
+      continue;
+    if(id==a && strcasecmp(b,shortname)==0) {
+      strcpy(name,buf+where);
+      break;
+    } else if(id==a && strcmp(b,"*")==0)
+      strcpy(name,buf+where);
+  }
+  fclose(fp);
+  return name;
+}

