SoundEffectPoolComponentTester


public final class SoundEffectPoolComponentTester


A test-only accessor for SoundEffectPoolComponent that enables direct manipulation and inspection of its internal state.

Summary

Public methods

boolean
equals(Object other)
final Stream

The Stream of the most recently paused sound, or null if no stream has been paused yet.

final PointSourceParams

Retrieves the PointSourceParams used in the most recent call to SoundEffectPoolComponent.play, or null if play has not been called yet.

final Stream

The Stream of the most recently played sound, or null if no stream has been played yet.

final Stream

The Stream of the most recently resumed sound, or null if no stream has been resumed yet.

final Stream

The Stream of the most recently stopped sound, or null if no stream has been stopped yet.

final @IntRange(from = 0) int

Retrieves the playback priority of the specified stream.

final @NonNull SoundEffect

Retrieves the SoundEffect associated with the specified stream.

final @FloatRange(from = 0.0, to = 1.0) float

Retrieves the current volume of the specified stream.

int
final boolean

Returns whether the specified stream is configured to loop indefinitely.

Public methods

equals

public boolean equals(Object other)

getLastPausedStream

Added in 1.0.0-beta01
public final Stream getLastPausedStream()

The Stream of the most recently paused sound, or null if no stream has been paused yet.

getLastPlayedPointSourceParams

Added in 1.0.0-beta01
public final PointSourceParams getLastPlayedPointSourceParams()

Retrieves the PointSourceParams used in the most recent call to SoundEffectPoolComponent.play, or null if play has not been called yet.

getLastPlayedStream

Added in 1.0.0-beta01
public final Stream getLastPlayedStream()

The Stream of the most recently played sound, or null if no stream has been played yet.

getLastResumedStream

Added in 1.0.0-beta01
public final Stream getLastResumedStream()

The Stream of the most recently resumed sound, or null if no stream has been resumed yet.

getLastStoppedStream

Added in 1.0.0-beta01
public final Stream getLastStoppedStream()

The Stream of the most recently stopped sound, or null if no stream has been stopped yet.

getPriority

Added in 1.0.0-beta01
public final @IntRange(from = 0) int getPriority(@NonNull Stream stream)

Retrieves the playback priority of the specified stream.

Priority is represented by a non-negative integer, where 0 is the lowest priority and greater values indicate higher priorities.

Parameters
@NonNull Stream stream

a Stream returned by SoundEffectPoolComponent.play

Returns
@IntRange(from = 0) int

the playback priority of the stream

Throws
IllegalArgumentException

if the stream is no longer active or is invalid

getSoundEffect

Added in 1.0.0-beta01
public final @NonNull SoundEffect getSoundEffect(@NonNull Stream stream)

Retrieves the SoundEffect associated with the specified stream.

Parameters
@NonNull Stream stream

a Stream returned by SoundEffectPoolComponent.play

Returns
@NonNull SoundEffect

the SoundEffect being played on the stream

Throws
IllegalArgumentException

if the stream is no longer active or is invalid

getVolume

Added in 1.0.0-beta01
public final @FloatRange(from = 0.0, to = 1.0) float getVolume(@NonNull Stream stream)

Retrieves the current volume of the specified stream.

Parameters
@NonNull Stream stream

a Stream returned by SoundEffectPoolComponent.play

Returns
@FloatRange(from = 0.0, to = 1.0) float

the volume of the stream in the range 0.0 to 1.0

Throws
IllegalArgumentException

if the stream is no longer active or is invalid

hashCode

public int hashCode()

isLooping

Added in 1.0.0-beta01
public final boolean isLooping(@NonNull Stream stream)

Returns whether the specified stream is configured to loop indefinitely.

Parameters
@NonNull Stream stream

a Stream returned by SoundEffectPoolComponent.play

Returns
boolean

true if the stream is looping, false otherwise

Throws
IllegalArgumentException

if the stream is no longer active or is invalid