Assets/Plugins/Unity.DSPGraph/Runtime/SampleProviderContainer.cs
/// <summary>
/// Gets the number of sample providers associated with a given enum value in a container.
/// </summary>
/// <param name="p"></param>
/// <returns></returns>
Gets the number of sample providers associated with a given enum value in a container.
Gets the number of sample providers associated with a given enum value in a container .
public int GetCount(TProviders p)
        {
            var itemIndex = UnsafeUtility.EnumToInt(p);
            if (itemIndex < 0 || itemIndex >= Count)
                throw new IndexOutOfRangeException("itemIndex");
            int globalIndex = SampleProviderIndices[itemIndex];
            if (globalIndex < 0)
                return 0;
            int nextItemIndex = itemIndex + 1;
            int nextGlobalIndex = -1;
            for (; nextItemIndex < Count; ++nextItemIndex)
            {
                nextGlobalIndex = SampleProviderIndices[nextItemIndex];
                if (nextGlobalIndex >= 0)
                    break;
            }
            if (nextGlobalIndex < 0)
                return SampleProvidersCount - globalIndex;
            return nextGlobalIndex - globalIndex;
        }
public int GetCount ( TProviders p ) { var itemIndex = UnsafeUtility . EnumToInt ( p ) ; if ( itemIndex < 0 || itemIndex >= Count ) throw new IndexOutOfRangeException ( " " ) ; int globalIndex = SampleProviderIndices [ itemIndex ] ; if ( globalIndex < 0 ) return 0 ; int nextItemIndex = itemIndex + 1 ; int nextGlobalIndex = - 1 ; for ( ; nextItemIndex < Count ; ++ nextItemIndex ) { nextGlobalIndex = SampleProviderIndices [ nextItemIndex ] ; if ( nextGlobalIndex >= 0 ) break ; } if ( nextGlobalIndex < 0 ) return SampleProvidersCount - globalIndex ; return nextGlobalIndex - globalIndex ; }
Gets the number of sample providers associated with a given enum value in a container.
Gets the number of sample providers associated with a given enum value in a container .
// Happens if the 'itemIndex'th item is an empty array. // Find the index of the next non-empty item. // All items after itemIndex are empty containers.
None
p
TProviders
None