GAudio.GATData.CopyFrom C# (CSharp) Method

CopyFrom() public method

Copies data from a float[] to a GATData instance.
public CopyFrom ( float sourceArray, int destinationIndex, int sourceIndex, int length ) : void
sourceArray float
destinationIndex int
sourceIndex int
length int
return void
        public void CopyFrom( float[] sourceArray, int destinationIndex, int sourceIndex, int length )
        {
            System.Array.Copy( sourceArray, sourceIndex, _parentArray, _offset + destinationIndex, length );
        }

Usage Example

Esempio n. 1
0
        public int GetData(GATData target, int targetLength, int offsetInTarget, bool reverse = false)
        {
            int nextIndex = ( int )_nextIndex;
            int sign      = reverse ? -1 : 1;
            int lastIndex = nextIndex + targetLength * sign;

            if (lastIndex >= _data.Count)
            {
                targetLength = _data.Count - nextIndex;
            }
            else if (lastIndex < 0)
            {
                targetLength = nextIndex + 1;
                lastIndex    = 0;
            }

            if (reverse == false)
            {
                target.CopyFrom(_data.ParentArray, offsetInTarget, nextIndex + _data.MemOffset, targetLength);
            }
            else
            {
                target.CopyFrom(_data.ParentArray, offsetInTarget, lastIndex + _data.MemOffset, targetLength);
                target.Reverse(offsetInTarget, targetLength);
            }

            _nextIndex = ( int )lastIndex;

            return(targetLength);
        }
All Usage Examples Of GAudio.GATData::CopyFrom