All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.lessvoid.nifty.spi.sound.SoundDevice Maven / Gradle / Ivy

Go to download

Nifty GUI is a Java Library that supports the building of interactive user interfaces for games or similar applications. It utilizes OpenGL for rendering and it can be easily integrated into many rendering systems. The configuration of the GUI is stored in xml files with little supporting Java code. In short Nifty helps you to layout stuff, display it in a cool way and interact with it :)

There is a newer version: 1.4.3
Show newest version
package de.lessvoid.nifty.spi.sound;

import de.lessvoid.nifty.sound.SoundSystem;
import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * SoundDevice loads sounds and music and handles updating the active streams as needed.
 *
 * @author void
 */
public interface SoundDevice {
  /**
   * Gives this RenderDevice access to the NiftyResourceLoader.
   *
   * @param niftyResourceLoader NiftyResourceLoader
   */
  void setResourceLoader(@Nonnull NiftyResourceLoader niftyResourceLoader);

  /**
   * Load the Sound with the given name. Caching already loaded handles is done by the calling class.
   *
   * @param soundSystem the SoundSystem
   * @param filename filename to load
   * @return initialized SoundHandle or {@code null} in case of any errors
   */
  @Nullable
  SoundHandle loadSound(@Nonnull SoundSystem soundSystem, @Nonnull String filename);

  /**
   * Load the Music with the given name. Caching already loaded handles is done by the calling class.
   *
   * @param soundSystem the SoundSystem
   * @param filename filename to load
   * @return initialized SoundHandle or {@code null} in case of any errors
   */
  @Nullable
  SoundHandle loadMusic(@Nonnull SoundSystem soundSystem, @Nonnull String filename);

  /**
   * Called from the SoundSystem in regular intervals with the given delta time in ms.
   *
   * @param delta delta from last call in ms
   */
  void update(int delta);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy