org.xith3d.sound
Enum BufferState

java.lang.Object
  extended by java.lang.Enum<BufferState>
      extended by org.xith3d.sound.BufferState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BufferState>

public enum BufferState
extends java.lang.Enum<BufferState>

A Buffer encapsulates state related to storing sample data. The application can request and release Buffer objects, and fill them with data. Data can be supplied compressed and encoded as long as the format is supported. Buffers can, internally, contain waveform data as uncompressed or compressed samples, Unlike Sources and Listener, Buffer Objects can be shared among contexts. Buffers are referenced by Sources. A single Buffer can be referred to by multiple Sources. This separation allows driver and hardware to optimize storage and processing where applicable. The simplest supported format for buffer data is PCM. The Buffer state is dependent on the state of all Sources that is has been queued for. A single queue occurrence of a Buffer propagates the Buffer state (over all Sources) from UNUSED to PROCESSED or higher. Sources that are STOPPED or INITIAL still have queue entries that cause Buffers to be PROCESSED. A single queue entry with a single Source for which the Buffer is not yet PROCESSED propagates the buffer's queueing state to PENDING. Buffers that are PROCESSED for a given Source can be unqueued from that Source's queue. Buffers that have been unqueued from all Sources are UNUSED. Buffers that are UNUSED can be deleted, or changed by BufferData commands.


Enum Constant Summary
PENDING
          there is at least one Source for which the Buffer has been queued, for which the Buffer data has not yet been dereferenced.
PROCESSED
          the Buffer is listed in the queue of at least one Source, but is neither pending nor current for any Source.
UNUSED
          the Buffer is no included in any queue for any Source.
 
Method Summary
static BufferState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BufferState[] 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNUSED

public static final BufferState UNUSED
the Buffer is no included in any queue for any Source. In particular, the Buffer is neither pending nor current for any Source. The Buffer name can be deleted at this time.


PROCESSED

public static final BufferState PROCESSED
the Buffer is listed in the queue of at least one Source, but is neither pending nor current for any Source. The Buffer can be deleted as soon as it has been unqueued for all Sources it is queued with.


PENDING

public static final BufferState PENDING
there is at least one Source for which the Buffer has been queued, for which the Buffer data has not yet been dereferenced. The Buffer can only be unqueued for those Sources which have dereferenced the data in the Buffer in its entirety, and can not be deleted or changed

Method Detail

values

public static BufferState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BufferState c : BufferState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BufferState 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