com.softsynth.jsyn
Class SynthInput

java.lang.Object
  extended by com.softsynth.jsyn.SynthPort
      extended by com.softsynth.jsyn.SynthScalarPort
          extended by com.softsynth.jsyn.SynthVariable
              extended by com.softsynth.jsyn.SynthInput
Direct Known Subclasses:
SynthDistributor

public class SynthInput
extends SynthVariable

SynthInput is an input port for a SynthUnit. It can be connected to a SynthOutput or set() directly.

Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved

Method Summary
 void connect(int outIndex, SynthInput inPort, int inIndex)
          This method is illegal for SynthInput but is legal for a subclass SynthDistributor.
 void connect(int inIndex, SynthOutput outPort, int outIndex)
          Connect output port of another instrument to this input port.
 void connect(SynthInput inPort)
           
 void connect(SynthOutput outPort)
           
 void disconnect()
           
 void disconnect(int index)
          Disconnects the connections made to this port.
 MultiplyUnit multiply(SynthOutput outPortX, SynthOutput outPortY)
          Convenient way to create a MultiplyUnit and connect it up.
 
Methods inherited from class com.softsynth.jsyn.SynthVariable
get, getCurrent, getCurrent, getMax, getMin, set, set, set, set, setAt, setAt, setMax, setMin, setSignalType, setup
 
Methods inherited from class com.softsynth.jsyn.SynthScalarPort
get
 
Methods inherited from class com.softsynth.jsyn.SynthPort
getAlias, getName, getNumParts, getSignalType, getSignalType, getSound, setAlias, setSignalType, setSignalType, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

connect

public void connect(int inIndex,
                    SynthOutput outPort,
                    int outIndex)
             throws SynthException
Connect output port of another instrument to this input port. Each port can have multiple indexed parts. A stereo sample reader would, for example, have an "Output" with two parts.

Throws:
SynthException - If port name is not recognized, or index out of range.

connect

public void connect(SynthOutput outPort)
             throws SynthException
Throws:
SynthException

connect

public void connect(int outIndex,
                    SynthInput inPort,
                    int inIndex)
             throws SynthException
This method is illegal for SynthInput but is legal for a subclass SynthDistributor. We need to define it so that we can make polymorphic ports. But defining this method here prevents me from catching input<->input connection errors.

Throws:
SynthException - If used to connect two SynthInputs, or if port is not invalid, or index out of range.

connect

public void connect(SynthInput inPort)
             throws SynthException
Throws:
SynthException

disconnect

public void disconnect(int index)
                throws SynthException
Disconnects the connections made to this port. Only one connection can be made to an input port so a connection can be uniquely referenced by naming the input port. Output ports have infinite fan-out.

Throws:
SynthException - If port name is not recognized, or index out of range.

disconnect

public void disconnect()
                throws SynthException
Throws:
SynthException

multiply

public MultiplyUnit multiply(SynthOutput outPortX,
                             SynthOutput outPortY)
                      throws SynthException
Convenient way to create a MultiplyUnit and connect it up. To get Z = X * Y, use:
    Z.input.multiply( X.output, Y.output );
 
Make sure you save a reference to the MultiplyUnit or it may get garbage collected.

Returns:
new MultiplyUnit()
Throws:
SynthException - If MultiplyUnit cannot be created, or ports invalid.