Assets/Plugins/Unity.DSPGraph/Runtime/DSPCommandBlock.cs
/// <summary>
/// Removes <typeparamref name="AudioSampleProvider"/> from the specified <typeparamref name="DSPNode"/>. If index is not passed or is -1 then it is removed from the last.
/// </summary>
/// <param name="node">The node to remove the <typeparamref name="AudioSampleProvider"/> from</param>
/// <param name="item">The sample provider 'slot' that should have the sample provider removed from</param>
/// <param name="index">The index into the array that the provider should be removed from. This is if the sample provider slot is an array.</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">Unknown SampleProvider</exception>
/// <exception cref="InvalidOperationException">Can only remove from variable-size array</exception>
Removes  from the specified . If index is not passed or is -1 then it is removed from the last.
Removes from the specified . If index is not passed or is - 1 then it is removed from the last .
public void RemoveSampleProvider<TParameters, TProviders, TAudioKernel>(DSPNode node, TProviders item, int index = -1)
            where TParameters  : unmanaged, Enum
            where TProviders   : unmanaged, Enum
            where TAudioKernel : struct, IAudioKernel<TParameters, TProviders>
        {
            AssertSameGraphAsNode(node);
            AudioKernelExtensions.GetReflectionData<TAudioKernel, TParameters, TProviders>(out AudioKernelExtensions.SampleProviderDescriptionData sampleProviderDescriptionData);
            var itemIndex = UnsafeUtility.EnumToInt(item);
            if (!sampleProviderDescriptionData.Descriptions[itemIndex].m_IsArray ||
                sampleProviderDescriptionData.Descriptions[itemIndex].m_Size >= 0)
                throw new InvalidOperationException("Can only remove sample providers from variable-size array");
            QueueCommand(new RemoveSampleProviderCommand
            {
                m_Type = DSPCommandType.RemoveSampleProvider,
                m_Graph = m_Graph,
                m_Handle = m_Handle,
                m_Node = node.Handle,
                m_SampleProviderDescriptionData = sampleProviderDescriptionData,
                m_Item = UnsafeUtility.EnumToInt(item),
                m_Index = index,
            });
        }
public void RemoveSampleProvider < TParameters , TProviders , TAudioKernel > ( DSPNode node , TProviders item , int index = - 1 ) where TParameters : unmanaged , Enum where TProviders : unmanaged , Enum where TAudioKernel : struct , IAudioKernel < TParameters , TProviders > { AssertSameGraphAsNode ( node ) ; AudioKernelExtensions . GetReflectionData < TAudioKernel , TParameters , TProviders > ( out AudioKernelExtensions . SampleProviderDescriptionData sampleProviderDescriptionData ) ; var itemIndex = UnsafeUtility . EnumToInt ( item ) ; if ( ! sampleProviderDescriptionData . Descriptions [ itemIndex ] . m_IsArray || sampleProviderDescriptionData . Descriptions [ itemIndex ] . m_Size >= 0 ) throw new InvalidOperationException ( " " ) ; QueueCommand ( new RemoveSampleProviderCommand { m_Type = DSPCommandType . RemoveSampleProvider , m_Graph = m_Graph , m_Handle = m_Handle , m_Node = node . Handle , m_SampleProviderDescriptionData = sampleProviderDescriptionData , m_Item = UnsafeUtility . EnumToInt ( item ) , m_Index = index , } ) ; }
Removes  from the specified .
Removes from the specified .
// Can only remove from variable-size arrays.
None
Can only remove from variable-size array
Can only remove from variable - size array
node
DSPNode
The node to remove the  from
The node to remove the from
item
TProviders
The sample provider 'slot' that should have the sample provider removed from
The sample provider ' slot ' that should have the sample provider removed from
index
int
The index into the array that the provider should be removed from. This is if the sample provider slot is an array.
The index into the array that the provider should be removed from . This is if the sample provider slot is an array .
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