Class AudioPlayer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.audio.AudioPlayer
- All Implemented Interfaces:
AudioSourceContext,Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,SceneContext,SceneProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic final floatstatic final floatstatic final float -
Constructor Summary
ConstructorsConstructorDescriptionAudioPlayer(AudioSource source) AudioPlayer(AudioSource source, float volume) AudioPlayer(String sourcePath) AudioPlayer(String sourcePath, float volume) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Removes this component from its entity.booleanisMuted()booleanvoidmute()voidpause()voidplay()voidrewind()voidsetGain(float gain) voidsetLoop(boolean loop) voidsetPitch(float pitch) voidsetSource(AudioSource source) voidsetVolume(float volume) voidvoidunmute()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.common.asset.audio.AudioSourceContext
restart, stop, togglePauseMethods 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
-
source
-
autoplay
public boolean autoplay -
DEFAULT_VOLUME
public static final float DEFAULT_VOLUME- See Also:
-
DEFAULT_PITCH
public static final float DEFAULT_PITCH- See Also:
-
DEFAULT_GAIN
public static final float DEFAULT_GAIN- See Also:
-
-
Constructor Details
-
AudioPlayer
-
AudioPlayer
-
AudioPlayer
-
AudioPlayer
-
-
Method Details
-
rewind
public void rewind()- Specified by:
rewindin interfaceAudioSourceContext
-
play
public void play()- Specified by:
playin interfaceAudioSourceContext
-
pause
public void pause()- Specified by:
pausein interfaceAudioSourceContext
-
setSource
-
isPlaying
public boolean isPlaying()- Specified by:
isPlayingin interfaceAudioSourceContext
-
setVolume
public void setVolume(float volume) - Specified by:
setVolumein interfaceAudioSourceContext
-
setPitch
public void setPitch(float pitch) - Specified by:
setPitchin interfaceAudioSourceContext
-
setGain
public void setGain(float gain) - Specified by:
setGainin interfaceAudioSourceContext
-
setLoop
public void setLoop(boolean loop) - Specified by:
setLoopin interfaceAudioSourceContext
-
toggleMute
public void toggleMute() -
mute
public void mute() -
unmute
public void unmute() -
isMuted
public boolean isMuted() -
destroy
public void destroy()Description copied from class:ComponentRemoves this component from its entity.- Specified by:
destroyin interfaceDestructible- Overrides:
destroyin classComponent
-