Exemplo n.º 1
0
Arquivo: WaveIn.cs Projeto: BJFX/UWACN
        private void WaitForAllBuffers()
        {
            WaveInBuffer Buf = m_Buffers;

            while (Buf.NextBuffer != m_Buffers)
            {
                Buf.WaitFor();
                Buf = Buf.NextBuffer;
            }
        }
Exemplo n.º 2
0
Arquivo: WaveIn.cs Projeto: BJFX/UWACN
 internal static void WaveInProc(IntPtr hdrvr, int uMsg, int dwUser, ref WaveNative.WaveHdr wavhdr, int dwParam2)
 {
     if (uMsg == WaveNative.MM_WIM_DATA)
     {
         try
         {
             GCHandle     h   = (GCHandle)wavhdr.dwUser;
             WaveInBuffer buf = (WaveInBuffer)h.Target;
             buf.OnCompleted();
         }
         catch
         {
         }
     }
 }
Exemplo n.º 3
0
Arquivo: WaveIn.cs Projeto: BJFX/UWACN
        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);
            }
        }
Exemplo n.º 4
0
Arquivo: WaveIn.cs Projeto: BJFX/UWACN
 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;
         }
     }
 }
Exemplo n.º 5
0
Arquivo: WaveIn.cs Projeto: BJFX/UWACN
 private void SelectNextBuffer()
 {
     m_CurrentBuffer = m_CurrentBuffer == null ? m_Buffers : m_CurrentBuffer.NextBuffer;
 }