public final class UGen.UGenInput
extends java.lang.Object
A UGenInput will have an InputType of either AUDIO or CONTROL. An AUDIO input will always have the same number of channels as the owning UGen, in other words the length of the array returned by getLastValues will have a length equal to channel count. A CONTROL input will always have one channel and its value can be conveniently queried by calling getLastValue().
Constructor and Description |
---|
UGenInput(UGen.InputType type)
Create a UGenInput with a particular type.
|
UGenInput(UGen.InputType type,
float value)
Create a UGenInput of the specified type with an initial value.
|
Modifier and Type | Method and Description |
---|---|
int |
channelCount()
Returns how many channels this UGenInput generates.
|
UGen |
getIncomingUGen()
The incoming UGen is the UGen that is patched to
this UGenInput.
|
UGen.InputType |
getInputType()
Returns the InputType of this UGenInput.
|
java.lang.String |
getInputTypeAsString() |
float |
getLastValue()
Returns the first value in the array of last values.
|
float[] |
getLastValues()
Access the last values generated by this input.
|
UGen |
getOuterUGen()
The outer UGen is the UGen that owns this input.
|
boolean |
isPatched()
Returns true if a UGen is patched to this UGenInput.
|
void |
printInput()
Print information about this UGenInput (for debugging)
|
void |
setChannelCount(int numberOfChannels)
Set the number of channels this input should generate.
|
void |
setIncomingUGen(UGen in)
This method is called when a UGen is patched to this input.
|
void |
setLastValue(float value)
Sets all values in the last values array to the provided value.
|
public UGenInput(UGen.InputType type)
type
- the InputType of this UGenInputpublic UGenInput(UGen.InputType type, float value)
type
- the InputType of this UGenInputvalue
- the initial float value used for all last valuespublic void setChannelCount(int numberOfChannels)
numberOfChannels
- how many channels this input should generatepublic int channelCount()
public UGen.InputType getInputType()
public UGen getOuterUGen()
public UGen getIncomingUGen()
public void setIncomingUGen(UGen in)
in
- the UGen being patched to this inputpublic boolean isPatched()
public float[] getLastValues()
public float getLastValue()
public void setLastValue(float value)
Sets all values in the last values array to the provided value. If you want to set last values in the different channels of this input to different values, you should use getLastValues to do so. For example:
ugen.anInput.getLastValues()[0] = 1.f; ugen.anInput.getLastValues()[1] = 0.f;
value
- float: the value to set all last values topublic java.lang.String getInputTypeAsString()
public void printInput()