Methods Summary |
---|
public synchronized void | addGainChangeListener(javax.media.GainChangeListener listener)
if (listener != null) {
if (listeners == null)
listeners = new Vector();
listeners.addElement(listener);
}
|
public java.awt.Component | getControlComponent()
return null;
|
public float | getDB()
return dB;
|
public float | getLevel()
return level;
|
public boolean | getMute()
return muteState;
|
protected synchronized void | informListeners()
if (listeners != null) {
GainChangeEvent gce = new GainChangeEvent(this, muteState, dB, level);
for (int i = 0; i < listeners.size(); i++) {
GainChangeListener gcl = (GainChangeListener) listeners.elementAt(i);
gcl.gainChange(gce);
}
}
|
public synchronized void | removeGainChangeListener(javax.media.GainChangeListener listener)
if (listener != null && listeners != null)
listeners.removeElement(listener);
|
public float | setDB(float gain)
if (dB != gain) {
dB = gain;
float mult = (float) Math.pow(10.0, dB/20.0);
level = mult * DefLevel;
if (level < 0.0)
setLevel(0.0f);
else if (level > 1.0)
setLevel(1.0f);
else {
setLevel(level);
informListeners();
}
}
return dB;
|
public float | setLevel(float level)
if (level < 0.0)
level = 0.0f;
if (level > 1.0)
level = 1.0f;
if (this.level != level) {
this.level = level;
float mult = level/DefLevel;
dB = (float) (Math.log((double)((mult==0.0)?0.0001:mult))/Math.log(10.0) * 20.0);
informListeners();
}
return this.level;
|
public void | setMute(boolean mute)
if (muteState != mute) {
muteState = mute;
informListeners();
}
|