Class AudioEffectPlayer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.audio.AudioEffectPlayer
- All Implemented Interfaces:
Destructible,Initializable,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic final intDetermines how many clones can exist per source by default.intfinal List<AudioSource> -
Constructor Summary
ConstructorsConstructorDescriptionAudioEffectPlayer(List<AudioSource> sources) AudioEffectPlayer(List<AudioSource> sources, float volume) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Removes this component from its entity.voidinit()Initializes this object to prepare its usage.booleanisMuted()voidmute()voidplay(int index) voidvoidplayRandom(int minIndex, int maxIndex) voidprepareSources(int count) voidsetGain(float gain) voidsetGain(VariableProperty<Float> gain) voidsetGlobalGain(float gain) voidsetGlobalGain(VariableProperty<Float> gain) voidsetGlobalPitch(float pitch) voidsetGlobalPitch(VariableProperty<Float> pitch) voidsetGlobalVolume(float volume) voidsetGlobalVolume(VariableProperty<Float> volume) voidsetMaxSources(int maxSources) voidsetPitch(float pitch) voidsetPitch(VariableProperty<Float> pitch) voidsetVolume(float volume) voidsetVolume(VariableProperty<Float> volume) voidunmute()Methods inherited from class dev.prozilla.pine.core.component.Component
equals, getApplication, getEntity, getName, getScene, hashCode, onEntityChange, setActive, setEntity, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLocalStorage, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChild, getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
sources
-
maxSources
public int maxSources -
autoplay
public boolean autoplay -
DEFAULT_MAX_SOURCE_CLONES
public static final int DEFAULT_MAX_SOURCE_CLONESDetermines how many clones can exist per source by default. The default maximum amount of sources is calculated by multiplying the amount of unique sources by this value plus one.- See Also:
-
-
Constructor Details
-
AudioEffectPlayer
-
AudioEffectPlayer
-
-
Method Details
-
init
public void init()Description copied from interface:InitializableInitializes this object to prepare its usage.- Specified by:
initin interfaceInitializable
-
playRandom
public void playRandom() -
playRandom
public void playRandom(int minIndex, int maxIndex) -
play
public void play(int index) -
mute
public void mute() -
unmute
public void unmute() -
isMuted
public boolean isMuted() -
setGlobalVolume
public void setGlobalVolume(float volume) -
setGlobalVolume
-
setVolume
public void setVolume(float volume) -
setVolume
-
setGlobalPitch
public void setGlobalPitch(float pitch) -
setGlobalPitch
-
setPitch
public void setPitch(float pitch) -
setPitch
-
setGlobalGain
public void setGlobalGain(float gain) -
setGlobalGain
-
setGain
public void setGain(float gain) -
setGain
-
setMaxSources
public void setMaxSources(int maxSources) -
prepareSources
public void prepareSources(int count) -
destroy
public void destroy()Description copied from class:ComponentRemoves this component from its entity.- Specified by:
destroyin interfaceDestructible- Overrides:
destroyin classComponent
-