1 |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
4 |
* Copyright (C) 2005-2006 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
6 |
* This file is part of JSampler. |
7 |
* |
8 |
* JSampler is free software; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License version 2 |
10 |
* as published by the Free Software Foundation. |
11 |
* |
12 |
* JSampler is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with JSampler; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
20 |
* MA 02111-1307 USA |
21 |
*/ |
22 |
|
23 |
package org.jsampler; |
24 |
|
25 |
import java.util.Vector; |
26 |
|
27 |
import org.jsampler.event.ListEvent; |
28 |
import org.jsampler.event.ListListener; |
29 |
|
30 |
|
31 |
/** |
32 |
* |
33 |
* @author Grigor Iliev |
34 |
*/ |
35 |
public class MidiInstrumentMapList { |
36 |
private final Vector<MidiInstrumentMap> maps = new Vector<MidiInstrumentMap>(); |
37 |
private final Vector<ListListener<MidiInstrumentMap>> listeners = |
38 |
new Vector<ListListener<MidiInstrumentMap>>(); |
39 |
|
40 |
/** Creates a new instance of MidiInstrumentMapList */ |
41 |
public MidiInstrumentMapList() { |
42 |
} |
43 |
|
44 |
/** |
45 |
* Registers the specified listener for receiving event messages. |
46 |
* @param l The <code>ListListener</code> to register. |
47 |
*/ |
48 |
public void |
49 |
addMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> l) { |
50 |
listeners.add(l); |
51 |
} |
52 |
|
53 |
/** |
54 |
* Removes the specified listener. |
55 |
* @param l The <code>ListListener</code> to remove. |
56 |
*/ |
57 |
public void |
58 |
removeMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> l) { |
59 |
listeners.remove(l); |
60 |
} |
61 |
|
62 |
/** |
63 |
* Gets the current number of MIDI instrument maps in the list. |
64 |
* @return The current number of MIDI instrument maps in the list. |
65 |
*/ |
66 |
public int |
67 |
getMidiInstrumentMapCount() { return maps.size(); } |
68 |
|
69 |
/** |
70 |
* Gets the MIDI instrument map at the specified position. |
71 |
* @param idx The index of the MIDI instrument map to be returned. |
72 |
* @return The MIDI instrument map at the specified position. |
73 |
*/ |
74 |
public MidiInstrumentMap |
75 |
getMidiInstrumentMap(int idx) { return maps.get(idx); } |
76 |
|
77 |
/** |
78 |
* Adds the specified MIDI instrument map to the list. |
79 |
* @param map The MIDI instrument map to be added. |
80 |
* @throws IllegalArgumentException If <code>map</code> is <code>null</code>. |
81 |
*/ |
82 |
public void |
83 |
addMidiInstrumentMap(MidiInstrumentMap map) { |
84 |
|
85 |
} |
86 |
|
87 |
/** |
88 |
* Removes the specified MIDI instrument map from the list. |
89 |
* @param idx The index of the MIDI instrument map to remove. |
90 |
*/ |
91 |
public void |
92 |
removeMidiInstrumentMap(int idx) { |
93 |
|
94 |
} |
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
} |