Inheritance: IDisposable
Esempio n. 1
0
 private void WaitForAllBuffers()
 {
     for (WaveOutBuffer waveOutBuffer = this.m_Buffers; waveOutBuffer.NextBuffer != this.m_Buffers; waveOutBuffer = waveOutBuffer.NextBuffer)
     {
         waveOutBuffer.WaitFor();
     }
 }
Esempio n. 2
0
        private void WaitForAllBuffers()
        {
            WaveOutBuffer Buf = m_Buffers;

            while (Buf.NextBuffer != m_Buffers)
            {
                Buf.WaitFor();
                Buf = Buf.NextBuffer;
            }
        }
Esempio n. 3
0
        /// <summary>Wait for buffers to release</summary>
        private void WaitForAllBuffers()
        {
            WaveOutBuffer bf = _cBuffers;

            while (bf._cNextBuffer != _cBuffers)
            {
                bf.WaitFor();
                bf = bf._cNextBuffer;
            }
        }
Esempio n. 4
0
 internal static void WaveOutProc(IntPtr hdrvr, int uMsg, int dwUser, ref WAVEHDR wavhdr, int dwParam2)
 {
     if (uMsg == (int)NMWOM.MM_WOM_DONE)
     {
         try
         {
             GCHandle      h   = (GCHandle)wavhdr.dwUser;
             WaveOutBuffer buf = (WaveOutBuffer)h.Target;
             buf.OnCompleted();
         }
         catch { }
     }
 }
Esempio n. 5
0
        private void FreeBuffers()
        {
            m_CurrentBuffer = null;
            if (m_Buffers != null)
            {
                WaveOutBuffer First = m_Buffers;
                m_Buffers = null;

                WaveOutBuffer Current = First;
                do
                {
                    WaveOutBuffer Next = Current.NextBuffer;
                    Current.Dispose();
                    Current = Next;
                } while(Current != First);
            }
        }
Esempio n. 6
0
        /// <summary>Release buffers</summary>
        private void FreeBuffers()
        {
            _cCurrentBuffer = null;
            if (_cBuffers != null)
            {
                WaveOutBuffer First = _cBuffers;
                _cBuffers = null;

                WaveOutBuffer Current = First;
                do
                {
                    WaveOutBuffer Next = Current._cNextBuffer;
                    Current.Dispose();
                    Current = Next;
                } while (Current != First);
            }
        }
Esempio n. 7
0
        private void FreeBuffers()
        {
            this.m_CurrentBuffer = (WaveOutBuffer)null;
            if (this.m_Buffers == null)
            {
                return;
            }
            WaveOutBuffer buffers = this.m_Buffers;

            this.m_Buffers = (WaveOutBuffer)null;
            WaveOutBuffer waveOutBuffer = buffers;

            do
            {
                WaveOutBuffer nextBuffer = waveOutBuffer.NextBuffer;
                waveOutBuffer.Dispose();
                waveOutBuffer = nextBuffer;
            }while (waveOutBuffer != buffers);
        }
Esempio n. 8
0
 private void AllocateBuffers(int bufferSize, int bufferCount)
 {
     FreeBuffers();
     if (bufferCount > 0)
     {
         m_Buffers = new WaveOutBuffer(m_WaveOut, bufferSize);
         WaveOutBuffer Prev = m_Buffers;
         try
         {
             for (int i = 1; i < bufferCount; i++)
             {
                 WaveOutBuffer Buf = new WaveOutBuffer(m_WaveOut, bufferSize);
                 Prev.NextBuffer = Buf;
                 Prev            = Buf;
             }
         }
         finally
         {
             Prev.NextBuffer = m_Buffers;
         }
     }
 }
Esempio n. 9
0
 /// <summary>Allocate buffers</summary>
 /// <param name="bufferSize">buffer size</param>
 /// <param name="bufferCount">buffer count</param>
 private void AllocateBuffers(uint bufferSize, uint bufferCount)
 {
     FreeBuffers();
     if (bufferCount > 0)
     {
         _cBuffers = new WaveOutBuffer(_pWaveOut, bufferSize);
         WaveOutBuffer Prev = _cBuffers;
         try
         {
             for (int i = 1; i < bufferCount; i++)
             {
                 WaveOutBuffer wbf = new WaveOutBuffer(_pWaveOut, bufferSize);
                 Prev._cNextBuffer = wbf;
                 Prev = wbf;
             }
         }
         finally
         {
             Prev._cNextBuffer = _cBuffers;
         }
     }
 }
Esempio n. 10
0
        private void AllocateBuffers(int bufferSize, int bufferCount)
        {
            this.FreeBuffers();
            if (bufferCount <= 0)
            {
                return;
            }
            this.m_Buffers = new WaveOutBuffer(this.m_WaveOut, bufferSize);
            WaveOutBuffer waveOutBuffer1 = this.m_Buffers;

            try
            {
                for (int index = 1; index < bufferCount; ++index)
                {
                    WaveOutBuffer waveOutBuffer2 = new WaveOutBuffer(this.m_WaveOut, bufferSize);
                    waveOutBuffer1.NextBuffer = waveOutBuffer2;
                    waveOutBuffer1            = waveOutBuffer2;
                }
            }
            finally
            {
                waveOutBuffer1.NextBuffer = this.m_Buffers;
            }
        }
Esempio n. 11
0
 private void Advance()
 {
     m_CurrentBuffer = m_CurrentBuffer == null ? m_Buffers : m_CurrentBuffer.NextBuffer;
     m_CurrentBuffer.WaitFor();
 }
Esempio n. 12
0
        private void FreeBuffers()
        {
            m_CurrentBuffer = null;
            if (m_Buffers != null)
            {
                WaveOutBuffer First = m_Buffers;
                m_Buffers = null;

                WaveOutBuffer Current = First;
                do
                {
                    WaveOutBuffer Next = Current.NextBuffer;
                    Current.Dispose();
                    Current = Next;
                } while(Current != First);
            }
        }
Esempio n. 13
0
 private void AllocateBuffers(int bufferSize, int bufferCount)
 {
     FreeBuffers();
     if (bufferCount > 0)
     {
         m_Buffers = new WaveOutBuffer(m_WaveOut, bufferSize);
         WaveOutBuffer Prev = m_Buffers;
         try
         {
             for (int i = 1; i < bufferCount; i++)
             {
                 WaveOutBuffer Buf = new WaveOutBuffer(m_WaveOut, bufferSize);
                 Prev.NextBuffer = Buf;
                 Prev = Buf;
             }
         }
         finally
         {
             Prev.NextBuffer = m_Buffers;
         }
     }
 }
Esempio n. 14
0
 private void Advance()
 {
     m_CurrentBuffer = m_CurrentBuffer == null ? m_Buffers : m_CurrentBuffer.NextBuffer;
     m_CurrentBuffer.WaitFor();
 }
Esempio n. 15
0
 private void Advance()
 {
     this.m_CurrentBuffer = this.m_CurrentBuffer == null ? this.m_Buffers : this.m_CurrentBuffer.NextBuffer;
     this.m_CurrentBuffer.WaitFor();
 }
Esempio n. 16
0
 /// <summary>Advance buffer</summary>
 private void Advance()
 {
     _cCurrentBuffer = _cCurrentBuffer == null ? _cBuffers : _cCurrentBuffer._cNextBuffer;
     _cCurrentBuffer.WaitFor();
 }