+ channelBox.setSelectedIndex(channel);
+
+ channelBox.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent e){
+ channel = channelBox.getSelectedIndex();
+ MidiEvent me;
+ MooNote mn;
+ instruments.setChannel(channel);
+ for (int j = 0; j < track.size(); j++) {
+ me = track.get(j);
+ if (me instanceof MooNote){
+ mn = (MooNote)me;
+ mn.setChannel(channel);
+ }
+ }}});
+ add(channelBox);
+
+ JPanel checkboxes = new JPanel();
+ checkboxes.setLayout(new GridLayout(1,3));
+
+ mute = new JCheckBox("Mute");
+ mute.setSelected(false);
+ Moosique.setTrackMute(track, false);
+ mute.setFont(Moosique.getGUI().FONT);
+ mute.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent event){
+ boolean selected = mute.isSelected();
+ if (selected){
+ solo.setSelected(false);
+ Moosique.setTrackSolo(track, false);
+ }
+ Moosique.setTrackMute(track, selected);
+
+ }});
+ checkboxes.add(mute);
+
+ solo = new JCheckBox("Solo");
+ solo.setSelected(false);
+ Moosique.setTrackSolo(track, false);
+ solo.setFont(Moosique.getGUI().FONT);
+ solo.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent event){
+ //setSolo
+ boolean selected = solo.isSelected();
+ if (selected){
+ mute.setSelected(false);
+ Moosique.setTrackMute(track, false);
+ }
+ Moosique.setTrackSolo(track, selected);
+ }});
+ checkboxes.add(solo);
+ add(checkboxes);
+ }
+
+ /**
+ * Returns the channel of the track that the view is visualising.
+ * @return the chanel of the visualised track
+ */
+ public int getChannel() {
+ return channel;
+ }
+
+ /**
+ * Checks if the focus is lost.
+ */
+ class TitleFocusListener extends FocusAdapter {
+ public void focusLost(FocusEvent e) {
+ // Update the MidiEvent containing the title of this track
+ }