com.cycling74.jitter
Class JitterObject

java.lang.Object
  |
  +--com.cycling74.jitter.JitterObject
Direct Known Subclasses:
JitterListener, JitterMatrix

public class JitterObject
extends java.lang.Object

JitterObject provides a way for your mxj classes to instantiate Jitter objects.

Author:
Joshua Kit Clayton

Field Summary
protected  long _p_obj
          a pointer to the peer Jitter object.
 
Constructor Summary
JitterObject()
          creates a JitterObject with no Jitter class peer.
JitterObject(java.lang.String classname)
          creates a JitterObject with no arguments
JitterObject(java.lang.String classname, com.cycling74.max.Atom[] args)
          creates a JitterObject
 
Method Summary
protected  long _new(java.lang.String s, com.cycling74.max.Atom[] args)
           
 com.cycling74.max.Atom[] bang()
          sends a bang to the peer Jitter object
 com.cycling74.max.Atom[] call(java.lang.String messagename)
          calls a method without arguments in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, com.cycling74.max.Atom[] args)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, float arg)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, float[] args)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, int arg)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, int[] args)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, java.lang.String arg)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
 com.cycling74.max.Atom[] call(java.lang.String messagename, java.lang.String[] args)
          calls a method in the peer Jitter object (This does the same thing as the send method.)
protected  void finalize()
          Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
 void freePeer()
          frees the peer Jitter object.
 com.cycling74.max.Atom[] getAttr(java.lang.String attrname)
           
 float getAttrFloat(java.lang.String attrname)
           
 float[] getAttrFloatArray(java.lang.String attrname)
           
 int getAttrInt(java.lang.String attrname)
           
 int[] getAttrIntArray(java.lang.String attrname)
           
 java.lang.String getAttrString(java.lang.String attrname)
           
 java.lang.String[] getAttrStringArray(java.lang.String attrname)
           
 java.lang.String getJitterClass()
           
 boolean matrixcalc(java.lang.Object input, java.lang.Object output)
          execute the peer Jitter object's matrixcalc method
 com.cycling74.max.Atom[] send(float f)
          sends a float/code> to the peer Jitter object
 com.cycling74.max.Atom[] send(int i)
          sends an int to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename)
          sends a message without arguments to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, com.cycling74.max.Atom[] args)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, float arg)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, float[] args)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, int arg)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, int[] args)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, java.lang.String arg)
          sends a message to the peer Jitter object
 com.cycling74.max.Atom[] send(java.lang.String messagename, java.lang.String[] args)
          sends a message to the peer Jitter object
 boolean setAttr(java.lang.String attrname, com.cycling74.max.Atom[] args)
          sets an attribute
 boolean setAttr(java.lang.String attrname, float arg)
          sets an attribute
 boolean setAttr(java.lang.String attrname, float[] args)
          sets an attribute
 boolean setAttr(java.lang.String attrname, int arg)
          sets an attribute
 boolean setAttr(java.lang.String attrname, int[] args)
          sets an attribute
 boolean setAttr(java.lang.String attrname, java.lang.String arg)
          sets an attribute
 boolean setAttr(java.lang.String attrname, java.lang.String[] args)
          sets an attribute
 boolean understands(java.lang.String messagename)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_p_obj

protected long _p_obj
a pointer to the peer Jitter object. It is necessary to expose this variable so that the C code in jitlib can access the pointer in a subclass like JitterMatrix.
Constructor Detail

JitterObject

public JitterObject(java.lang.String classname,
                    com.cycling74.max.Atom[] args)
creates a JitterObject
Parameters:
classname - the String that contains the Jitter class name to instantiate
args - the arguments for the Jitter class constructor

JitterObject

public JitterObject(java.lang.String classname)
creates a JitterObject with no arguments
Parameters:
classname - the String that contains the Jitter class name to instantiate

JitterObject

public JitterObject()
creates a JitterObject with no Jitter class peer. This constructor is useful when subclassing - you need to call the superclass's constructor right away, but you may not know all the parameters of the peer Jitter object you want to create. After invoking this empty constructor one can later call the _new method to create the peer object.
Method Detail

getAttr

public com.cycling74.max.Atom[] getAttr(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the Atom[] containing the value(s) of the attribute specified by attrname.

getAttrInt

public int getAttrInt(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the int containing the value of the attribute specified by attrname.

getAttrIntArray

public int[] getAttrIntArray(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the int[] containing the value(s) of the attribute specified by attrname.

getAttrFloat

public float getAttrFloat(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the float containing the value of the attribute specified by attrname.

getAttrFloatArray

public float[] getAttrFloatArray(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the float[] containing the value(s) of the attribute specified by attrname.

getAttrString

public java.lang.String getAttrString(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the String containing the value of the attribute specified by attrname.

getAttrStringArray

public java.lang.String[] getAttrStringArray(java.lang.String attrname)
Parameters:
attrname - the attribute to query
Returns:
the String[] containing the value of the attribute specified by attrname.

setAttr

public boolean setAttr(java.lang.String attrname,
                       com.cycling74.max.Atom[] args)
sets an attribute
Parameters:
attrname - which attribute to set
args - the value(s) to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       int arg)
sets an attribute
Parameters:
attrname - which attribute to set
arg - the value to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       int[] args)
sets an attribute
Parameters:
attrname - which attribute to set
args - the value(s) to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       float arg)
sets an attribute
Parameters:
attrname - which attribute to set
arg - the value to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       float[] args)
sets an attribute
Parameters:
attrname - which attribute to set
args - the value(s) to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       java.lang.String arg)
sets an attribute
Parameters:
attrname - which attribute to set
arg - the value to set
Returns:
whether or not the attribute was set successfully

setAttr

public boolean setAttr(java.lang.String attrname,
                       java.lang.String[] args)
sets an attribute
Parameters:
attrname - which attribute to set
args - the value(s) to set
Returns:
whether or not the attribute was set successfully

bang

public com.cycling74.max.Atom[] bang()
sends a bang to the peer Jitter object
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(int i)
sends an int to the peer Jitter object
Parameters:
i - the int to send
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(float f)
sends a float/code> to the peer Jitter object
Parameters:
f - the float to send
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename)
sends a message without arguments to the peer Jitter object
Parameters:
messagename - the message to send
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename)
calls a method without arguments in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     com.cycling74.max.Atom[] args)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
args - the Atom[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     com.cycling74.max.Atom[] args)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
args - the Atom[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     int arg)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
arg - the int argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     int arg)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
arg - the int argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     int[] args)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
args - the int[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     int[] args)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
args - the int[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     float arg)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
arg - the float argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     float arg)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
arg - the float argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     float[] args)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
args - the float[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     float[] args)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
args - the float[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     java.lang.String arg)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
arg - the String argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     java.lang.String arg)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
arg - the String argument to send with the message
Returns:
the Atom[] containing the return value(s), if any

send

public com.cycling74.max.Atom[] send(java.lang.String messagename,
                                     java.lang.String[] args)
sends a message to the peer Jitter object
Parameters:
messagename - the message to send
args - the String[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

call

public com.cycling74.max.Atom[] call(java.lang.String messagename,
                                     java.lang.String[] args)
calls a method in the peer Jitter object (This does the same thing as the send method.)
Parameters:
messagename - the message to send
args - the String[] argument(s) to send with the message
Returns:
the Atom[] containing the return value(s), if any

matrixcalc

public boolean matrixcalc(java.lang.Object input,
                          java.lang.Object output)
execute the peer Jitter object's matrixcalc method
Parameters:
input - the input, either as a String representing the name of a peer Jitter matrix or a JitterMatrix object
output - the output, either as a String representing the name of a peer Jitter matrix or a JitterMatrix object
Returns:
whether the method was executed successfully

understands

public boolean understands(java.lang.String messagename)
Parameters:
messagename - the message to test
Returns:
whether the peer Jitter class understands the message

getJitterClass

public java.lang.String getJitterClass()
Returns:
the name of the peer Jitter class.

freePeer

public void freePeer()
frees the peer Jitter object.

finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable -  

_new

protected long _new(java.lang.String s,
                    com.cycling74.max.Atom[] args)
Parameters:
s - the name of the peer Jitter class
args - the instantiation arguments of the peer Jitter class
Returns:
a long representing the peer Jitter object