]> ruin.nu Git - moosique.git/blobdiff - MooDialog.java
*** empty log message ***
[moosique.git] / MooDialog.java
index 8eb2b8c61fd43c4d5641fb5f111c062560c09cf4..860b91edc83ac8951e043b3fc5a6aa14c2618875 100644 (file)
@@ -26,7 +26,8 @@ public class MooDialog extends JDialog {
                                MANUAL = 6,
                                INSERT_MEASURE = 7,
                                DELETE_MEASURE = 8,
-                               SET_TEMPO = 9;
+                               SET_TEMPO = 9,
+                               PREFERENCES = 10;
        
        /**
         * Constructor of the dialogs.
@@ -49,6 +50,7 @@ public class MooDialog extends JDialog {
                        case INSERT_MEASURE:    makeInsertMeasureDialog(pane); break;
                        case DELETE_MEASURE:    makeDeleteMeasureDialog(pane); break;
                        case SET_TEMPO:         makeSetTempoDialog(pane); break;
+                       case PREFERENCES:       makePrefsDialog(pane); break;
                }
         }
        
@@ -437,6 +439,25 @@ public class MooDialog extends JDialog {
                setVisible(true);
        }
 
+       private void makePrefsDialog(Container pane) {
+               /*              
+               MidiDevice.Info[] devInfo = MidiSystem.getMidiDeviceInfo();
+               for (int i = 0; i < devInfo.length; i++) {
+                       if (MidiSystem.getMidiDevice(devInfo[i]) instanceof Sequencer) {
+                       
+                       } else if (MidiSystem.getMidiDevice(devInfo[i]) instanceof Synthesizer) {
+                       
+                       }
+               }
+               String[] seqNames, synthNames;
+               JPanel pane = (JPanel) this.getContentPane();
+               pane.add(new JLabel("Sequencer"));
+               JComboBox seqBox = new JComboBox(seqNames);
+               pane.add(new JLabel("Synthesizer"));
+               JComboBox synthBox = new JComboBox(synthNames);
+               */
+       }
+
        private MooNote note;
        private JOptionPane optionPane;
        private JTextField pitch;
@@ -448,27 +469,24 @@ public class MooDialog extends JDialog {
         * @param mn    the note that will be graphically represented
         */
        public MooDialog(MooNote mn) {
-               super(Moosique.getGUI(), "Note properties", false);
+               super(Moosique.getGUI(), "Note properties", true);
+               JPanel panel = new JPanel();
+               panel.setLayout(new GridLayout(3,2));
                note = mn;
                pitch = new JTextField(new Integer(note.getPitch()).toString(),3);
-               JPanel pitchpanel = new JPanel();
-               pitchpanel.add(new Label("Pitch: "));
-               pitchpanel.add(pitch);
+               panel.add(new Label("Pitch: "));
+               panel.add(pitch);
 
                velocity = new JTextField(new Integer(note.getVelocity()).toString(),3);
-               JPanel velocitypanel = new JPanel();
-               velocitypanel.add(new Label("Velocity: "));
-               velocitypanel.add(velocity);
+               panel.add(new Label("Velocity: "));
+               panel.add(velocity);
 
                length = new JTextField(new Integer(note.getDuration()).toString(),5);
-               JPanel lengthpanel = new JPanel();
-               lengthpanel.add(new Label("Length: "));
-               lengthpanel.add(length);
+               panel.add(new Label("Length: "));
+               panel.add(length);
 
                Object[] array = {"Set the note properties",
-                               pitchpanel,
-                               velocitypanel,
-                               lengthpanel};
+                               panel};
        
                final String btnString1 = "Apply changes";
                final String btnString2 = "Cancel";