paulscode.sound
Class CommandObject

java.lang.Object
  extended by paulscode.sound.CommandObject

public class CommandObject
extends java.lang.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
static int ACTIVATE
          Global identifier for the command to activate a source.
 boolean[] boolArgs
          Any boolean arguments required for a command.
 byte[] buffer
          Any buffer required for a command.
static int CHANGE_DOPPLER_FACTOR
          Global identifier for the command to change the Doppler factor.
static int CHANGE_DOPPLER_VELOCITY
          Global identifier for the command to change the Doppler velocity.
static int CHECK_FADE_VOLUMES
          Global identifier for the command to check volume levels of fading sources.
 java.lang.Class[] classArgs
          Any Class arguments required for a command.
 int Command
          Which command to execute.
static int CULL
          Global identifier for the command to cull a source.
static int DEQUEUE_SOUND
          Global identifier for the command to dequeue a sound file.
static int FADE_OUT
          Global identifier for the command to fade-out transition a source.
static int FADE_OUT_IN
          Global identifier for the command to fade-out/in transition a source.
static int FEED_RAW_AUDIO_DATA
          Global identifier for the command to play a source.
 float[] floatArgs
          Any float arguments required for a command.
static int FLUSH
          Global identifier for the command to flush all queued data.
static int INITIALIZE
          Global identifier for the command to initialize the current sound library.
 int[] intArgs
          Any int arguments required for a command.
static int LOAD_DATA
          Global identifier for the command to pre-load a sound file.
static int LOAD_SOUND
          Global identifier for the command to pre-load a sound file.
 long[] longArgs
          Any long arguments required for a command.
static int MOVE_LISTENER
          Global identifier for the command to move the listner.
static int NEW_LIBRARY
          Global identifier for the command to create a new library.
static int NEW_SOURCE
          Global identifier for the command to create a new source.
 java.lang.Object[] objectArgs
          Any Object arguments required for a command.
static int PAUSE
          Global identifier for the command to pause a source.
static int PLAY
          Global identifier for the command to play a source.
static int QUEUE_SOUND
          Global identifier for the command to queue a sound file.
static int QUICK_PLAY
          Global identifier for the command to create a source and immediately play it.
static int RAW_DATA_STREAM
          Global identifier for the command to create a new raw data stream.
static int REMOVE_SOURCE
          Global identifier for the command to delete a source.
static int REWIND
          Global identifier for the command to rewind a source.
static int SET_ATTENUATION
          Global identifier for the command to set a source's attenuation model.
static int SET_DIST_OR_ROLL
          Global identifier for the command to set a source's fade distance or rolloff factor.
static int SET_LISTENER_ANGLE
          Global identifier for the command to set the listener's turn angle.
static int SET_LISTENER_ORIENTATION
          Global identifier for the command to change the listener's orientation.
static int SET_LISTENER_POSITION
          Global identifier for the command to set the listener's position.
static int SET_LISTENER_VELOCITY
          Global identifier for the command to set a source's velocity.
static int SET_LOOPING
          Global identifier for the command to tell a source whether or not to loop.
static int SET_MASTER_VOLUME
          Global identifier for the command to change the master volume.
static int SET_PITCH
          Global identifier for the command to change a source's pitch.
static int SET_POSITION
          Global identifier for the command to set a source's position in 3D space.
static int SET_PRIORITY
          Global identifier for the command to change a source's priority.
static int SET_TEMPORARY
          Global identifier for the command to set a source as permanant or temporary.
static int SET_VELOCITY
          Global identifier for the command to set a source's velocity.
static int SET_VOLUME
          Global identifier for the command to change a source's volume.
static int STOP
          Global identifier for the command to stop a source.
 java.lang.String[] stringArgs
          Any String arguments required for a command.
static int TURN_LISTENER
          Global identifier for the command to turn the listener.
static int UNLOAD_SOUND
          Global identifier for the command to remove a sound file from memory.
 
Constructor Summary
CommandObject(int cmd)
          Constructor used to create a command which doesn't require any arguments.
CommandObject(int cmd, boolean b1, boolean b2, boolean b3, java.lang.String s, java.lang.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, java.lang.String s, java.lang.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, java.lang.Class c)
          Constructor used to create a command which requires one Library Class argument.
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, java.lang.Object o)
          Constructor used to create a command which requires one Object argument.
CommandObject(int cmd, java.lang.Object o, boolean b, java.lang.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, java.lang.String s)
          Constructor used to create a command which requires one String argument.
CommandObject(int cmd, java.lang.String s, boolean b)
          Constructor used to create a command which requires a String and a boolean as arguments.
CommandObject(int cmd, java.lang.String s, byte[] buff)
          Constructor used to create a command which requires one String argument and one byte buffer argument.
CommandObject(int cmd, java.lang.String s, float f)
          Constructor used to create a command which requires a String and a float as arguments.
CommandObject(int cmd, java.lang.String s, float f1, float f2, float f3)
          Constructor used to create a command which a String and three float arguments.
CommandObject(int cmd, java.lang.String s, int i)
          Constructor used to create a command which requires a String and an int as arguments.
CommandObject(int cmd, java.lang.String s, java.lang.Object o)
          Constructor used to create a command which requires one String argument and one Object argument.
CommandObject(int cmd, java.lang.String s, java.lang.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, java.lang.String s, java.lang.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, java.lang.String s1, java.lang.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 Detail

INITIALIZE

public static final int INITIALIZE
Global identifier for the command to initialize the current sound library.

See Also:
Constant Field Values

LOAD_SOUND

public static final int LOAD_SOUND
Global identifier for the command to pre-load a sound file.

See Also:
Constant Field Values

LOAD_DATA

public static final int LOAD_DATA
Global identifier for the command to pre-load a sound file.

See Also:
Constant Field Values

UNLOAD_SOUND

public static final int UNLOAD_SOUND
Global identifier for the command to remove a sound file from memory.

See Also:
Constant Field Values

QUEUE_SOUND

public static final int QUEUE_SOUND
Global identifier for the command to queue a sound file.

See Also:
Constant Field Values

DEQUEUE_SOUND

public static final int DEQUEUE_SOUND
Global identifier for the command to dequeue a sound file.

See Also:
Constant Field Values

FADE_OUT

public static final int FADE_OUT
Global identifier for the command to fade-out transition a source.

See Also:
Constant Field Values

FADE_OUT_IN

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

See Also:
Constant Field Values

CHECK_FADE_VOLUMES

public static final int CHECK_FADE_VOLUMES
Global identifier for the command to check volume levels of fading sources.

See Also:
Constant Field Values

NEW_SOURCE

public static final int NEW_SOURCE
Global identifier for the command to create a new source.

See Also:
Constant Field Values

RAW_DATA_STREAM

public static final int RAW_DATA_STREAM
Global identifier for the command to create a new raw data stream.

See Also:
Constant Field Values

QUICK_PLAY

public static final int QUICK_PLAY
Global identifier for the command to create a source and immediately play it.

See Also:
Constant Field Values

SET_POSITION

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

See Also:
Constant Field Values

SET_VOLUME

public static final int SET_VOLUME
Global identifier for the command to change a source's volume.

See Also:
Constant Field Values

SET_PITCH

public static final int SET_PITCH
Global identifier for the command to change a source's pitch.

See Also:
Constant Field Values

SET_PRIORITY

public static final int SET_PRIORITY
Global identifier for the command to change a source's priority.

See Also:
Constant Field Values

SET_LOOPING

public static final int SET_LOOPING
Global identifier for the command to tell a source whether or not to loop.

See Also:
Constant Field Values

SET_ATTENUATION

public static final int SET_ATTENUATION
Global identifier for the command to set a source's attenuation model.

See Also:
Constant Field Values

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:
Constant Field Values

CHANGE_DOPPLER_FACTOR

public static final int CHANGE_DOPPLER_FACTOR
Global identifier for the command to change the Doppler factor.

See Also:
Constant Field Values

CHANGE_DOPPLER_VELOCITY

public static final int CHANGE_DOPPLER_VELOCITY
Global identifier for the command to change the Doppler velocity.

See Also:
Constant Field Values

SET_VELOCITY

public static final int SET_VELOCITY
Global identifier for the command to set a source's velocity.

See Also:
Constant Field Values

SET_LISTENER_VELOCITY

public static final int SET_LISTENER_VELOCITY
Global identifier for the command to set a source's velocity.

See Also:
Constant Field Values

PLAY

public static final int PLAY
Global identifier for the command to play a source.

See Also:
Constant Field Values

FEED_RAW_AUDIO_DATA

public static final int FEED_RAW_AUDIO_DATA
Global identifier for the command to play a source.

See Also:
Constant Field Values

PAUSE

public static final int PAUSE
Global identifier for the command to pause a source.

See Also:
Constant Field Values

STOP

public static final int STOP
Global identifier for the command to stop a source.

See Also:
Constant Field Values

REWIND

public static final int REWIND
Global identifier for the command to rewind a source.

See Also:
Constant Field Values

FLUSH

public static final int FLUSH
Global identifier for the command to flush all queued data.

See Also:
Constant Field Values

CULL

public static final int CULL
Global identifier for the command to cull a source.

See Also:
Constant Field Values

ACTIVATE

public static final int ACTIVATE
Global identifier for the command to activate a source.

See Also:
Constant Field Values

SET_TEMPORARY

public static final int SET_TEMPORARY
Global identifier for the command to set a source as permanant or temporary.

See Also:
Constant Field Values

REMOVE_SOURCE

public static final int REMOVE_SOURCE
Global identifier for the command to delete a source.

See Also:
Constant Field Values

MOVE_LISTENER

public static final int MOVE_LISTENER
Global identifier for the command to move the listner.

See Also:
Constant Field Values

SET_LISTENER_POSITION

public static final int SET_LISTENER_POSITION
Global identifier for the command to set the listener's position.

See Also:
Constant Field Values

TURN_LISTENER

public static final int TURN_LISTENER
Global identifier for the command to turn the listener.

See Also:
Constant Field Values

SET_LISTENER_ANGLE

public static final int SET_LISTENER_ANGLE
Global identifier for the command to set the listener's turn angle.

See Also:
Constant Field Values

SET_LISTENER_ORIENTATION

public static final int SET_LISTENER_ORIENTATION
Global identifier for the command to change the listener's orientation.

See Also:
Constant Field Values

SET_MASTER_VOLUME

public static final int SET_MASTER_VOLUME
Global identifier for the command to change the master volume.

See Also:
Constant Field Values

NEW_LIBRARY

public static final int NEW_LIBRARY
Global identifier for the command to create a new library.

See Also:
Constant Field Values

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 java.lang.String[] stringArgs
Any String arguments required for a command.


classArgs

public java.lang.Class[] classArgs
Any Class arguments required for a command.


objectArgs

public java.lang.Object[] objectArgs
Any Object arguments required for a command.


Command

public int Command
Which command to execute.

Constructor Detail

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,
                     java.lang.Class 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,
                     java.lang.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,
                     java.lang.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,
                     java.lang.String s,
                     java.lang.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,
                     java.lang.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,
                     java.lang.String s,
                     java.lang.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,
                     java.lang.String s,
                     java.lang.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,
                     java.lang.String s1,
                     java.lang.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,
                     java.lang.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,
                     java.lang.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,
                     java.lang.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,
                     java.lang.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,
                     java.lang.String s,
                     java.lang.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,
                     java.lang.String s,
                     java.lang.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,
                     java.lang.Object o,
                     boolean b,
                     java.lang.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.