Class SoundEngine

java.lang.Object
fr.r1r0r0.deltaengine.model.engines.SoundEngine
All Implemented Interfaces:
Engine, java.lang.Runnable

public final class SoundEngine
extends java.lang.Object
implements Engine
Sound Engine, allows to control all given sounds.
See Also:
sounds objects manipulated by this Engine
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.util.Map<java.lang.String,​javafx.scene.media.MediaPlayer> sounds  
  • Constructor Summary

    Constructors
    Constructor Description
    SoundEngine()
    Default constructor.
  • Method Summary

    Modifier and Type Method Description
    void addSound​(Sound sound)
    Add a sound to the engine.
    javafx.scene.media.MediaPlayer getMediaPlayer​(java.lang.String name)
    Gets associated music JavaFX Media Player, to have full customization
    void init()
    Initialize the Engine.
    void pause​(java.lang.String name)
    Pause a sound.
    void play​(java.lang.String name)
    Play a sound.
    boolean removeSound​(java.lang.String name)
    Remove a sound previously added from the engine.
    void run()  
    void setBalance​(java.lang.String name, double balance)
    Set balance to a specific sound.
    void setLoop​(java.lang.String name, boolean setLoop)
    Allows looping or not specified music.
    void setMute​(java.lang.String name, boolean setMute)
    Allows mute or unmute specified music.
    void setSpeed​(java.lang.String name, double speed)
    Set speed to a specific sound.
    void setVolume​(java.lang.String name, double volume)
    Set volume to a specific sound.
    void stop​(java.lang.String name)
    Stop a sound.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait