]> ruin.nu Git - moosique.git/blob - MooInstrumentList.java
removed some stuff
[moosique.git] / MooInstrumentList.java
1 import javax.sound.midi.*;
2 import javax.swing.*;
3 import java.awt.*;
4 import java.awt.event.*;
5
6 /**
7  * A Combo Box where the instrument of the currently active channel can be selected.
8  * 
9  * @author  Einar Pehrson, Michael Andreen
10  */
11  
12 public class MooInstrumentList extends JComboBox implements ActionListener {
13
14         protected int channel;
15         public MooInstrumentList(int chan) {
16                 super(instruments);
17                 setChannel(chan);       
18                 setFont(new Font("Helvetica", Font.PLAIN, 10));
19                 addActionListener(this);
20         }
21
22         public void setChannel(int chan){
23                 channel = chan;
24                 setSelectedIndex(Moosique.getChannel(channel).getProgram());
25         }
26
27         public void actionPerformed(ActionEvent e) {
28                 JComboBox box = (JComboBox)e.getSource();
29                 int instrument = box.getSelectedIndex();
30                 Moosique.getChannel(channel).programChange(instrument);
31         }
32     
33         public static final String[] instruments = {
34                 " 0 Acoustic Grand Piano",
35                 " 1 Bright Acoustic Piano",
36                 " 2 Electric Grand Piano",
37                 " 3 Honky-Tonk Piano",
38                 " 4 Rhodes Piano",
39                 " 5 Chorused Piano",
40                 " 6 Harpischord",
41                 " 7 Clavinet",
42                 " 8 Celesta",
43                 " 9 Glockenspiel",
44                 " 10 Music Box",
45                 " 11 Vibraphone",
46                 " 12 Marimba",
47                 " 13 Xylophone",
48                 " 14 Tubular Bells",
49                 " 15 Dulcimer",
50                 " 16 Hammond Organ",
51                 " 17 Percussive Organ",
52                 " 18 Rock Organ",
53                 " 19 Church Organ",
54                 " 20 Reed Organ",
55                 " 21 Accordion",
56                 " 22 Harmonica",
57                 " 23 Tango Accordion",
58                 " 24 Acoustic Nylon Guitar",
59                 " 25 Acoustic Steel Guitar",
60                 " 26 Electric Jazz Guitar",
61                 " 27 Electric Clean Guitar",
62                 " 28 Electric Muted Guitar",
63                 " 29 Overdriven Guitar",
64                 " 30 Distortion Guitar",
65                 " 31 Guitar Harmonics",
66                 " 32 Acoustic Bass",
67                 " 33 Electric Bass Fingered",
68                 " 34 Electric Bass Picked",
69                 " 35 Fretless Bass",
70                 " 36 Slap Bass 1",
71                 " 37 Slap Bass 2",
72                 " 38 Synth Bass 1",
73                 " 39 Synth Bass 2",
74                 " 40 Violin",
75                 " 41 Viola",
76                 " 42 Cello",
77                 " 43 Contrabass",
78                 " 44 Tremolo Strings",
79                 " 45 Pizzicato Strings",
80                 " 46 Orchestral Harp",
81                 " 47 Timpani",
82                 " 48 String Ensemble 1",
83                 " 49 String Ensemble 2",
84                 " 50 Synth Strings 1",
85                 " 51 Synth Strings 2",
86                 " 52 Choir Aahs",
87                 " 53 Voice Oohs",
88                 " 54 Synth Voice",
89                 " 55 Orchestral Hit",
90                 " 56 Trumpet",
91                 " 57 Trombone",
92                 " 58 Tuba",
93                 " 59 Muted Trumpet",
94                 " 60 French Horn",
95                 " 61 Brass Section",
96                 " 62 Synth Brass 1",
97                 " 63 Synth Brass 2",
98                 " 64 Soprano Sax",
99                 " 65 Alto Sax",
100                 " 66 Tenor Sax",
101                 " 67 Baritone Sax",
102                 " 68 Oboe",
103                 " 69 English Horn",
104                 " 70 Bassoon",
105                 " 71 Clarinet",
106                 " 72 Piccolo",
107                 " 73 Flute",
108                 " 74 Recorder",
109                 " 75 Pan Flute",
110                 " 76 Bottle Blow",
111                 " 77 Shakuhachi",
112                 " 78 Whistle",
113                 " 79 Ocarina",
114                 " 80 Synth Lead 1 Square Wave Lead",
115                 " 81 Synth Lead 2 Sawtooth Wave Lead",
116                 " 82 Synth Lead 3 Caliope Lead",
117                 " 83 Synth Lead 4 Chiff Lead",
118                 " 84 Synth Lead 5 Charang",
119                 " 85 Synth Lead 6 Solo Synth Voice",
120                 " 86 Synth Lead 7 Bright Saw Wave",
121                 " 87 Synth Lead 8 Brass and Lead",
122                 " 88 Synth Pad 1 Fantasia Pad",
123                 " 89 Synth Pad 2 Warm Pad",
124                 " 90 Synth Pad 3 Poly Synth Pad",
125                 " 91 Synth Pad 4 Space Voice Pad",
126                 " 92 Synth Pad 5 Bowed Glass Pad",
127                 " 93 Synth Pad 6 Metal Pad",
128                 " 94 Synth Pad 7 Halo Pad",
129                 " 95 Synth Pad 8 Sweep Pad",
130                 " 96 Synth SFX 1 Ice Rain",
131                 " 97 Synth SFX 2 Sound Track",
132                 " 98 Synth SFX 3 Crystal",
133                 " 99 Synth SFX 4 Atmosphere",
134                 " 100 Synth SFX 5 Brightness",
135                 " 101 Synth SFX 6 Goblin",
136                 " 102 Synth SFX 7 Echo Drops",
137                 " 103 Synth SFX 8 Star Theme",
138                 " 104 Sitar",
139                 " 105 Banjo",
140                 " 106 Shamisen",
141                 " 107 Koto",
142                 " 108 Kalimba",
143                 " 109 Bagpipe",
144                 " 110 Fiddle",
145                 " 111 Shanai",
146                 " 112 Tinkle Bells",
147                 " 113 Agogo",
148                 " 114 Steel Drums",
149                 " 115 Woodblock",
150                 " 116 Taiko Drum",
151                 " 117 Melodic Tom",
152                 " 118 Synth Drum",
153                 " 119 Reverse Cymbal",
154                 " 120 Guitar Fret Noise",
155                 " 121 Breath Noise",
156                 " 122 Seashore",
157                 " 123 Bird Tweet",
158                 " 124 Telephone Ring",
159                 " 125 Helicopter",
160                 " 126 Applause",
161                 " 127 Gunshot"
162         };
163 }