Assets/Plugins/Unity.DSPGraph/Runtime/DSPCommandBlock.cs
/// <summary>
/// Sets the value of a parameter on the specified node
/// </summary>
/// <param name="node">DSPNode in which the parameter value is set</param>
/// <param name="parameter">Enum which specifies the parameter</param>
/// <param name="value">Target value to be set</param>
/// <param name="interpolationLength">The number of samples to reach the desired value</param>
/// <typeparam name="TParameters">Enum type of the parameters of the node</typeparam>
/// <typeparam name="TProviders">Enum type of the sample providers of the node</typeparam>
/// <typeparam name="TAudioKernel">The kernel type of the node</typeparam>
/// <exception cref="ArgumentException">Exception thrown when parameter is unknown</exception>
Sets the value of a parameter on the specified node
Sets the value of a parameter on the specified node
public void SetFloat<TParameters, TProviders, TAudioKernel>(DSPNode node, TParameters parameter, float value, int interpolationLength = 0)
            where TParameters  : unmanaged, Enum
            where TProviders   : unmanaged, Enum
            where TAudioKernel : struct, IAudioKernel<TParameters, TProviders>
        {
            AssertSameGraphAsNode(node);
            AudioKernelExtensions.GetReflectionData<TAudioKernel, TParameters, TProviders>(out void* jobReflectionData, out AudioKernelExtensions.ParameterDescriptionData parameterDescriptionData);
            QueueCommand(new SetFloatCommand
            {
                m_Type = DSPCommandType.SetFloat,
                m_Graph = m_Graph,
                m_Handle = m_Handle,
                m_InterpolationLength = (uint)interpolationLength,
                m_JobReflectionData = jobReflectionData,
                m_Node = node.Handle,
                m_Parameter = (uint)UnsafeUtility.EnumToInt(parameter),
                m_ParameterDescriptionData = parameterDescriptionData,
                m_Value = value,
            });
        }
public void SetFloat < TParameters , TProviders , TAudioKernel > ( DSPNode node , TParameters parameter , float value , int interpolationLength = 0 ) where TParameters : unmanaged , Enum where TProviders : unmanaged , Enum where TAudioKernel : struct , IAudioKernel < TParameters , TProviders > { AssertSameGraphAsNode ( node ) ; AudioKernelExtensions . GetReflectionData < TAudioKernel , TParameters , TProviders > ( out void * jobReflectionData , out AudioKernelExtensions . ParameterDescriptionData parameterDescriptionData ) ; QueueCommand ( new SetFloatCommand { m_Type = DSPCommandType . SetFloat , m_Graph = m_Graph , m_Handle = m_Handle , m_InterpolationLength = ( uint ) interpolationLength , m_JobReflectionData = jobReflectionData , m_Node = node . Handle , m_Parameter = ( uint ) UnsafeUtility . EnumToInt ( parameter ) , m_ParameterDescriptionData = parameterDescriptionData , m_Value = value , } ) ; }
Sets the value of a parameter on the specified node
Sets the value of a parameter on the specified node
Exception thrown when parameter is unknown
Exception thrown when parameter is unknown
node
DSPNode
DSPNode in which the parameter value is set
DSPNode in which the parameter value is set
parameter
TParameters
Enum which specifies the parameter
Enum which specifies the parameter
value
float
Target value to be set
Target value to be set
interpolationLength
int
The number of samples to reach the desired value
The number of samples to reach the desired value
typeparam
Enum type of the parameters of the node
Enum type of the parameters of the node
typeparam
Enum type of the sample providers of the node
Enum type of the sample providers of the node
typeparam
The kernel type of the node
The kernel type of the node