30 |
* @author Grigor Iliev |
* @author Grigor Iliev |
31 |
*/ |
*/ |
32 |
public class AudioOutputChannel { |
public class AudioOutputChannel { |
33 |
private String name = null; |
private Parameter<String> name; |
34 |
private boolean mixChannel = false; |
private Parameter<Boolean> mixChannel; |
35 |
private int mcDst = 0; |
private Parameter<Integer> mcDst; |
36 |
|
|
37 |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
private final Vector<Parameter> prmList = new Vector<Parameter>(); |
38 |
|
|
39 |
|
|
40 |
/** Creates a new instance of AudioOutputChannel */ |
/** Creates a new instance of AudioOutputChannel */ |
41 |
public AudioOutputChannel() { |
public |
42 |
|
AudioOutputChannel() { |
43 |
} |
} |
44 |
|
|
45 |
/** |
/** |
47 |
* @return The name of this audio output channel. |
* @return The name of this audio output channel. |
48 |
*/ |
*/ |
49 |
public String |
public String |
50 |
getName() { return name; } |
getName() { return name == null ? null : name.getValue(); } |
51 |
|
|
52 |
/** |
/** |
53 |
* Sets the name of this audio output channel. |
* Gets the <code>NAME</code> parameter. |
54 |
* @param name A <code>String</code> object containing the new name |
* @return A <code>Parameter<String></code> instance. |
55 |
* for this audio output channel. |
*/ |
56 |
|
public Parameter<String> |
57 |
|
getNameParameter() { return name; } |
58 |
|
|
59 |
|
/** |
60 |
|
* Sets the <code>NAME</code> parameter. |
61 |
|
* @param name A <code>Parameter<String></code> instance. |
62 |
*/ |
*/ |
63 |
public void |
public void |
64 |
setName(String name) { this.name = name; } |
setNameParameter(Parameter<String> name) { this.name = name; } |
65 |
|
|
66 |
/** |
/** |
67 |
* Determines whether this channel is a mix-channel. |
* Determines whether this channel is a mix-channel. |
68 |
* @return <code>true</code> if this is a mix-channel, <code>false</code> otherwise. |
* @return <code>true</code> if this is a mix-channel, <code>false</code> otherwise. |
69 |
*/ |
*/ |
70 |
public boolean |
public boolean |
71 |
isMixChannel() { return mixChannel; } |
isMixChannel() { return mixChannel == null ? false : mixChannel.getValue(); } |
72 |
|
|
73 |
|
/** |
74 |
|
* Gets the <code>IS_MIX_CHANNEL</code> parameter. |
75 |
|
* @return A <code>Parameter<Integer></code> instance. |
76 |
|
*/ |
77 |
|
public Parameter<Boolean> |
78 |
|
getMixChannelParameter() { return mixChannel; } |
79 |
|
|
80 |
/** |
/** |
81 |
* Sets whether this channel is a mix-channel. |
* Sets whether this channel is a mix-channel. |
82 |
* @param mixChannel Specifies whether this channel is a mix-channel or not. |
* @param mixChannel Specifies whether this channel is a mix-channel or not. |
83 |
*/ |
*/ |
84 |
public void |
public void |
85 |
setMixChannel(boolean mixChannel) { this.mixChannel = mixChannel; } |
setMixChannelParameter(Parameter<Boolean> mixChannel) { |
86 |
|
this.mixChannel = mixChannel; |
87 |
|
} |
88 |
|
|
89 |
/** |
/** |
90 |
* Gets the number of the real audio channel this mix channel refers to. |
* Gets the number of the real audio channel this mix channel refers to. |
91 |
* @return The number of the real audio channel this mix channel refers to. |
* @return The number of the real audio channel this mix channel refers to. |
92 |
*/ |
*/ |
93 |
public int |
public int |
94 |
getMixChannelDest() { return mcDst; } |
getMixChannelDest() { return mcDst == null ? -1 : mcDst.getValue(); } |
95 |
|
|
96 |
|
/** |
97 |
|
* Gets the <code>MIX_CHANNEL_DESTINATION</code> parameter. |
98 |
|
* @return The <code>MIX_CHANNEL_DESTINATION</code> parameter. |
99 |
|
*/ |
100 |
|
public Parameter<Integer> |
101 |
|
getMixChannelDestParameter() { return mcDst; } |
102 |
|
|
103 |
/** |
/** |
104 |
* Sets the number of the real audio channel this mix channel refers to. |
* Sets the <code>MIX_CHANNEL_DESTINATION</code> parameter. |
105 |
* @param chNum The number of the real audio channel this mix channel refers to. |
* @param mcDst The new <code>MIX_CHANNEL_DESTINATION</code> parameter. |
106 |
*/ |
*/ |
107 |
public void |
public void |
108 |
setMixChannelDest(int chNum) { mcDst = chNum; } |
setMixChannelDestParameter(Parameter<Integer> mcDst) { this.mcDst = mcDst; } |
109 |
|
|
110 |
/** |
/** |
111 |
* Adds additional parameter to this audio output channel. |
* Adds additional parameter to this audio output channel. |
115 |
addParameter(Parameter prm) { prmList.add(prm); } |
addParameter(Parameter prm) { prmList.add(prm); } |
116 |
|
|
117 |
/** |
/** |
118 |
* Gets an <code>Parameter</code> array with the additional parameters |
* Gets a <code>Parameter</code> array with the additional parameters |
119 |
* of this audio output channel. |
* of this audio output channel. |
120 |
* @return An <code>Parameter</code> array with the additional parameters |
* @return A <code>Parameter</code> array with the additional parameters |
121 |
* of this audio output channel. |
* of this audio output channel. |
122 |
*/ |
*/ |
123 |
public Parameter[] |
public Parameter[] |
126 |
} |
} |
127 |
|
|
128 |
/** |
/** |
129 |
|
* Gets a <code>Parameter</code> array providing all parameters |
130 |
|
* of this audio output channel (including <code>NAME</code>, |
131 |
|
* <code>IS_MIX_CHANNEL</code>, <code>MIX_CHANNEL_DESTINATION</code> parameters). |
132 |
|
* @return A <code>Parameter</code> array providing all parameters |
133 |
|
* of this audio output channel. |
134 |
|
*/ |
135 |
|
public Parameter[] |
136 |
|
getAllParameters() { |
137 |
|
Parameter[] params; |
138 |
|
|
139 |
|
if(getMixChannelDestParameter() != null) { |
140 |
|
params = new Parameter[prmList.size() + 3]; |
141 |
|
params[2] = getMixChannelDestParameter(); |
142 |
|
for(int i = 0; i < prmList.size(); i++) params[i + 3] = prmList.get(i); |
143 |
|
} else { |
144 |
|
params = new Parameter[prmList.size() + 2]; |
145 |
|
for(int i = 0; i < prmList.size(); i++) params[i + 2] = prmList.get(i); |
146 |
|
} |
147 |
|
|
148 |
|
params[0] = getNameParameter(); |
149 |
|
params[1] = getMixChannelParameter(); |
150 |
|
|
151 |
|
return params; |
152 |
|
} |
153 |
|
|
154 |
|
/** |
155 |
* Determines whether this audio output channel has additional parameters. |
* Determines whether this audio output channel has additional parameters. |
156 |
* @return <code>true</code> if this audio output channel has additional parameters, |
* @return <code>true</code> if this audio output channel has additional parameters, |
157 |
* <code>false</code> otherwise. |
* <code>false</code> otherwise. |