Class OALDevice

java.lang.Object
com.blackrook.gloop.openal.OALHandle
com.blackrook.gloop.openal.OALDevice

public class OALDevice extends OALHandle
A device handle in OpenAL. Represents the output sound device.

Also creates its capabilities (see getCapabilities()).

Author:
Matthew Tropiano
  • Method Details

    • getName

      public String getName()
      Returns:
      this device's name, or "DEFAULT" if this represents the default device.
    • getCapabilities

      public ALCCapabilities getCapabilities()
      Returns:
      this device's OpenAL capabilities.
    • getHandle

      public long getHandle()
      Specified by:
      getHandle in class OALHandle
      Returns:
      this handle's OpenAL address handle.
    • isCreated

      public boolean isCreated()
      Specified by:
      isCreated in class OALHandle
      Returns:
      true if this handle was allocated, false if not.
    • destroy

      public void destroy()
      Description copied from class: OALHandle
      Destroys this handle. Does nothing if already destroyed.
      Specified by:
      destroy in class OALHandle
    • free

      protected boolean free()
    • getContextError

      public void getContextError()
      Convenience method for checking for an OpenAL error and throwing a SoundException if an error is raised.
      Throws:
      SoundException - if an error was found.
    • createContext

      public OALContext createContext(OALContext.AttributeValue... attributes)
      Creates a rendering context for a device.
      Parameters:
      attributes - the optional context attributes.
      Returns:
      the newly created context.
      Throws:
      SoundSystemException - if the context can't be created or there is no current context selected.