30 |
* @author Grigor Iliev |
* @author Grigor Iliev |
31 |
*/ |
*/ |
32 |
public class MidiPort { |
public class MidiPort { |
33 |
private String name = null; |
private Parameter<String> name; |
34 |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
35 |
|
|
36 |
/** |
/** |
38 |
* @return The name of this MIDI port. |
* @return The name of this MIDI port. |
39 |
*/ |
*/ |
40 |
public String |
public String |
41 |
getName() { return name; } |
getName() { return name == null ? null : name.getValue(); } |
42 |
|
|
43 |
/** |
/** |
44 |
* Sets the name of this MIDI port. |
* Gets the <code>NAME</code> parameter. |
45 |
* @param name A <code>String</code> object containing the new name for this MIDI port. |
* @return A <code>Parameter<String></code> instance. |
46 |
|
*/ |
47 |
|
public Parameter<String> |
48 |
|
getNameParameter() { return name; } |
49 |
|
|
50 |
|
/** |
51 |
|
* Sets the <code>NAME</code> parameter. |
52 |
|
* @param name A <code>Parameter<String></code> instance. |
53 |
*/ |
*/ |
54 |
public void |
public void |
55 |
setName(String name) { this.name = name; } |
setNameParameter(Parameter<String> name) { this.name = name; } |
56 |
|
|
57 |
/** |
/** |
58 |
* Adds additional parameter to this MIDI port. |
* Adds additional parameter to this MIDI port. |
77 |
hasAdditionalParameters() { return !prmList.isEmpty(); } |
hasAdditionalParameters() { return !prmList.isEmpty(); } |
78 |
|
|
79 |
/** |
/** |
80 |
|
* Gets a <code>Parameter</code> array providing all parameters |
81 |
|
* of this MIDI port (including <code>NAME</code> parameter). |
82 |
|
* @return A <code>Parameter</code> array providing all parameters |
83 |
|
* of this MIDI port. |
84 |
|
*/ |
85 |
|
public Parameter[] |
86 |
|
getAllParameters() { |
87 |
|
Parameter[] params = new Parameter[prmList.size() + 1]; |
88 |
|
params[0] = getNameParameter(); |
89 |
|
for(int i = 0; i < prmList.size(); i++) params[i + 1] = prmList.get(i); |
90 |
|
return params; |
91 |
|
} |
92 |
|
|
93 |
|
/** |
94 |
* Returns the name of this MIDI port. |
* Returns the name of this MIDI port. |
95 |
* @return The name of this MIDI port. |
* @return The name of this MIDI port. |
96 |
*/ |
*/ |