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