Example #1
0
 private void WaitForAllBuffers()
 {
     global::WaveLib.WaveNative.WaveInBuffer Buf = this.m_Buffers;
     while (Buf.NextBuffer != this.m_Buffers)
     {
         Buf.WaitFor();
         Buf = Buf.NextBuffer;
     }
 }
Example #2
0
 private void FreeBuffers()
 {
     this.m_CurrentBuffer = null;
     if (this.m_Buffers != null)
     {
         global::WaveLib.WaveNative.WaveInBuffer First = this.m_Buffers;
         this.m_Buffers = null;
         global::WaveLib.WaveNative.WaveInBuffer Current = First;
         do
         {
             global::WaveLib.WaveNative.WaveInBuffer Next = Current.NextBuffer;
             Current.Dispose();
             Current = Next;
         } while (Current != First);
     }
 }
Example #3
0
 private void AllocateBuffers(int bufferSize, int bufferCount)
 {
     this.FreeBuffers();
     if (bufferCount > 0)
     {
         this.m_Buffers = new global::WaveLib.WaveNative.WaveInBuffer(this.m_WaveIn, bufferSize);
         global::WaveLib.WaveNative.WaveInBuffer Prev = this.m_Buffers;
         try
         {
             for (int i = 1; i < bufferCount; i++)
             {
                 global::WaveLib.WaveNative.WaveInBuffer Buf = new global::WaveLib.WaveNative.WaveInBuffer(this.m_WaveIn, bufferSize);
                 Prev.NextBuffer = Buf;
                 Prev            = Buf;
             }
         } finally { Prev.NextBuffer = this.m_Buffers; }
     }
 }
Example #4
0
 private void SelectNextBuffer()
 {
     this.m_CurrentBuffer = this.m_CurrentBuffer == null ? this.m_Buffers : this.m_CurrentBuffer.NextBuffer;
 }