- public MooInstrumentList() {
- super(instruments);
- setFont(new Font("Times New Roman", Font.PLAIN, 10));
+ private int channel;
+ private ShortMessage programChangeMessage;
+ public static final int INSTRUMENTS = 0, DRUMS = 1;
+
+ /**
+ * Creates the instrument list.
+ * @param chan the channel it will operate on.
+ * @param type one of the constants: INSTRUMENTS and DRUMS
+ * @param chan the MIDI message assigning the initial program change
+ */
+ public MooInstrumentList(int chan, int listType, ShortMessage programMsg) {
+ super(instruments[listType]);
+ programChangeMessage = programMsg;
+ if (programChangeMessage != null) setSelectedIndex(programChangeMessage.getData1());
+ setChannel(chan);
+ setFont(Moosique.getGUI().FONT);