Пример #1
0
 private void SelectNextBuffer()
 {
     m_CurrentBuffer = m_CurrentBuffer == null ? m_Buffers : m_CurrentBuffer.NextBuffer;
 }
Пример #2
0
 private void AllocateBuffers(int bufferSize, int bufferCount)
 {
     FreeBuffers();
     if (bufferCount > 0)
     {
         m_Buffers = new WaveInBuffer(m_WaveIn, bufferSize);
         WaveInBuffer Prev = m_Buffers;
         try
         {
             for (int i = 1; i < bufferCount; i++)
             {
                 WaveInBuffer Buf = new WaveInBuffer(m_WaveIn, bufferSize);
                 Prev.NextBuffer = Buf;
                 Prev = Buf;
             }
         }
         finally
         {
             Prev.NextBuffer = m_Buffers;
         }
     }
 }
Пример #3
0
        private void FreeBuffers()
        {
            m_CurrentBuffer = null;
            if (m_Buffers != null)
            {
                WaveInBuffer First = m_Buffers;
                m_Buffers = null;

                WaveInBuffer Current = First;
                do
                {
                    WaveInBuffer Next = Current.NextBuffer;
                    Current.Dispose();
                    Current = Next;
                } while(Current != First);
            }
        }