Class CommandObject

java.lang.Object
com.ardor3d.audio.CommandObject

public class CommandObject extends Object
The CommandObject class is used to store arguments in the SoundSystem's Command Queue. Queued CommandObjects are then processed by the CommandThread. Commands are queued and executed in the background, so it is unlikely that the user will ever need to use this class.

SoundSystem License:

You are free to use this library for any purpose, commercial or otherwise. You may modify this library or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this library or any unmodified portion of it.
2) You may not copyright this library or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this library in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this library or any part of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this library or any part of it.

Author: Paul Lamb
http://www.paulscode.com
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Global identifier for the command to activate a source.
    boolean[]
    Any boolean arguments required for a command.
    byte[]
    Any buffer required for a command.
    static final int
    Global identifier for the command to change the Doppler factor.
    static final int
    Global identifier for the command to change the Doppler velocity.
    static final int
    Global identifier for the command to check volume levels of fading sources.
    Any Class arguments required for a command.
    int
    Which command to execute.
    static final int
    Global identifier for the command to cull a source.
    static final int
    Global identifier for the command to dequeue a sound file.
    static final int
    Global identifier for the command to fade-out transition a source.
    static final int
    Global identifier for the command to fade-out/in transition a source.
    static final int
    Global identifier for the command to play a source.
    float[]
    Any float arguments required for a command.
    static final int
    Global identifier for the command to flush all queued data.
    static final int
    Global identifier for the command to initialize the current sound library.
    int[]
    Any int arguments required for a command.
    static final int
    Global identifier for the command to pre-load a sound file.
    static final int
    Global identifier for the command to pre-load a sound file.
    long[]
    Any long arguments required for a command.
    static final int
    Global identifier for the command to move the listner.
    static final int
    Global identifier for the command to create a new library.
    static final int
    Global identifier for the command to create a new source.
    Any Object arguments required for a command.
    static final int
    Global identifier for the command to pause a source.
    static final int
    Global identifier for the command to play a source.
    static final int
    Global identifier for the command to queue a sound file.
    static final int
    Global identifier for the command to create a source and immediately play it.
    static final int
    Global identifier for the command to create a new raw data stream.
    static final int
    Global identifier for the command to delete a source.
    static final int
    Global identifier for the command to rewind a source.
    static final int
    Global identifier for the command to set a source's attenuation model.
    static final int
    Global identifier for the command to set a source's fade distance or rolloff factor.
    static final int
    Global identifier for the command to set the listener's turn angle.
    static final int
    Global identifier for the command to change the listener's orientation.
    static final int
    Global identifier for the command to set the listener's position.
    static final int
    Global identifier for the command to set a source's velocity.
    static final int
    Global identifier for the command to tell a source whether or not to loop.
    static final int
    Global identifier for the command to change the master volume.
    static final int
    Global identifier for the command to change a source's pitch.
    static final int
    Global identifier for the command to set a source's position in 3D space.
    static final int
    Global identifier for the command to change a source's priority.
    static final int
    Global identifier for the command to set a source as permanant or temporary.
    static final int
    Global identifier for the command to set a source's velocity.
    static final int
    Global identifier for the command to change a source's volume.
    static final int
    Global identifier for the command to stop a source.
    Any String arguments required for a command.
    static final int
    Global identifier for the command to turn the listener.
    static final int
    Global identifier for the command to remove a sound file from memory.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommandObject(int cmd)
    Constructor used to create a command which doesn't require any arguments.
    CommandObject(int cmd, boolean b1, boolean b2, boolean b3, String s, Object o, float f1, float f2, float f3, int i, float f4)
    Constructor used to create a command which requires several arguments.
    CommandObject(int cmd, boolean b1, boolean b2, boolean b3, String s, Object o, float f1, float f2, float f3, int i, float f4, boolean b4)
    Constructor used to create a command which requires several arguments.
    CommandObject(int cmd, float f)
    Constructor used to create a command which requires one float argument.
    CommandObject(int cmd, float f1, float f2, float f3)
    Constructor used to create a command which requires three float arguments.
    CommandObject(int cmd, float f1, float f2, float f3, float f4, float f5, float f6)
    Constructor used to create a command which requires six float arguments.
    CommandObject(int cmd, int i)
    Constructor used to create a command which requires one integer argument.
    CommandObject(int cmd, Class<? extends Library> c)
    Constructor used to create a command which requires one Library Class argument.
    CommandObject(int cmd, Object o)
    Constructor used to create a command which requires one Object argument.
    CommandObject(int cmd, Object o, boolean b, String s, float f1, float f2, float f3, int i, float f4)
    Constructor used to create a command which requires several arguments.
    CommandObject(int cmd, String s)
    Constructor used to create a command which requires one String argument.
    CommandObject(int cmd, String s, boolean b)
    Constructor used to create a command which requires a String and a boolean as arguments.
    CommandObject(int cmd, String s, byte[] buff)
    Constructor used to create a command which requires one String argument and one byte buffer argument.
    CommandObject(int cmd, String s, float f)
    Constructor used to create a command which requires a String and a float as arguments.
    CommandObject(int cmd, String s, float f1, float f2, float f3)
    Constructor used to create a command which a String and three float arguments.
    CommandObject(int cmd, String s, int i)
    Constructor used to create a command which requires a String and an int as arguments.
    CommandObject(int cmd, String s, Object o)
    Constructor used to create a command which requires one String argument and one Object argument.
    CommandObject(int cmd, String s, Object o, long l)
    Constructor used to create a command which requires one String argument, one Object argument, and one long argument.
    CommandObject(int cmd, String s, Object o, long l1, long l2)
    Constructor used to create a command which requires one String argument, one Object argument, and two long arguments.
    CommandObject(int cmd, String s1, String s2)
    Constructor used to create a command which requires two String arguments.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INITIALIZE

      public static final int INITIALIZE
      Global identifier for the command to initialize the current sound library.
      See Also:
    • LOAD_SOUND

      public static final int LOAD_SOUND
      Global identifier for the command to pre-load a sound file.
      See Also:
    • LOAD_DATA

      public static final int LOAD_DATA
      Global identifier for the command to pre-load a sound file.
      See Also:
    • UNLOAD_SOUND

      public static final int UNLOAD_SOUND
      Global identifier for the command to remove a sound file from memory.
      See Also:
    • QUEUE_SOUND

      public static final int QUEUE_SOUND
      Global identifier for the command to queue a sound file.
      See Also:
    • DEQUEUE_SOUND

      public static final int DEQUEUE_SOUND
      Global identifier for the command to dequeue a sound file.
      See Also:
    • FADE_OUT

      public static final int FADE_OUT
      Global identifier for the command to fade-out transition a source.
      See Also:
    • FADE_OUT_IN

      public static final int FADE_OUT_IN
      Global identifier for the command to fade-out/in transition a source.
      See Also:
    • CHECK_FADE_VOLUMES

      public static final int CHECK_FADE_VOLUMES
      Global identifier for the command to check volume levels of fading sources.
      See Also:
    • NEW_SOURCE

      public static final int NEW_SOURCE
      Global identifier for the command to create a new source.
      See Also:
    • RAW_DATA_STREAM

      public static final int RAW_DATA_STREAM
      Global identifier for the command to create a new raw data stream.
      See Also:
    • QUICK_PLAY

      public static final int QUICK_PLAY
      Global identifier for the command to create a source and immediately play it.
      See Also:
    • SET_POSITION

      public static final int SET_POSITION
      Global identifier for the command to set a source's position in 3D space.
      See Also:
    • SET_VOLUME

      public static final int SET_VOLUME
      Global identifier for the command to change a source's volume.
      See Also:
    • SET_PITCH

      public static final int SET_PITCH
      Global identifier for the command to change a source's pitch.
      See Also:
    • SET_PRIORITY

      public static final int SET_PRIORITY
      Global identifier for the command to change a source's priority.
      See Also:
    • SET_LOOPING

      public static final int SET_LOOPING
      Global identifier for the command to tell a source whether or not to loop.
      See Also:
    • SET_ATTENUATION

      public static final int SET_ATTENUATION
      Global identifier for the command to set a source's attenuation model.
      See Also:
    • SET_DIST_OR_ROLL

      public static final int SET_DIST_OR_ROLL
      Global identifier for the command to set a source's fade distance or rolloff factor.
      See Also:
    • CHANGE_DOPPLER_FACTOR

      public static final int CHANGE_DOPPLER_FACTOR
      Global identifier for the command to change the Doppler factor.
      See Also:
    • CHANGE_DOPPLER_VELOCITY

      public static final int CHANGE_DOPPLER_VELOCITY
      Global identifier for the command to change the Doppler velocity.
      See Also:
    • SET_VELOCITY

      public static final int SET_VELOCITY
      Global identifier for the command to set a source's velocity.
      See Also:
    • SET_LISTENER_VELOCITY

      public static final int SET_LISTENER_VELOCITY
      Global identifier for the command to set a source's velocity.
      See Also:
    • PLAY

      public static final int PLAY
      Global identifier for the command to play a source.
      See Also:
    • FEED_RAW_AUDIO_DATA

      public static final int FEED_RAW_AUDIO_DATA
      Global identifier for the command to play a source.
      See Also:
    • PAUSE

      public static final int PAUSE
      Global identifier for the command to pause a source.
      See Also:
    • STOP

      public static final int STOP
      Global identifier for the command to stop a source.
      See Also:
    • REWIND

      public static final int REWIND
      Global identifier for the command to rewind a source.
      See Also:
    • FLUSH

      public static final int FLUSH
      Global identifier for the command to flush all queued data.
      See Also:
    • CULL

      public static final int CULL
      Global identifier for the command to cull a source.
      See Also:
    • ACTIVATE

      public static final int ACTIVATE
      Global identifier for the command to activate a source.
      See Also:
    • SET_TEMPORARY

      public static final int SET_TEMPORARY
      Global identifier for the command to set a source as permanant or temporary.
      See Also:
    • REMOVE_SOURCE

      public static final int REMOVE_SOURCE
      Global identifier for the command to delete a source.
      See Also:
    • MOVE_LISTENER

      public static final int MOVE_LISTENER
      Global identifier for the command to move the listner.
      See Also:
    • SET_LISTENER_POSITION

      public static final int SET_LISTENER_POSITION
      Global identifier for the command to set the listener's position.
      See Also:
    • TURN_LISTENER

      public static final int TURN_LISTENER
      Global identifier for the command to turn the listener.
      See Also:
    • SET_LISTENER_ANGLE

      public static final int SET_LISTENER_ANGLE
      Global identifier for the command to set the listener's turn angle.
      See Also:
    • SET_LISTENER_ORIENTATION

      public static final int SET_LISTENER_ORIENTATION
      Global identifier for the command to change the listener's orientation.
      See Also:
    • SET_MASTER_VOLUME

      public static final int SET_MASTER_VOLUME
      Global identifier for the command to change the master volume.
      See Also:
    • NEW_LIBRARY

      public static final int NEW_LIBRARY
      Global identifier for the command to create a new library.
      See Also:
    • buffer

      public byte[] buffer
      Any buffer required for a command.
    • intArgs

      public int[] intArgs
      Any int arguments required for a command.
    • floatArgs

      public float[] floatArgs
      Any float arguments required for a command.
    • longArgs

      public long[] longArgs
      Any long arguments required for a command.
    • boolArgs

      public boolean[] boolArgs
      Any boolean arguments required for a command.
    • stringArgs

      public String[] stringArgs
      Any String arguments required for a command.
    • classArgs

      public Class[] classArgs
      Any Class arguments required for a command.
    • objectArgs

      public Object[] objectArgs
      Any Object arguments required for a command.
    • Command

      public int Command
      Which command to execute.
  • Constructor Details

    • CommandObject

      public CommandObject(int cmd)
      Constructor used to create a command which doesn't require any arguments.
      Parameters:
      cmd - Which command to execute.
    • CommandObject

      public CommandObject(int cmd, int i)
      Constructor used to create a command which requires one integer argument.
      Parameters:
      cmd - Which command to execute.
      i - The integer argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, Class<? extends Library> c)
      Constructor used to create a command which requires one Library Class argument.
      Parameters:
      cmd - Which command to execute.
      c - The Library Class argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, float f)
      Constructor used to create a command which requires one float argument.
      Parameters:
      cmd - Which command to execute.
      f - The float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s)
      Constructor used to create a command which requires one String argument.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, Object o)
      Constructor used to create a command which requires one Object argument.
      Parameters:
      cmd - Which command to execute.
      o - The Object argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, Object o)
      Constructor used to create a command which requires one String argument and one Object argument.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      o - The Object argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, byte[] buff)
      Constructor used to create a command which requires one String argument and one byte buffer argument.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      buff - The byte buffer argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, Object o, long l)
      Constructor used to create a command which requires one String argument, one Object argument, and one long argument.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      o - The Object argument needed to execute this command.
      l - The long argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, Object o, long l1, long l2)
      Constructor used to create a command which requires one String argument, one Object argument, and two long arguments.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      o - The Object argument needed to execute this command.
      l1 - The first long argument needed to execute this command.
      l2 - The second long argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s1, String s2)
      Constructor used to create a command which requires two String arguments.
      Parameters:
      cmd - Which command to execute.
      s1 - The first String argument needed to execute this command.
      s2 - The second String argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, int i)
      Constructor used to create a command which requires a String and an int as arguments.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      i - The integer argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, float f)
      Constructor used to create a command which requires a String and a float as arguments.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      f - The float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, boolean b)
      Constructor used to create a command which requires a String and a boolean as arguments.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      b - The boolean argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, float f1, float f2, float f3)
      Constructor used to create a command which requires three float arguments.
      Parameters:
      cmd - Which command to execute.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, String s, float f1, float f2, float f3)
      Constructor used to create a command which a String and three float arguments.
      Parameters:
      cmd - Which command to execute.
      s - The String argument needed to execute this command.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, float f1, float f2, float f3, float f4, float f5, float f6)
      Constructor used to create a command which requires six float arguments.
      Parameters:
      cmd - Which command to execute.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
      f4 - The fourth float argument needed to execute this command.
      f5 - The fifth float argument needed to execute this command.
      f6 - The sixth float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, boolean b1, boolean b2, boolean b3, String s, Object o, float f1, float f2, float f3, int i, float f4)
      Constructor used to create a command which requires several arguments.
      Parameters:
      cmd - Which command to execute.
      b1 - The first boolean argument needed to execute this command.
      b2 - The second boolean argument needed to execute this command.
      b3 - The third boolean argument needed to execute this command.
      s - The String argument needed to execute this command.
      o - The Object argument needed to execute this command.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
      i - The integer argument needed to execute this command.
      f4 - The fourth float argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, boolean b1, boolean b2, boolean b3, String s, Object o, float f1, float f2, float f3, int i, float f4, boolean b4)
      Constructor used to create a command which requires several arguments.
      Parameters:
      cmd - Which command to execute.
      b1 - The first boolean argument needed to execute this command.
      b2 - The second boolean argument needed to execute this command.
      b3 - The third boolean argument needed to execute this command.
      s - The String argument needed to execute this command.
      o - The Object argument needed to execute this command.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
      i - The integer argument needed to execute this command.
      f4 - The fourth float argument needed to execute this command.
      b4 - The fourth boolean argument needed to execute this command.
    • CommandObject

      public CommandObject(int cmd, Object o, boolean b, String s, float f1, float f2, float f3, int i, float f4)
      Constructor used to create a command which requires several arguments.
      Parameters:
      cmd - Which command to execute.
      o - The Object argument needed to execute this command.
      b - The first boolean argument needed to execute this command.
      s - The String argument needed to execute this command.
      f1 - The first float argument needed to execute this command.
      f2 - The second float argument needed to execute this command.
      f3 - The third float argument needed to execute this command.
      i - The integer argument needed to execute this command.
      f4 - The fourth float argument needed to execute this command.