]> ruin.nu Git - moosique.git/blobdiff - MooTrackTitle.java
Fixed accessors, encoders and decoders for tempo and time signature.
[moosique.git] / MooTrackTitle.java
index f7f5c079e4ebf1e84741eee29fe73981629e5c1b..6a3e1b5f8cb638d331aedb00a3d4b7b726ef1bfe 100644 (file)
@@ -39,7 +39,7 @@ public class MooTrackTitle extends JPanel {
 
        /** 
         * Creates the title bar.
-        * @param aTrack the track that this tracktitle is operating on.
+        * @param aTrack the track that this track title is operating on.
         */
        public MooTrackTitle (Track aTrack) {
                setDoubleBuffered(true);
@@ -56,9 +56,9 @@ public class MooTrackTitle extends JPanel {
                                        trackNameMessage = (MetaMessage)msg;
                                        trackName = new String(trackNameMessage.getData());
                                }
-                       } else if (status >= 192 && status <= 207) {
+                       } else if (status >= 192 && status < 208) {
                                programChangeMessage = (ShortMessage)msg;
-                               channel = status - 192;
+                               channel = programChangeMessage.getChannel();
                        }
                }
 
@@ -76,8 +76,7 @@ public class MooTrackTitle extends JPanel {
                int type;
                if (channel == 9) type = MooInstrumentList.DRUMS;
                else type = MooInstrumentList.INSTRUMENTS;
-               instruments = new MooInstrumentList(channel, type);
-               // instruments = new MooInstrumentList(channel, type, programChangeMessage);
+               instruments = new MooInstrumentList(channel, type, programChangeMessage);
                add(instruments);
 
                channelBox = new JComboBox();
@@ -175,7 +174,14 @@ public class MooTrackTitle extends JPanel {
                                Moosique.setTrackSolo(track, selected);
                        } else if (source == record) {
                                Sequencer sequencer = Moosique.getSequencer();
+                               boolean quantize = false;
                                if (record.getText() == "Record") {
+                                       /* Show a dialog with:
+                                               "Track" combo box,
+                                               "Channel" combo box (disabled?,
+                                               "Quantize" checkbox and 
+                                               "Start Recording" button.
+                                       */
                                        record.setText("Stop");
                                        mtv.enableKeyboardRecording();
                                        sequencer.recordEnable(track, channel);
@@ -186,7 +192,8 @@ public class MooTrackTitle extends JPanel {
                                        mtv.disableKeyboardRecording();
                                        sequencer.stopRecording();
                                        sequencer.recordDisable(track);
-                                       mtv.placeNoteElements();
+                                       java.util.List newNotes = Moosique.convertTrack(track, quantize);
+                                       mtv.placeNewNotes(newNotes);
                                }
                        }
                }