AcoustID.Chromaprint.CombinedBuffer.Shift C# (CSharp) Method

Shift() public method

Shift the buffer offset.
public Shift ( int shift ) : int
shift int Places to shift.
return int
        public int Shift(int shift)
        {
            m_offset += shift;
            return m_offset;
        }

Usage Example

コード例 #1
0
        public void TestFlushAfterShift()
        {
            short[] buffer1 = { 1, 2, 3, 4, 5 };
            short[] buffer2 = { 6, 7, 8 };
            short[] tmp = new short[10];

            CombinedBuffer buffer = new CombinedBuffer(buffer1, 5, buffer2, 3);
            buffer.Shift(6);

            for (int i = 0; i < 10; i++)
            {
                
                Assert.AreEqual(0, tmp[i]);
            }

            buffer.Flush(tmp);
            Assert.AreEqual(6, buffer.Offset);

            for (int i = 0; i < 2; i++)
            {
                Assert.AreEqual(7 + i, tmp[i]);
            }
            for (int i = 2; i < 10; i++)
            {
                Assert.AreEqual(0, tmp[i]);
            }
        }
All Usage Examples Of AcoustID.Chromaprint.CombinedBuffer::Shift