public class GainControlAdapter extends Object implements GainControl
| Constructor and Description |
|---|
GainControlAdapter(boolean mute)
constructs a GainControlAdapter object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGainChangeListener(GainChangeListener listener)
Registers a listener for gain change update events.
|
Component |
getControlComponent()
This method has to be defined by non-abstarct classes that
implement Control interface.
|
float |
getDB()
returns the current gain in dB.
|
float |
getLevel()
Get the current gain as a value between 0.0 and 1.0
|
boolean |
getMute()
retrieves the muted state of the audio signal.
|
protected void |
informListeners()
Sends all registered listeners a GainChangeEvent object notifying
the listeners about gain change in the GainControl
|
void |
removeGainChangeListener(GainChangeListener listener)
Removes a listener from the list of listeners for
gain change events.
|
float |
setDB(float gain)
sets the gain in decibels.
|
float |
setLevel(float level)
Set the gain using a floating point scale with values
between 0.0 and 1.0.
|
void |
setMute(boolean mute)
sets the muted state of the audio signal.
|
public GainControlAdapter(boolean mute)
mute - specifies whether audio signal is initially muted (true)
or unmuted (false)public void setMute(boolean mute)
setMute in interface GainControlmute - specifies whether audio is set to be muted (true)
or unmuted (false)public boolean getMute()
getMute in interface GainControlpublic float setDB(float gain)
setDB in interface GainControlgain - if positive, the audio signal is amplified from
the default level; if gain is negative, the audio signal is
attenuated from the default; if gain is 0, the audio signal
is set to the default level
return the gain in dB.public float getDB()
getDB in interface GainControlpublic float setLevel(float level)
setLevel in interface GainControllevel - The new gain value specified in the level scale.public float getLevel()
getLevel in interface GainControlpublic void addGainChangeListener(GainChangeListener listener)
addGainChangeListener in interface GainControllistener - The listener for gain change eventspublic void removeGainChangeListener(GainChangeListener listener)
removeGainChangeListener in interface GainControllistener - The listener to be removed from the list
of listeners for gain change eventspublic Component getControlComponent()
getControlComponent in interface Controlprotected void informListeners()
Copyright © 2012 code4tv.com. All Rights Reserved.