X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooTrackTitle.java;h=f2bed14e37b919130e2c6abda153bdc113aed64c;hp=258e9d45deda3e58cbb44fb9fa0a88ae90fd25e8;hb=fed0170e819d14b07d7081a0a314ebabac3b29fe;hpb=b3d872320a15a463a93e35b1f14023a5744e27da diff --git a/MooTrackTitle.java b/MooTrackTitle.java index 258e9d4..f2bed14 100644 --- a/MooTrackTitle.java +++ b/MooTrackTitle.java @@ -60,8 +60,11 @@ public class MooTrackTitle extends JPanel { title.addFocusListener(new TitleFocusListener()); add(title); - instruments = new MooInstrumentList(channel); - // instruments = new MooInstrumentList(channel, programChangeMessage); + int type; + if (channel == 9) type = MooInstrumentList.DRUMS; + else type = MooInstrumentList.INSTRUMENTS; + instruments = new MooInstrumentList(channel, type); + // instruments = new MooInstrumentList(channel, type, programChangeMessage); add(instruments); channelBox = new JComboBox(); @@ -73,15 +76,15 @@ public class MooTrackTitle extends JPanel { channelBox.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ - int chan = channelBox.getSelectedIndex(); + channel = channelBox.getSelectedIndex(); MidiEvent me; MooNote mn; - instruments.setChannel(channelBox.getSelectedIndex()); + instruments.setChannel(channel); for (int j = 0; j < track.size(); j++) { me = track.get(j); if (me instanceof MooNote){ mn = (MooNote)me; - mn.setChannel(chan); + mn.setChannel(channel); } }}}); add(channelBox); @@ -90,22 +93,24 @@ public class MooTrackTitle extends JPanel { checkboxes.setLayout(new GridLayout(1,3)); mute = new JCheckBox("Mute"); - mute.setSelected(Moosique.getChannel(channel).getMute()); + mute.setSelected(false); + Moosique.setTrackMute(track, false); mute.setFont(Moosique.getGUI().FONT); mute.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ boolean selected = mute.isSelected(); if (selected){ solo.setSelected(false); - Moosique.getChannel(channel).setSolo(false); + Moosique.setTrackSolo(track, false); } - Moosique.getChannel(channel).setMute(selected); + Moosique.setTrackMute(track, selected); }}); checkboxes.add(mute); solo = new JCheckBox("Solo"); - solo.setSelected(Moosique.getChannel(channel).getSolo()); + solo.setSelected(false); + Moosique.setTrackSolo(track, false); solo.setFont(Moosique.getGUI().FONT); solo.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ @@ -113,13 +118,21 @@ public class MooTrackTitle extends JPanel { boolean selected = solo.isSelected(); if (selected){ mute.setSelected(false); - Moosique.getChannel(channel).setMute(false); + Moosique.setTrackMute(track, false); } - Moosique.getChannel(channel).setSolo(selected); + Moosique.setTrackSolo(track, selected); }}); checkboxes.add(solo); add(checkboxes); } + + /** + * Returns the channel of the track that the view is visualising. + * @return the chanel of the visualised track + */ + public int getChannel() { + return channel; + } /** * Checks if the focus is lost.