X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=blobdiff_plain;f=MooTrackTitle.java;h=9cffb14570bbd48633e380441963e0865188b78b;hp=6a3e1b5f8cb638d331aedb00a3d4b7b726ef1bfe;hb=HEAD;hpb=1d2d2bfd14ba0addab97692527d4414d3a87e13d diff --git a/MooTrackTitle.java b/MooTrackTitle.java index 6a3e1b5..9cffb14 100644 --- a/MooTrackTitle.java +++ b/MooTrackTitle.java @@ -22,7 +22,6 @@ public class MooTrackTitle extends JPanel { private JComboBox channelBox; private JCheckBox mute; private JCheckBox solo; - private JButton record; private String trackName = ""; private int channel = 0; @@ -106,11 +105,6 @@ public class MooTrackTitle extends JPanel { solo.addActionListener(tl); checkboxes.add(solo); - record = new JButton("Record"); - record.setFont(Moosique.getGUI().FONT); - record.addActionListener(tl); - checkboxes.add(record); - add(checkboxes); } @@ -131,11 +125,13 @@ public class MooTrackTitle extends JPanel { } /** - * Checks if the focus is lost. + * When the title field loses focus, updates the corresponding MidiEvent. */ class TitleFocusListener extends FocusAdapter { public void focusLost(FocusEvent e) { - // Update the MidiEvent containing the title of this track + try { + trackNameMessage.setMessage(3, title.getText().getBytes(), title.getText().length()); + } catch (InvalidMidiDataException ex) {} } } @@ -150,7 +146,7 @@ public class MooTrackTitle extends JPanel { MidiEvent me; MooNote mn; instruments.setChannel(channel); - // Query the user before rechannelling??? + // Prompt the user before rechannelling??? for (int j = 0; j < track.size(); j++) { me = track.get(j); if (me instanceof MooNote){ @@ -172,29 +168,6 @@ public class MooTrackTitle extends JPanel { Moosique.setTrackMute(track, false); } 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); - sequencer.startRecording(); - Moosique.setEdited(); - } else { - record.setText("Record"); - mtv.disableKeyboardRecording(); - sequencer.stopRecording(); - sequencer.recordDisable(track); - java.util.List newNotes = Moosique.convertTrack(track, quantize); - mtv.placeNewNotes(newNotes); - } } } }