- channel.addItemListener(new ItemListener(){
- public void itemStateChanged(ItemEvent e){
- Object ob = channel.getSelectedItem();
- if (ob instanceof Integer){
- int chan = ((Integer)ob).intValue();
- //set channel
- MidiEvent me;
- MooNote mn;
- for (int j = 0; j < track.size(); j++) {
- me = track.get(j);
- if (me instanceof MooNote){
- mn = (MooNote)me;
- mn.setChannel(chan);
- System.out.println(ob);
- }
- }
- }
+ instruments = new MooInstrumentList(channel.getSelectedIndex());
+
+ channel.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent e){
+ int chan = channel.getSelectedIndex();
+ MidiEvent me;
+ MooNote mn;
+ instruments.setChannel(channel.getSelectedIndex());
+ for (int j = 0; j < track.size(); j++) {
+ me = track.get(j);
+ if (me instanceof MooNote){
+ mn = (MooNote)me;
+ mn.setChannel(chan);
+ }
+ }