Top Description Inners Fields Constructors Methods
javafx.scene.media

public final Class AudioEqualizer

extends Object
Class Inheritance
Imports
java.util.List, javafx.beans.property.BooleanProperty, .BooleanPropertyBase, javafx.collections.ObservableList, .FXCollections, com.sun.javafx.collections.VetoableListDecorator, com.sun.media.jfxmedia.logging.Logger

The AudioEqualizer class provides audio equalization control for a media player. It contains an ObservableList of EqualizerBand elements. Each AudioEqualizer instance is connected to a MediaPlayer and may be obtained using the MediaPlayer.getAudioEqualizer method.
Since
JavaFX 2.0
See Also
MediaPlayer, EqualizerBand

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final ObservableList<EqualizerBand>
private final Object
private BooleanProperty
private AudioEqualizer
public static final int
MAX_NUM_BANDS

Maximum number of bands an AudioEqualizer may contain.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public BooleanProperty

Returns:

the enabled property
enabledProperty
()

Enables or disables AudioEqualizer.

public final ObservableList<EqualizerBand>

Returns:

ObservableList containing EqualizerBand elements.
getBands
()

ObservableList containing EqualizerBand elements.

public final boolean
pack-priv void
setAudioEqualizer(AudioEqualizer
- Instance of native equalizer
jfxEqualizer
)

Called by NativePlayer when native part is ready

public final void
setEnabled(boolean value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bandsback to summary
private final ObservableList<EqualizerBand> bands
disposeLockback to summary
private final Object disposeLock
enabledback to summary
private BooleanProperty enabled
jfxEqualizerback to summary
private AudioEqualizer jfxEqualizer
MAX_NUM_BANDSback to summary
public static final int MAX_NUM_BANDS

Maximum number of bands an AudioEqualizer may contain. In the current implementation this value is 64.

Constructor Detail

AudioEqualizerback to summary
pack-priv AudioEqualizer()

Method Detail

enabledPropertyback to summary
public BooleanProperty enabledProperty()

Enables or disables AudioEqualizer. If the enabled property is set to false, AudioEqualizer settings are preserved but not taken into account during playback, which is equivalent to setting all EqualizerBand.gain properties to zero.

Returns:BooleanProperty

the enabled property

Default Value
true
getBandsback to summary
public final ObservableList<EqualizerBand> getBands()

ObservableList containing EqualizerBand elements. The content of the sequence may be changed by adding or removing EqualizerBand elements. When adding elements, the user must be prepared to catch IllegalArgumentExceptions because any change to the internal list can be vetoed if a newly added instance is not valid.

The constraints for a valid EqualizerBand instance are:

The default set of bands is as in the following table; all bands have unity gain (0 dB).

AudioEqualizer Band Table
Band IndexCenter Frequency (Hz)Bandwidth (Hz)
03219
16439
212578
3250156
4500312
51000625
620001250
740002500
880005000
91600010000
Returns:ObservableList<EqualizerBand>

ObservableList containing EqualizerBand elements.

isEnabledback to summary
public final boolean isEnabled()
setAudioEqualizerback to summary
pack-priv void setAudioEqualizer(AudioEqualizer jfxEqualizer)

Called by NativePlayer when native part is ready

Parameters
jfxEqualizer:AudioEqualizer

- Instance of native equalizer

setEnabledback to summary
public final void setEnabled(boolean value)
javafx.scene.media back to summary

private Class AudioEqualizer.Bands

extends VetoableListDecorator<EqualizerBand>
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
onProposedChange(List<EqualizerBand>
the list to be added
toBeAdded
,
int... toBeRemoved)

Implements abstract com.sun.javafx.collections.VetoableListDecorator.onProposedChange.

The type of the change can be observed from the combination of arguments.

Inherited from com.sun.javafx.collections.VetoableListDecorator:
addaddaddAlladdAlladdAlladdListeneraddListenerclearcontainscontainsAllequalsgethashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveremoveAllremoveAllremoveListenerremoveListenerretainAllretainAllsetsetAllsetAllsizesubListtoArraytoArraytoString

Constructor Detail

Bandsback to summary
public Bands()

Method Detail

onProposedChangeback to summary
protected void onProposedChange(List<EqualizerBand> toBeAdded, int... toBeRemoved)

Implements abstract com.sun.javafx.collections.VetoableListDecorator.onProposedChange.

Doc from com.sun.javafx.collections.VetoableListDecorator.onProposedChange.

The type of the change can be observed from the combination of arguments.

  • If something is going to be added toBeAdded is non-empty and indexes contain two indexes that are pointing to the position, e.g. {2, 2}
  • If something is going to be removed, the indexes are paired by two: from(inclusive)-to(exclusive) and are pointing to the current list.
    E.g. if we remove 2,3,5 from list {0,1,2,3,4,5}, the indexes will be {2, 4, 5, 6}. If there's more than one pair of indexes, toBeAdded is always empty.
  • for set toBeAdded contains 1 element and indexes are like with removal: {index, index + 1}
  • for setAll, toBeAdded contains all new elements and indexes looks like this: {0, size()}
Note that it's always safe to iterate over toBeAdded and use indexes as pairs of from-to, as there's always at least one pair.
Parameters
toBeAdded:List<EqualizerBand>

the list to be added

Annotations
@Override