X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooInstrumentList.java;h=88903e039eb838360a771b3129d3201819052f74;hb=f7c0dc0b216c60d93f722b040878a51399679fc2;hp=716cd182830340d35da72b8b174e1ce08ef6ffd4;hpb=48b314acf130d347f3c0e01ca7d8e9e90b5eb3b5;p=moosique.git diff --git a/MooInstrumentList.java b/MooInstrumentList.java index 716cd18..88903e0 100644 --- a/MooInstrumentList.java +++ b/MooInstrumentList.java @@ -11,16 +11,22 @@ import java.awt.event.*; public class MooInstrumentList extends JComboBox implements ActionListener { - public MooInstrumentList() { + protected int channel; + public MooInstrumentList(int chan) { super(instruments); + setChannel(chan); setFont(new Font("Helvetica", Font.PLAIN, 10)); addActionListener(this); } + public void setChannel(int chan){ + channel = chan; + setSelectedIndex(Moosique.getChannel(chan).getProgram()); + } public void actionPerformed(ActionEvent e) { JComboBox box = (JComboBox)e.getSource(); int instrument = box.getSelectedIndex(); - Moosique.getActiveChannel().programChange(instrument); + Moosique.getChannel(channel).programChange(instrument); } public static final String[] instruments = {