com.softsynth.jsyn
Class EnvelopePoints

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by com.softsynth.jsyn.EnvelopePoints
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class EnvelopePoints
extends java.util.Vector

Vector that contains duration,value pairs. Used by EnvelopeEditor

Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
Serialized Form

Constructor Summary
EnvelopePoints()
           
 
Method Summary
 void add(double dur, double value)
           
 double getMaximumValue()
           
 java.lang.String getName()
           
 double[] getPoint(int index)
           
 int getReleaseBegin()
           
 int getReleaseEnd()
           
 int getReleaseSize()
           
 int getSustainBegin()
           
 int getSustainEnd()
           
 int getSustainSize()
           
 double getTotalDuration()
           
 void insert(int index, double dur, double y)
          Insert point without changing total duration by reducing next points duration.
 void removePoint(int index)
          Remove indexed point and update sustain and release loops if necessary.
 void setMaximumValue(double maximumValue)
           
 void setName(java.lang.String name)
           
 void setReleaseLoop(int startFrame, int endFrame)
          Set location of Release Loop in units of Frames.
 void setSustainLoop(int startFrame, int endFrame)
          Set location of Sustain Loop in units of Frames.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

EnvelopePoints

public EnvelopePoints()
Method Detail

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

setMaximumValue

public void setMaximumValue(double maximumValue)

getMaximumValue

public double getMaximumValue()

add

public void add(double dur,
                double value)

insert

public void insert(int index,
                   double dur,
                   double y)
Insert point without changing total duration by reducing next points duration.


removePoint

public void removePoint(int index)
Remove indexed point and update sustain and release loops if necessary. Did not name thie "remove()" because of conflicts with new JDK 1.3 method with the same name.


getPoint

public double[] getPoint(int index)

getTotalDuration

public double getTotalDuration()

setSustainLoop

public void setSustainLoop(int startFrame,
                           int endFrame)
Set location of Sustain Loop in units of Frames. Set SustainBegin to -1 if no Sustain Loop. SustainEnd value is the frame index of the frame just past the end of the loop. The number of frames included in the loop is (SustainEnd - SustainBegin).


getSustainBegin

public int getSustainBegin()
Returns:
Beginning of sustain loop or -1 if no loop.

getSustainEnd

public int getSustainEnd()
Returns:
End of sustain loop or -1 if no loop.

getSustainSize

public int getSustainSize()
Returns:
Size of sustain loop in frames, 0 if no loop.

setReleaseLoop

public void setReleaseLoop(int startFrame,
                           int endFrame)
Set location of Release Loop in units of Frames. Set ReleaseBegin to -1 if no ReleaseLoop. ReleaseEnd value is the frame index of the frame just past the end of the loop. The number of frames included in the loop is (ReleaseEnd - ReleaseBegin).


getReleaseBegin

public int getReleaseBegin()
Returns:
Beginning of release loop or -1 if no loop.

getReleaseEnd

public int getReleaseEnd()
Returns:
End of release loop or -1 if no loop.

getReleaseSize

public int getReleaseSize()
Returns:
Size of release loop in frames, 0 if no loop.