]> ruin.nu Git - moosique.git/blobdiff - MooTrackTitle.java
stuff..
[moosique.git] / MooTrackTitle.java
index a17c071eb90cd0d8dd841e88ffdba5663b6ced30..fd9aa967599be3ebc647f9ee8bf792494a90db96 100644 (file)
@@ -28,6 +28,7 @@ public class MooTrackTitle extends JPanel {
         * Creates the title bar.
         */
        public MooTrackTitle (Track aTrack, int aTrackNum) {
+               setDoubleBuffered(true);
                track = aTrack;
                this.trackNum = aTrackNum;
 
@@ -62,8 +63,6 @@ public class MooTrackTitle extends JPanel {
                title.addFocusListener(new TitleFocusListener());
                add(title);
 
-               instruments = new MooInstrumentList(programChange);
-               add(instruments);
 
                JPanel checkboxes = new JPanel();
                checkboxes.setLayout(new GridLayout(1,3));
@@ -73,14 +72,9 @@ public class MooTrackTitle extends JPanel {
                for (int i = 1; i <= 16; i++)
                        channelBox.addItem(new Integer(i));
 
-               for (int j = 0; j < track.size(); j++) {
-                       MidiEvent me = track.get(j);
-               if (me instanceof MooNote){
-                               MooNote mn = (MooNote)me;
-                               channelBox.setSelectedIndex(mn.getChannel());
-                               break;
-                       }
-        }
+               channelBox.setSelectedIndex(channel);
+
+               instruments = new MooInstrumentList(channelBox.getSelectedIndex());
 
                instruments = new MooInstrumentList(channelBox.getSelectedIndex());
 
@@ -98,6 +92,8 @@ public class MooTrackTitle extends JPanel {
                                                }
                                }}});
                channelBox.setSelectedIndex(channel);
+
+               add(instruments);
                add(channelBox);
 
                mute = new JCheckBox("Mute");