]> ruin.nu Git - moosique.git/blobdiff - MooTrackTitle.java
no message
[moosique.git] / MooTrackTitle.java
index 3090852634d97c75df761c4103db5855921e8fda..b32479fd43cd0fa05ff76fd2878f45cac28834e4 100644 (file)
@@ -1,4 +1,7 @@
 import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import javax.sound.midi.*;
 
 /**
  * The title bar for each track with track name, channel, instrument etc.
@@ -7,19 +10,67 @@ import javax.swing.*;
  * @version 1
  */
  
-public class MooTrackTitle {
+public class MooTrackTitle extends JPanel {
 
+       private JTextField title;
+       private MooInstrumentList instruments;
+       private JComboBox channel;
+       private JCheckBox mute;
+       private JCheckBox solo;
        /** 
         * Creates the title bar.
         */
-       public MooTrackTitle () {
+       public MooTrackTitle (Track track) {
+               setLayout(new GridLayout(4,1));
 
+               title = new JTextField(); // JTextField(String text, int columns) 
+               title.setFont(Moosique.getGUI().FONT);
+               title.addFocusListener(new TitleFocusListener());
+               add(title);
+
+               instruments = new MooInstrumentList();
+               add(instruments);
+
+               JPanel checkboxes = new JPanel();
+               checkboxes.setLayout(new GridLayout(1,3));
+
+               channel = new JComboBox();
+               channel.setFont(Moosique.getGUI().FONT);
+               for (int i = 1; i <= 16; i++)
+                       channel.addItem(new Integer(i));
+               channel.addItemListener(new ItemListener(){
+                               public void itemStateChanged(ItemEvent e){
+                                       Object ob = channel.getSelectedItem();
+                                       if (ob instanceof Integer){
+                                               //set channel
+                                       }
+                               }});
+               add(channel);
+               
+
+               mute = new JCheckBox("Mute");
+               mute.setFont(Moosique.getGUI().FONT);
+               mute.addActionListener(new ActionListener(){
+                               public void actionPerformed(ActionEvent event){
+                                       //setMute
+                                       solo.setSelected(false);
+                               }});
+               checkboxes.add(mute);
+
+               solo = new JCheckBox("Solo");
+               solo.setFont(Moosique.getGUI().FONT);
+               solo.addActionListener(new ActionListener(){
+                               public void actionPerformed(ActionEvent event){
+                                       //setSolo
+                                       mute.setSelected(false);
+                               }});
+               checkboxes.add(solo);
+               add(checkboxes);
        }
 
-       /** 
-        * 
-        */
-       public void () {
-       
+       class TitleFocusListener extends FocusAdapter {
+               public void focusLost(FocusEvent e) {
+                       // Update the MidiEvent containing the title of this track
+               }
        }
-}
+}
\ No newline at end of file