waveInClose() private method

private waveInClose ( IntPtr hwi ) : int
hwi System.IntPtr
return int
Esempio n. 1
0
 public void Dispose()
 {
     if (m_Thread != null)
     {
         try
         {
             m_Finished = true;
             if (m_WaveIn != IntPtr.Zero)
             {
                 WaveNative.waveInReset(m_WaveIn);
             }
             WaitForAllBuffers();
             m_Thread.Join();
             m_DoneProc = null;
             FreeBuffers();
             if (m_WaveIn != IntPtr.Zero)
             {
                 WaveNative.waveInClose(m_WaveIn);
             }
         }
         finally
         {
             m_Thread = null;
             m_WaveIn = IntPtr.Zero;
         }
     }
     GC.SuppressFinalize(this);
 }
Esempio n. 2
0
        public void Close()
        {
            m_Finished = true;
            WaveInRecorder.ThrowOnError(WaveNative.waveInReset(m_WaveIn));

            m_Thread.Join();
            m_Thread   = null;
            m_DoneProc = null;

            buffer1.WaitFor();
            buffer2.WaitFor();

            buffer1.Close();
            buffer2.Close();

            WaveInRecorder.ThrowOnError(WaveNative.waveInClose(m_WaveIn));
            m_WaveIn = IntPtr.Zero;
        }