Assets/Plugins/Unity.DSPGraph/Runtime/DSPCommandBlock.cs
/// <summary>
/// Add a parameter value at a particular DSP clock time.
/// </summary>
/// <remarks>
/// This schedules a value of the specified parameter in the future.
/// Multiple keys can be scheduled as long as they are scheduled monotonically.
/// Use this to schedule parameter automation.
/// </remarks>
/// <param name="node">The DSPNode to add the parameter key to</param>
/// <param name="parameter">The parameter to set</param>
/// <param name="dspClock">The clock value in the future that this parameter should reach the specified value</param>
/// <param name="value">The desired value of the parameter at the specified time</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">Throws exception when parameter is unknown</exception>
Add a parameter value at a particular DSP clock time.
Add a parameter value at a particular DSP clock time .
public void AddFloatKey<TParameters, TProviders, TAudioKernel>(DSPNode node, TParameters parameter, long dspClock, float value)
            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 AddFloatKeyCommand
            {
                m_Type = DSPCommandType.AddFloatKey,
                m_Graph = m_Graph,
                m_Handle = m_Handle,
                m_Node = node.Handle,
                m_DSPClock = (ulong)dspClock,
                m_JobReflectionData = jobReflectionData,
                m_ParameterDescriptionData = parameterDescriptionData,
                m_Parameter = (uint)UnsafeUtility.EnumToInt(parameter),
                m_Value = value,
            });
        }
public void AddFloatKey < TParameters , TProviders , TAudioKernel > ( DSPNode node , TParameters parameter , long dspClock , float value ) 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 AddFloatKeyCommand { m_Type = DSPCommandType . AddFloatKey , m_Graph = m_Graph , m_Handle = m_Handle , m_Node = node . Handle , m_DSPClock = ( ulong ) dspClock , m_JobReflectionData = jobReflectionData , m_ParameterDescriptionData = parameterDescriptionData , m_Parameter = ( uint ) UnsafeUtility . EnumToInt ( parameter ) , m_Value = value , } ) ; }
Add a parameter value at a particular DSP clock time.
Add a parameter value at a particular DSP clock time .
Throws exception when parameter is unknown
Throws exception when parameter is unknown
node
DSPNode
The DSPNode to add the parameter key to
The DSPNode to add the parameter key to
parameter
TParameters
The parameter to set
The parameter to set
dspClock
long
The clock value in the future that this parameter should reach the specified value
The clock value in the future that this parameter should reach the specified value
value
float
The desired value of the parameter at the specified time
The desired value of the parameter at the specified time
remarks
This schedules a value of the specified parameter in the future.
Multiple keys can be scheduled as long as they are scheduled monotonically.
Use this to schedule parameter automation.
This schedules a value of the specified parameter in the future . Multiple keys can be scheduled as long as they are scheduled monotonically . Use this to schedule parameter automation .
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