X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=MooTrackTitle.java;h=412fb246f183a521d86246068ca5ec5eb99b8a3f;hb=31f81450a303d52bf37ec8bcbb12e0f3b3b8b833;hp=fd9aa967599be3ebc647f9ee8bf792494a90db96;hpb=26f267077ef4c6df2f02aee1a60f16ebe7922bf9;p=moosique.git diff --git a/MooTrackTitle.java b/MooTrackTitle.java index fd9aa96..412fb24 100644 --- a/MooTrackTitle.java +++ b/MooTrackTitle.java @@ -50,7 +50,10 @@ public class MooTrackTitle extends JPanel { MidiEvent event; for (int i = 0; i < track.size(); i++) { event = track.get(i); - if (event instanceof MooNote) channel = ((MooNote)event).getChannel(); + if (event instanceof MooNote) { + channel = ((MooNote)event).getChannel(); + break; + } } // Creates and places components. @@ -58,15 +61,11 @@ public class MooTrackTitle extends JPanel { setBorder(BorderFactory.createLineBorder(Color.black)); setPreferredSize(new Dimension(MooTrackView.VIEW_WIDTH,70)); - title = new JTextField(trackName); // JTextField(String text, int columns) + title = new JTextField(trackName); title.setFont(Moosique.getGUI().FONT); title.addFocusListener(new TitleFocusListener()); add(title); - - JPanel checkboxes = new JPanel(); - checkboxes.setLayout(new GridLayout(1,3)); - channelBox = new JComboBox(); channelBox.setFont(Moosique.getGUI().FONT); for (int i = 1; i <= 16; i++) @@ -75,8 +74,7 @@ public class MooTrackTitle extends JPanel { channelBox.setSelectedIndex(channel); instruments = new MooInstrumentList(channelBox.getSelectedIndex()); - - instruments = new MooInstrumentList(channelBox.getSelectedIndex()); + add(instruments); channelBox.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ @@ -91,11 +89,11 @@ public class MooTrackTitle extends JPanel { mn.setChannel(chan); } }}}); - channelBox.setSelectedIndex(channel); - - add(instruments); add(channelBox); + JPanel checkboxes = new JPanel(); + checkboxes.setLayout(new GridLayout(1,3)); + mute = new JCheckBox("Mute"); mute.setSelected(Moosique.getSequencer().getTrackMute(trackNum)); mute.setFont(Moosique.getGUI().FONT);