public interface VolumeControl extends Control
VolumeControl
is an interface for manipulating the audio volume
of a Player
.
true
, no audio signal is produced by this
Player
; if mute is false
an audio signal is
produced and the volume is restored.
VolumeControl
changes, a
VOLUME_CHANGED
event is
delivered through the PlayerListener
.Modifier and Type | Method and Description |
---|---|
int |
getLevel()
Get the current volume level set.
|
boolean |
isMuted()
Get the mute state of the signal associated with this
VolumeControl . |
int |
setLevel(int level)
Set the volume using a linear point scale with values between 0 and 100.
|
void |
setMute(boolean mute)
Mute or unmute the
Player associated with this
VolumeControl . |
void setMute(boolean mute)
Player
associated with this
VolumeControl
.
Calling setMute(true)
on the Player
that is
already muted is ignored, as is calling setMute(false)
on the
Player
that is not currently muted.
Setting mute on or off doesn't change the volume level returned by
getLevel()
.
When setMute
results in a change in the muted state, a
VOLUME_CHANGED
event will be
delivered through the PlayerListener
.
mute
- specify true
to mute the signal, false
to unmute the signalboolean isMuted()
VolumeControl
.int setLevel(int level)
0 is silence; 100 is the loudest useful level that this
VolumeControl
supports. If the given level is less than 0 or
greater than 100, the level will be set to 0 or 100 respectively.
When setLevel
results in a change in the volume level, a
VOLUME_CHANGED
event will be
delivered through the PlayerListener
.
level
- the new volume specified in the level scaleint getLevel()
getLevel may return -1 if and only if the Player
is in the
REALIZED state (the audio device has not been initialized) and
setLevel(int)
has not yet been called.
Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.