Enum SoundFormat

java.lang.Object
java.lang.Enum<SoundFormat>
de.gurkenlabs.litiengine.resources.SoundFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SoundFormat>, java.lang.constant.Constable

public enum SoundFormat
extends java.lang.Enum<SoundFormat>
Contains all known audio file-formats supported by the engine.
See Also:
ImageFormat
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum ConstantDescription
    MP3 
    OGG 
    UNSUPPORTED 
    WAV 
  • Method Summary

    Modifier and TypeMethodDescription
    static SoundFormatget​(java.lang.String format)
    Gets the SoundFormat of the specified format string.
    static java.lang.String[]getAllExtensions() 
    static booleanisSupported​(java.io.File file)
    Determines whether the extension of the specified file is supported by the engine.
    static booleanisSupported​(java.lang.String fileName)
    Determines whether the extension of the specified file is supported by the engine.
    java.lang.StringtoFileExtension()
    Converts this format instance to a file format string that can be used as an extension (e.g.
    java.lang.StringtoString() 
    static SoundFormatvalueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static SoundFormat[]values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Method Details

    • values

      public static SoundFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SoundFormat valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • get

      public static SoundFormat get​(java.lang.String format)
      Gets the SoundFormat of the specified format string.
      Parameters:
      format - The format string from which to extract the format.
      Returns:
      The format of the specified string or UNDEFINED if not supported.
    • isSupported

      public static boolean isSupported​(java.io.File file)
      Determines whether the extension of the specified file is supported by the engine.
      Parameters:
      file - The file to check for.
      Returns:
      True if the extension is part of this enum; otherwise false.
    • isSupported

      public static boolean isSupported​(java.lang.String fileName)
      Determines whether the extension of the specified file is supported by the engine.
      Parameters:
      fileName - The file name to check for.
      Returns:
      True if the extension is part of this enum; otherwise false.
    • getAllExtensions

      public static java.lang.String[] getAllExtensions()
    • toFileExtension

      public java.lang.String toFileExtension()
      Converts this format instance to a file format string that can be used as an extension (e.g. .ogg).
      It adds a leading '.' to the lower-case string representation of this instance.
      Returns:
      The file extension string for this instance.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Enum<SoundFormat>