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

public class AudioEffectPlayer extends Component implements Initializable
  • Field Details

    • sources

      public final List<AudioSource> sources
    • maxSources

      public int maxSources
    • autoplay

      public boolean autoplay
    • DEFAULT_MAX_SOURCE_CLONES

      public static final int DEFAULT_MAX_SOURCE_CLONES
      Determines 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

      public AudioEffectPlayer(List<AudioSource> sources)
    • AudioEffectPlayer

      public AudioEffectPlayer(List<AudioSource> sources, float volume)
  • Method Details

    • init

      public void init()
      Description copied from interface: Initializable
      Initializes this object to prepare its usage.
      Specified by:
      init in interface Initializable
    • 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

      public void setGlobalVolume(VariableProperty<Float> volume)
    • setVolume

      public void setVolume(float volume)
    • setVolume

      public void setVolume(VariableProperty<Float> volume)
    • setGlobalPitch

      public void setGlobalPitch(float pitch)
    • setGlobalPitch

      public void setGlobalPitch(VariableProperty<Float> pitch)
    • setPitch

      public void setPitch(float pitch)
    • setPitch

      public void setPitch(VariableProperty<Float> pitch)
    • setGlobalGain

      public void setGlobalGain(float gain)
    • setGlobalGain

      public void setGlobalGain(VariableProperty<Float> gain)
    • setGain

      public void setGain(float gain)
    • setGain

      public void setGain(VariableProperty<Float> gain)
    • setMaxSources

      public void setMaxSources(int maxSources)
    • prepareSources

      public void prepareSources(int count)
    • destroy

      public void destroy()
      Description copied from class: Component
      Removes this component from its entity.
      Specified by:
      destroy in interface Destructible
      Overrides:
      destroy in class Component